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

Side by Side 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, 5 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/frames-inl.h" 12 #include "src/frames-inl.h"
13 #include "src/interpreter/bytecodes.h" 13 #include "src/interpreter/bytecodes.h"
14 #include "src/interpreter/interpreter.h" 14 #include "src/interpreter/interpreter.h"
15 #include "src/isolate-inl.h" 15 #include "src/isolate-inl.h"
16 #include "src/runtime/runtime.h" 16 #include "src/runtime/runtime.h"
17 #include "src/wasm/wasm-debug.h"
17 #include "src/wasm/wasm-module.h" 18 #include "src/wasm/wasm-module.h"
18 19
19 namespace v8 { 20 namespace v8 {
20 namespace internal { 21 namespace internal {
21 22
22 RUNTIME_FUNCTION(Runtime_DebugBreak) { 23 RUNTIME_FUNCTION(Runtime_DebugBreak) {
23 SealHandleScope shs(isolate); 24 SealHandleScope shs(isolate);
24 DCHECK(args.length() == 1); 25 DCHECK(args.length() == 1);
25 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); 26 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
26 isolate->debug()->set_return_value(value); 27 isolate->debug()->set_return_value(value);
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 RUNTIME_FUNCTION(Runtime_DebugIsActive) { 1817 RUNTIME_FUNCTION(Runtime_DebugIsActive) {
1817 SealHandleScope shs(isolate); 1818 SealHandleScope shs(isolate);
1818 return Smi::FromInt(isolate->debug()->is_active()); 1819 return Smi::FromInt(isolate->debug()->is_active());
1819 } 1820 }
1820 1821
1821 1822
1822 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 1823 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
1823 UNIMPLEMENTED(); 1824 UNIMPLEMENTED();
1824 return NULL; 1825 return NULL;
1825 } 1826 }
1827
1828 RUNTIME_FUNCTION(Runtime_GetWasmFunctionOffsetTable) {
1829 DCHECK(args.length() == 1);
1830 HandleScope scope(isolate);
1831 CONVERT_ARG_CHECKED(JSValue, script_val, 0);
1832
1833 RUNTIME_ASSERT(script_val->value()->IsScript());
1834 Handle<Script> script = Handle<Script>(Script::cast(script_val->value()));
1835
1836 Handle<wasm::WasmDebugInfo> debug_info(
1837 wasm::GetDebugInfo(script->wasm_object()), isolate);
1838 Handle<FixedArray> elements = wasm::WasmDebugInfo::GetFunctionOffsetTable(
1839 debug_info, script->wasm_function_index());
1840 return *isolate->factory()->NewJSArrayWithElements(elements);
1841 }
1842
1843 RUNTIME_FUNCTION(Runtime_DisassembleWasmFunction) {
1844 DCHECK(args.length() == 1);
1845 HandleScope scope(isolate);
1846 CONVERT_ARG_CHECKED(JSValue, script_val, 0);
1847
1848 RUNTIME_ASSERT(script_val->value()->IsScript());
1849 Handle<Script> script = Handle<Script>(Script::cast(script_val->value()));
1850
1851 Handle<wasm::WasmDebugInfo> debug_info(
1852 wasm::GetDebugInfo(script->wasm_object()), isolate);
1853 return *wasm::WasmDebugInfo::DisassembleFunction(
1854 debug_info, script->wasm_function_index());
1855 }
1856
1826 } // namespace internal 1857 } // namespace internal
1827 } // namespace v8 1858 } // namespace v8
OLDNEW
« 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