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

Side by Side Diff: src/runtime/runtime-debug.cc

Issue 2105303002: [wasm] Disassemble wasm code from script (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [wasm] Disassemble wasm code from script 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 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 RUNTIME_FUNCTION(Runtime_DebugIsActive) { 1779 RUNTIME_FUNCTION(Runtime_DebugIsActive) {
1779 SealHandleScope shs(isolate); 1780 SealHandleScope shs(isolate);
1780 return Smi::FromInt(isolate->debug()->is_active()); 1781 return Smi::FromInt(isolate->debug()->is_active());
1781 } 1782 }
1782 1783
1783 1784
1784 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 1785 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
1785 UNIMPLEMENTED(); 1786 UNIMPLEMENTED();
1786 return NULL; 1787 return NULL;
1787 } 1788 }
1789
1790 RUNTIME_FUNCTION(Runtime_GetWasmFunctionOffsetTable) {
1791 DCHECK(args.length() == 1);
1792 HandleScope scope(isolate);
1793 CONVERT_ARG_CHECKED(JSValue, script_val, 0);
1794
1795 RUNTIME_ASSERT(script_val->value()->IsScript());
1796 Handle<Script> script = Handle<Script>(Script::cast(script_val->value()));
1797
1798 Handle<wasm::WasmDebugInfo> debug_info(
1799 wasm::GetDebugInfo(script->wasm_object()), isolate);
1800 Handle<FixedArray> elements = wasm::WasmDebugInfo::GetFunctionOffsetTable(
1801 debug_info, script->wasm_function_index());
1802 return *isolate->factory()->NewJSArrayWithElements(elements);
1803 }
1804
1805 RUNTIME_FUNCTION(Runtime_DisassembleWasmFunction) {
1806 DCHECK(args.length() == 1);
1807 HandleScope scope(isolate);
1808 CONVERT_ARG_CHECKED(JSValue, script_val, 0);
1809
1810 RUNTIME_ASSERT(script_val->value()->IsScript());
1811 Handle<Script> script = Handle<Script>(Script::cast(script_val->value()));
1812
1813 Handle<wasm::WasmDebugInfo> debug_info(
1814 wasm::GetDebugInfo(script->wasm_object()), isolate);
1815 return *wasm::WasmDebugInfo::DisassembleFunction(
1816 debug_info, script->wasm_function_index());
1817 }
1818
1788 } // namespace internal 1819 } // namespace internal
1789 } // namespace v8 1820 } // 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