Skip to content

Commit

Permalink
chore: cherry-pick 2ac0620a5bbb from v8 (#36295)
Browse files Browse the repository at this point in the history
* chore: [19-x-y] cherry-pick 2ac0620a5bbb from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
  • Loading branch information
ppontes and patchup[bot] committed Nov 14, 2022
1 parent bd5166a commit 4450b7b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions patches/v8/.patches
Expand Up @@ -13,3 +13,4 @@ cherry-pick-8b040cb69e96.patch
cherry-pick-194bcc127f21.patch
cherry-pick-ec236fef54b8.patch
cherry-pick-80ed4b917477.patch
cherry-pick-2ac0620a5bbb.patch
49 changes: 49 additions & 0 deletions patches/v8/cherry-pick-2ac0620a5bbb.patch
@@ -0,0 +1,49 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Thibaud Michaud <thibaudm@chromium.org>
Date: Wed, 26 Oct 2022 17:03:36 +0200
Subject: Merged: [wasm] Reload cached instance fields in catch handler

Bug: chromium:1377816
(cherry picked from commit f517e518af26b7eac23c9e328b463eb1e8ee3499)

Change-Id: I993bcff0389a1ba134e89e8ac5299d742ddd150c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3999134
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.6@{#47}
Cr-Branched-From: 41bc7435693fbce8ef86753cd9239e30550a3e2d-refs/heads/10.6.194@{#1}
Cr-Branched-From: d5f29b929ce7746409201d77f44048f3e9529b40-refs/heads/main@{#82548}

diff --git a/src/wasm/graph-builder-interface.cc b/src/wasm/graph-builder-interface.cc
index f2d776435dd8cff94eea9533a06f6023813a233b..24452564d8159fbaed1acec98c30832b1383c1d8 100644
--- a/src/wasm/graph-builder-interface.cc
+++ b/src/wasm/graph-builder-interface.cc
@@ -87,6 +87,7 @@ class WasmGraphBuildingInterface {
struct TryInfo : public ZoneObject {
SsaEnv* catch_env;
TFNode* exception = nullptr;
+ bool first_catch = true;

bool might_throw() const { return exception != nullptr; }

@@ -879,6 +880,10 @@ class WasmGraphBuildingInterface {

TFNode* exception = block->try_info->exception;
SetEnv(block->try_info->catch_env);
+ if (block->try_info->first_catch) {
+ LoadContextIntoSsa(ssa_env_);
+ block->try_info->first_catch = false;
+ }

TFNode* if_catch = nullptr;
TFNode* if_no_catch = nullptr;
@@ -956,6 +961,9 @@ class WasmGraphBuildingInterface {
}

SetEnv(block->try_info->catch_env);
+ if (block->try_info->first_catch) {
+ LoadContextIntoSsa(ssa_env_);
+ }
}

void AtomicOp(FullDecoder* decoder, WasmOpcode opcode,

0 comments on commit 4450b7b

Please sign in to comment.