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

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

Issue 2708743003: [wasm] Remove remaining occurences of the context in wasm code (Closed)
Patch Set: Remove unused variables Created 3 years, 10 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
« src/compiler/wasm-compiler.cc ('K') | « src/compiler/wasm-compiler.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 61ba1f7a3d1b868d501c24e4037198cd1b55f8c5..fc8d6a09ea2d5d91d3499cc413bdc9374a4b4236 100644
--- a/src/runtime/runtime-wasm.cc
+++ b/src/runtime/runtime-wasm.cc
@@ -55,6 +55,11 @@ RUNTIME_FUNCTION(Runtime_WasmGrowMemory) {
CONVERT_UINT32_ARG_CHECKED(delta_pages, 0);
Handle<WasmInstanceObject> instance(GetWasmInstanceOnStackTop(isolate),
isolate);
+
+ // Set the current isolate's context.
+ DCHECK_NULL(isolate->context());
+ isolate->set_context(instance->compiled_module()->ptr_to_native_context());
+
return *isolate->factory()->NewNumberFromInt(
wasm::GrowMemory(isolate, instance, delta_pages));
}
@@ -147,6 +152,10 @@ RUNTIME_FUNCTION(Runtime_WasmThrow) {
const int32_t thrown_value = (upper << 16) | lower;
+ // Set the current isolate's context.
+ DCHECK_NULL(isolate->context());
+ isolate->set_context(GetWasmContextOnStackTop(isolate));
+
return isolate->Throw(*isolate->factory()->NewNumberFromInt(thrown_value));
}
@@ -178,8 +187,9 @@ RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) {
CHECK(arg_buffer_obj->IsSmi());
uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj);
- DCHECK_EQ(isolate->context(),
- instance->compiled_module()->ptr_to_native_context());
+ // Set the current isolate's context.
+ DCHECK_NULL(isolate->context());
+ isolate->set_context(instance->compiled_module()->ptr_to_native_context());
instance->debug_info()->RunInterpreter(func_index, arg_buffer);
return isolate->heap()->undefined_value();
« src/compiler/wasm-compiler.cc ('K') | « src/compiler/wasm-compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698