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

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

Issue 2063013004: [wasm] Disassemble wasm code from script (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-frame-inspection
Patch Set: remove unimplemented wasm SetBreakPoint method 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 3910620926dd24ec293728b6bdb24f95f89d70b8..5411ea7c68df1ac023d883e11aaa3a3864e2ae8a 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 {
@@ -1823,5 +1824,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