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

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

Issue 2619803004: [wasm] Add support for compiling WASM_INTERPRETER_ENTRY stubs (Closed)
Patch Set: Address comments 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
Index: src/runtime/runtime-wasm.cc
diff --git a/src/runtime/runtime-wasm.cc b/src/runtime/runtime-wasm.cc
index 46782cf575c1971bda284c87771f0a2017029948..6158fdd79d5905af6af5902ddb65735d46fa2106 100644
--- a/src/runtime/runtime-wasm.cc
+++ b/src/runtime/runtime-wasm.cc
@@ -152,5 +152,25 @@ RUNTIME_FUNCTION(Runtime_WasmGetCaughtExceptionValue) {
return exception;
}
+RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) {
+ DCHECK(args.length() == 3);
+ HandleScope scope(isolate);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0);
+ CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]);
+ CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2);
titzer 2017/01/11 15:52:34 Hmmm, not sure converting the argument buffer to O
Clemens Hammacher 2017/01/11 16:56:10 But what do I do with the Smi? I would just reinte
+ CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj));
+
+ // The arg buffer is the raw pointer to the caller's stack.
+ CHECK(!arg_buffer_obj->IsHeapObject());
+ void* arg_buffer = *arg_buffer_obj;
+
+ Handle<WasmInstanceObject> instance =
+ Handle<WasmInstanceObject>::cast(instance_obj);
+ Handle<WasmDebugInfo> debug_info =
+ WasmInstanceObject::GetOrCreateDebugInfo(instance);
+ WasmDebugInfo::RunInterpreter(debug_info, func_index, arg_buffer);
+ return isolate->heap()->undefined_value();
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698