Skip to content

Commit f517e51

Browse files
thibaudmichaudV8 LUCI CQ
authored andcommitted
[wasm] Reload cached instance fields in catch handler
The memory start and size are reloaded after a call in case the call grows the memory. We should also reload them when the call throws. We don't need to reload in the 'delegate' case since this will be handled by the catch handler that it delegates to. [email protected] Bug: chromium:1377816 Change-Id: Ied1cdb6ed83c1de6a5992df21d776aca9ccf02e6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3982115 Commit-Queue: Thibaud Michaud <[email protected]> Reviewed-by: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#83959}
1 parent 648958b commit f517e51

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/wasm/graph-builder-interface.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class WasmGraphBuildingInterface {
8989
struct TryInfo : public ZoneObject {
9090
SsaEnv* catch_env;
9191
TFNode* exception = nullptr;
92+
bool first_catch = true;
9293

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

@@ -936,6 +937,10 @@ class WasmGraphBuildingInterface {
936937

937938
TFNode* exception = block->try_info->exception;
938939
SetEnv(block->try_info->catch_env);
940+
if (block->try_info->first_catch) {
941+
LoadContextIntoSsa(ssa_env_, decoder);
942+
block->try_info->first_catch = false;
943+
}
939944

940945
TFNode* if_catch = nullptr;
941946
TFNode* if_no_catch = nullptr;
@@ -1013,6 +1018,9 @@ class WasmGraphBuildingInterface {
10131018
}
10141019

10151020
SetEnv(block->try_info->catch_env);
1021+
if (block->try_info->first_catch) {
1022+
LoadContextIntoSsa(ssa_env_, decoder);
1023+
}
10161024
}
10171025

10181026
void AtomicOp(FullDecoder* decoder, WasmOpcode opcode,

0 commit comments

Comments
 (0)