OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/debug/debug-evaluate.h" | 8 #include "src/debug/debug-evaluate.h" |
9 #include "src/debug/debug-frames.h" | 9 #include "src/debug/debug-frames.h" |
10 #include "src/debug/debug-scopes.h" | 10 #include "src/debug/debug-scopes.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 544 |
545 if (it.is_wasm()) { | 545 if (it.is_wasm()) { |
546 // Create the details array (no dynamic information for wasm). | 546 // Create the details array (no dynamic information for wasm). |
547 Handle<FixedArray> details = | 547 Handle<FixedArray> details = |
548 isolate->factory()->NewFixedArray(kFrameDetailsFirstDynamicIndex); | 548 isolate->factory()->NewFixedArray(kFrameDetailsFirstDynamicIndex); |
549 | 549 |
550 // Add the frame id. | 550 // Add the frame id. |
551 details->set(kFrameDetailsFrameIdIndex, *frame_id); | 551 details->set(kFrameDetailsFrameIdIndex, *frame_id); |
552 | 552 |
553 // Add the function name. | 553 // Add the function name. |
554 Handle<Object> wasm_obj(it.wasm_frame()->wasm_obj(), isolate); | 554 Handle<Object> wasm_instance(it.wasm_frame()->wasm_instance(), isolate); |
555 int func_index = it.wasm_frame()->function_index(); | 555 int func_index = it.wasm_frame()->function_index(); |
556 Handle<String> func_name = | 556 Handle<String> func_name = |
557 wasm::GetWasmFunctionName(isolate, wasm_obj, func_index); | 557 wasm::GetWasmFunctionName(isolate, wasm_instance, func_index); |
558 details->set(kFrameDetailsFunctionIndex, *func_name); | 558 details->set(kFrameDetailsFunctionIndex, *func_name); |
559 | 559 |
560 // Add the script wrapper | 560 // Add the script wrapper |
561 Handle<Object> script_wrapper = | 561 Handle<Object> script_wrapper = |
562 Script::GetWrapper(frame_inspector.GetScript()); | 562 Script::GetWrapper(frame_inspector.GetScript()); |
563 details->set(kFrameDetailsScriptIndex, *script_wrapper); | 563 details->set(kFrameDetailsScriptIndex, *script_wrapper); |
564 | 564 |
565 // Add the arguments count. | 565 // Add the arguments count. |
566 details->set(kFrameDetailsArgumentCountIndex, Smi::kZero); | 566 details->set(kFrameDetailsArgumentCountIndex, Smi::kZero); |
567 | 567 |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1852 | 1852 |
1853 RUNTIME_FUNCTION(Runtime_GetWasmFunctionOffsetTable) { | 1853 RUNTIME_FUNCTION(Runtime_GetWasmFunctionOffsetTable) { |
1854 DCHECK(args.length() == 1); | 1854 DCHECK(args.length() == 1); |
1855 HandleScope scope(isolate); | 1855 HandleScope scope(isolate); |
1856 CONVERT_ARG_CHECKED(JSValue, script_val, 0); | 1856 CONVERT_ARG_CHECKED(JSValue, script_val, 0); |
1857 | 1857 |
1858 CHECK(script_val->value()->IsScript()); | 1858 CHECK(script_val->value()->IsScript()); |
1859 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); | 1859 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); |
1860 | 1860 |
1861 Handle<wasm::WasmDebugInfo> debug_info = | 1861 Handle<wasm::WasmDebugInfo> debug_info = |
1862 wasm::GetDebugInfo(handle(script->wasm_object(), isolate)); | 1862 wasm::GetDebugInfo(handle(script->wasm_instance(), isolate)); |
1863 Handle<FixedArray> elements = wasm::WasmDebugInfo::GetFunctionOffsetTable( | 1863 Handle<FixedArray> elements = wasm::WasmDebugInfo::GetFunctionOffsetTable( |
1864 debug_info, script->wasm_function_index()); | 1864 debug_info, script->wasm_function_index()); |
1865 return *isolate->factory()->NewJSArrayWithElements(elements); | 1865 return *isolate->factory()->NewJSArrayWithElements(elements); |
1866 } | 1866 } |
1867 | 1867 |
1868 RUNTIME_FUNCTION(Runtime_DisassembleWasmFunction) { | 1868 RUNTIME_FUNCTION(Runtime_DisassembleWasmFunction) { |
1869 DCHECK(args.length() == 1); | 1869 DCHECK(args.length() == 1); |
1870 HandleScope scope(isolate); | 1870 HandleScope scope(isolate); |
1871 CONVERT_ARG_CHECKED(JSValue, script_val, 0); | 1871 CONVERT_ARG_CHECKED(JSValue, script_val, 0); |
1872 | 1872 |
1873 CHECK(script_val->value()->IsScript()); | 1873 CHECK(script_val->value()->IsScript()); |
1874 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); | 1874 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); |
1875 | 1875 |
1876 Handle<wasm::WasmDebugInfo> debug_info = | 1876 Handle<wasm::WasmDebugInfo> debug_info = |
1877 wasm::GetDebugInfo(handle(script->wasm_object(), isolate)); | 1877 wasm::GetDebugInfo(handle(script->wasm_instance(), isolate)); |
1878 return *wasm::WasmDebugInfo::DisassembleFunction( | 1878 return *wasm::WasmDebugInfo::DisassembleFunction( |
1879 debug_info, script->wasm_function_index()); | 1879 debug_info, script->wasm_function_index()); |
1880 } | 1880 } |
1881 | 1881 |
1882 } // namespace internal | 1882 } // namespace internal |
1883 } // namespace v8 | 1883 } // namespace v8 |
OLD | NEW |