OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/assembler-inl.h" | 5 #include "src/assembler-inl.h" |
6 #include "src/assert-scope.h" | 6 #include "src/assert-scope.h" |
7 #include "src/compiler/wasm-compiler.h" | 7 #include "src/compiler/wasm-compiler.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // If we hit a breakpoint, pass a JSArray with all breakpoints, otherwise | 171 // If we hit a breakpoint, pass a JSArray with all breakpoints, otherwise |
172 // pass undefined. | 172 // pass undefined. |
173 Handle<Object> hit_breakpoints_js; | 173 Handle<Object> hit_breakpoints_js; |
174 if (hit_breakpoints.is_null()) { | 174 if (hit_breakpoints.is_null()) { |
175 hit_breakpoints_js = isolate_->factory()->undefined_value(); | 175 hit_breakpoints_js = isolate_->factory()->undefined_value(); |
176 } else { | 176 } else { |
177 hit_breakpoints_js = isolate_->factory()->NewJSArrayWithElements( | 177 hit_breakpoints_js = isolate_->factory()->NewJSArrayWithElements( |
178 hit_breakpoints.ToHandleChecked()); | 178 hit_breakpoints.ToHandleChecked()); |
179 } | 179 } |
180 | 180 |
181 isolate_->debug()->OnDebugBreak(hit_breakpoints_js, false); | 181 isolate_->debug()->OnDebugBreak(hit_breakpoints_js); |
182 } | 182 } |
183 | 183 |
184 int GetTopPosition(Handle<WasmCompiledModule> compiled_module) { | 184 int GetTopPosition(Handle<WasmCompiledModule> compiled_module) { |
185 DCHECK_EQ(1, interpreter()->GetThreadCount()); | 185 DCHECK_EQ(1, interpreter()->GetThreadCount()); |
186 WasmInterpreter::Thread* thread = interpreter()->GetThread(0); | 186 WasmInterpreter::Thread* thread = interpreter()->GetThread(0); |
187 DCHECK_LT(0, thread->GetFrameCount()); | 187 DCHECK_LT(0, thread->GetFrameCount()); |
188 | 188 |
189 wasm::InterpretedFrame frame = | 189 wasm::InterpretedFrame frame = |
190 thread->GetFrame(thread->GetFrameCount() - 1); | 190 thread->GetFrame(thread->GetFrameCount() - 1); |
191 return compiled_module->GetFunctionOffset(frame.function()->func_index) + | 191 return compiled_module->GetFunctionOffset(frame.function()->func_index) + |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 360 |
361 std::vector<std::pair<uint32_t, int>> WasmDebugInfo::GetInterpretedStack( | 361 std::vector<std::pair<uint32_t, int>> WasmDebugInfo::GetInterpretedStack( |
362 Address frame_pointer) { | 362 Address frame_pointer) { |
363 return GetInterpreterHandle(this)->GetInterpretedStack(frame_pointer); | 363 return GetInterpreterHandle(this)->GetInterpretedStack(frame_pointer); |
364 } | 364 } |
365 | 365 |
366 std::unique_ptr<wasm::InterpretedFrame> WasmDebugInfo::GetInterpretedFrame( | 366 std::unique_ptr<wasm::InterpretedFrame> WasmDebugInfo::GetInterpretedFrame( |
367 Address frame_pointer, int idx) { | 367 Address frame_pointer, int idx) { |
368 return GetInterpreterHandle(this)->GetInterpretedFrame(frame_pointer, idx); | 368 return GetInterpreterHandle(this)->GetInterpretedFrame(frame_pointer, idx); |
369 } | 369 } |
OLD | NEW |