| Index: src/runtime/runtime-debug.cc
|
| diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
|
| index 07fba5ded7c64919673440a6328b33632477dc1d..3948c0c54b486121708ed83c4d66443939313509 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 {
|
| @@ -1787,5 +1788,32 @@ 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<FixedArray> elements =
|
| + wasm::GetDebugInfo(script->wasm_object())
|
| + ->GetFunctionOffsetTable(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()));
|
| +
|
| + return *wasm::GetDebugInfo(script->wasm_object())
|
| + ->DisassembleFunction(script->wasm_function_index());
|
| +}
|
| +
|
| } // namespace internal
|
| } // namespace v8
|
|
|