Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: src/runtime/runtime-wasm.cc

Issue 2664273002: [wasm] Acquire the context for TrapIf from a wasm frame (Closed)
Patch Set: Add DCHECK_NULL(isolate->context()); Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-wasm.cc
diff --git a/src/runtime/runtime-wasm.cc b/src/runtime/runtime-wasm.cc
index d7e1dba54f7f18f10946e1397c49e064d707c1c0..3ed63879add0dd24a128c273ff0075f92070f276 100644
--- a/src/runtime/runtime-wasm.cc
+++ b/src/runtime/runtime-wasm.cc
@@ -55,6 +55,14 @@ RUNTIME_FUNCTION(Runtime_WasmGrowMemory) {
Object* ThrowRuntimeError(Isolate* isolate, int message_id, int byte_offset,
bool patch_source_position) {
HandleScope scope(isolate);
+ DCHECK_NULL(isolate->context());
+ StackFrameIterator it(isolate);
+ it.Advance();
+ CHECK(it.frame()->is_wasm_compiled());
+ isolate->set_context(*WasmCompiledFrame::cast(it.frame())
+ ->wasm_instance()
+ ->compiled_module()
+ ->native_context());
Handle<Object> error_obj = isolate->factory()->NewWasmRuntimeError(
static_cast<MessageTemplate::Template>(message_id));
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698