Chromium Code Reviews| 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) { |
|
ahaas
2016/06/29 14:27:27
I think this function should move to runtime-wasm.
titzer
2016/06/30 08:12:51
Since these primarily have to do with debugging (a
|
| + 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) { |
|
ahaas
2016/06/29 14:27:27
Same here.
|
| + 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 |