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

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

Issue 2105303002: [wasm] Disassemble wasm code from script (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [wasm] Disassemble wasm code from script Created 4 years, 6 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/runtime/runtime.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index c65330c553e870fcaffdcb3611d0180484e041f3..3fb27093d39ce47d90b05be8538b371e6dd07116 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -14,6 +14,7 @@
#include "src/interpreter/interpreter.h"
#include "src/isolate-inl.h"
#include "src/runtime/runtime.h"
+#include "src/wasm/wasm-debug.h"
#include "src/wasm/wasm-module.h"
namespace v8 {
@@ -1785,5 +1786,35 @@ RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
UNIMPLEMENTED();
return NULL;
}
+
+RUNTIME_FUNCTION(Runtime_GetWasmFunctionOffsetTable) {
+ DCHECK(args.length() == 1);
+ HandleScope scope(isolate);
+ CONVERT_ARG_CHECKED(JSValue, script_val, 0);
+
+ RUNTIME_ASSERT(script_val->value()->IsScript());
+ Handle<Script> script = Handle<Script>(Script::cast(script_val->value()));
+
+ Handle<wasm::WasmDebugInfo> debug_info(
+ wasm::GetDebugInfo(script->wasm_object()), isolate);
+ Handle<FixedArray> elements = wasm::WasmDebugInfo::GetFunctionOffsetTable(
+ debug_info, script->wasm_function_index());
+ return *isolate->factory()->NewJSArrayWithElements(elements);
+}
+
+RUNTIME_FUNCTION(Runtime_DisassembleWasmFunction) {
+ DCHECK(args.length() == 1);
+ HandleScope scope(isolate);
+ CONVERT_ARG_CHECKED(JSValue, script_val, 0);
+
+ RUNTIME_ASSERT(script_val->value()->IsScript());
+ Handle<Script> script = Handle<Script>(Script::cast(script_val->value()));
+
+ Handle<wasm::WasmDebugInfo> debug_info(
+ wasm::GetDebugInfo(script->wasm_object()), isolate);
+ return *wasm::WasmDebugInfo::DisassembleFunction(
+ debug_info, script->wasm_function_index());
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/runtime/runtime.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698