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" |
11 #include "src/debug/debug.h" | 11 #include "src/debug/debug.h" |
12 #include "src/debug/liveedit.h" | 12 #include "src/debug/liveedit.h" |
13 #include "src/frames-inl.h" | 13 #include "src/frames-inl.h" |
14 #include "src/globals.h" | 14 #include "src/globals.h" |
15 #include "src/interpreter/bytecodes.h" | 15 #include "src/interpreter/bytecodes.h" |
16 #include "src/interpreter/interpreter.h" | 16 #include "src/interpreter/interpreter.h" |
17 #include "src/isolate-inl.h" | 17 #include "src/isolate-inl.h" |
18 #include "src/runtime/runtime.h" | 18 #include "src/runtime/runtime.h" |
19 #include "src/wasm/wasm-debug.h" | |
20 #include "src/wasm/wasm-module.h" | 19 #include "src/wasm/wasm-module.h" |
| 20 #include "src/wasm/wasm-objects.h" |
21 | 21 |
22 namespace v8 { | 22 namespace v8 { |
23 namespace internal { | 23 namespace internal { |
24 | 24 |
25 RUNTIME_FUNCTION(Runtime_DebugBreak) { | 25 RUNTIME_FUNCTION(Runtime_DebugBreak) { |
26 SealHandleScope shs(isolate); | 26 SealHandleScope shs(isolate); |
27 DCHECK(args.length() == 1); | 27 DCHECK(args.length() == 1); |
28 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); | 28 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); |
29 isolate->debug()->set_return_value(value); | 29 isolate->debug()->set_return_value(value); |
30 | 30 |
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1899 | 1899 |
1900 // TODO(5530): Remove once uses in debug.js are gone. | 1900 // TODO(5530): Remove once uses in debug.js are gone. |
1901 RUNTIME_FUNCTION(Runtime_GetWasmFunctionOffsetTable) { | 1901 RUNTIME_FUNCTION(Runtime_GetWasmFunctionOffsetTable) { |
1902 DCHECK(args.length() == 1); | 1902 DCHECK(args.length() == 1); |
1903 HandleScope scope(isolate); | 1903 HandleScope scope(isolate); |
1904 CONVERT_ARG_CHECKED(JSValue, script_val, 0); | 1904 CONVERT_ARG_CHECKED(JSValue, script_val, 0); |
1905 | 1905 |
1906 CHECK(script_val->value()->IsScript()); | 1906 CHECK(script_val->value()->IsScript()); |
1907 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); | 1907 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); |
1908 | 1908 |
1909 Handle<wasm::WasmDebugInfo> debug_info = | 1909 Handle<WasmDebugInfo> debug_info = |
1910 wasm::GetDebugInfo(handle(script->wasm_instance(), isolate)); | 1910 wasm::GetDebugInfo(handle(script->wasm_instance(), isolate)); |
1911 Handle<FixedArray> elements = wasm::WasmDebugInfo::GetFunctionOffsetTable( | 1911 Handle<FixedArray> elements = WasmDebugInfo::GetFunctionOffsetTable( |
1912 debug_info, script->wasm_function_index()); | 1912 debug_info, script->wasm_function_index()); |
1913 return *isolate->factory()->NewJSArrayWithElements(elements); | 1913 return *isolate->factory()->NewJSArrayWithElements(elements); |
1914 } | 1914 } |
1915 | 1915 |
1916 // TODO(5530): Remove once uses in debug.js are gone. | 1916 // TODO(5530): Remove once uses in debug.js are gone. |
1917 RUNTIME_FUNCTION(Runtime_DisassembleWasmFunction) { | 1917 RUNTIME_FUNCTION(Runtime_DisassembleWasmFunction) { |
1918 DCHECK(args.length() == 1); | 1918 DCHECK(args.length() == 1); |
1919 HandleScope scope(isolate); | 1919 HandleScope scope(isolate); |
1920 CONVERT_ARG_CHECKED(JSValue, script_val, 0); | 1920 CONVERT_ARG_CHECKED(JSValue, script_val, 0); |
1921 | 1921 |
1922 CHECK(script_val->value()->IsScript()); | 1922 CHECK(script_val->value()->IsScript()); |
1923 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); | 1923 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); |
1924 | 1924 |
1925 Handle<wasm::WasmDebugInfo> debug_info = | 1925 Handle<WasmDebugInfo> debug_info = |
1926 wasm::GetDebugInfo(handle(script->wasm_instance(), isolate)); | 1926 wasm::GetDebugInfo(handle(script->wasm_instance(), isolate)); |
1927 return *wasm::WasmDebugInfo::DisassembleFunction( | 1927 return *WasmDebugInfo::DisassembleFunction(debug_info, |
1928 debug_info, script->wasm_function_index()); | 1928 script->wasm_function_index()); |
1929 } | 1929 } |
1930 | 1930 |
1931 } // namespace internal | 1931 } // namespace internal |
1932 } // namespace v8 | 1932 } // namespace v8 |
OLD | NEW |