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

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

Issue 2619803004: [wasm] Add support for compiling WASM_INTERPRETER_ENTRY stubs (Closed)
Patch Set: 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..237235ef7af5647efb1e845751a9f1d7866bacd0 100644
--- a/src/runtime/runtime-wasm.cc
+++ b/src/runtime/runtime-wasm.cc
@@ -152,5 +152,34 @@ RUNTIME_FUNCTION(Runtime_WasmGetCaughtExceptionValue) {
return exception;
}
+RUNTIME_FUNCTION(Runtime_GetWasmInterpreterBuffer) {
+ DCHECK(args.length() == 2);
+ HandleScope scope(isolate);
+ CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[0]);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 1);
+ CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj));
+
+ Handle<WasmInstanceObject> instance =
+ Handle<WasmInstanceObject>::cast(instance_obj);
+ Handle<WasmDebugInfo> debug_info =
+ WasmInstanceObject::GetOrCreateDebugInfo(instance);
+ return WasmDebugInfo::GetInterpreterArgBuffer(debug_info, func_index);
+}
+
+RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) {
+ DCHECK(args.length() == 2);
+ HandleScope scope(isolate);
+ CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[0]);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 1);
+ CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj));
+
+ Handle<WasmInstanceObject> instance =
+ Handle<WasmInstanceObject>::cast(instance_obj);
+ Handle<WasmDebugInfo> debug_info =
+ WasmInstanceObject::GetOrCreateDebugInfo(instance);
+ WasmDebugInfo::RunInterpreter(debug_info, func_index);
+ return isolate->heap()->undefined_value();
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698