| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/debug/debug.h" | 5 #include "src/debug/debug.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "src/execution.h" | 21 #include "src/execution.h" |
| 22 #include "src/frames-inl.h" | 22 #include "src/frames-inl.h" |
| 23 #include "src/full-codegen/full-codegen.h" | 23 #include "src/full-codegen/full-codegen.h" |
| 24 #include "src/global-handles.h" | 24 #include "src/global-handles.h" |
| 25 #include "src/globals.h" | 25 #include "src/globals.h" |
| 26 #include "src/interpreter/interpreter.h" | 26 #include "src/interpreter/interpreter.h" |
| 27 #include "src/isolate-inl.h" | 27 #include "src/isolate-inl.h" |
| 28 #include "src/list.h" | 28 #include "src/list.h" |
| 29 #include "src/log.h" | 29 #include "src/log.h" |
| 30 #include "src/messages.h" | 30 #include "src/messages.h" |
| 31 #include "src/objects/debug-objects-inl.h" |
| 31 #include "src/snapshot/natives.h" | 32 #include "src/snapshot/natives.h" |
| 32 #include "src/wasm/wasm-module.h" | 33 #include "src/wasm/wasm-module.h" |
| 33 #include "src/wasm/wasm-objects.h" | 34 #include "src/wasm/wasm-objects.h" |
| 34 | 35 |
| 35 #include "include/v8-debug.h" | 36 #include "include/v8-debug.h" |
| 36 | 37 |
| 37 namespace v8 { | 38 namespace v8 { |
| 38 namespace internal { | 39 namespace internal { |
| 39 | 40 |
| 40 Debug::Debug(Isolate* isolate) | 41 Debug::Debug(Isolate* isolate) |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 return NOT_DEBUG_BREAK; | 242 return NOT_DEBUG_BREAK; |
| 242 } | 243 } |
| 243 } | 244 } |
| 244 | 245 |
| 245 void CodeBreakIterator::SkipToPosition(int position, | 246 void CodeBreakIterator::SkipToPosition(int position, |
| 246 BreakPositionAlignment alignment) { | 247 BreakPositionAlignment alignment) { |
| 247 CodeBreakIterator it(debug_info_); | 248 CodeBreakIterator it(debug_info_); |
| 248 SkipTo(it.BreakIndexFromPosition(position, alignment)); | 249 SkipTo(it.BreakIndexFromPosition(position, alignment)); |
| 249 } | 250 } |
| 250 | 251 |
| 252 int CodeBreakIterator::code_offset() { |
| 253 return static_cast<int>(rinfo()->pc() - |
| 254 debug_info_->DebugCode()->instruction_start()); |
| 255 } |
| 256 |
| 251 void CodeBreakIterator::SetDebugBreak() { | 257 void CodeBreakIterator::SetDebugBreak() { |
| 252 DebugBreakType debug_break_type = GetDebugBreakType(); | 258 DebugBreakType debug_break_type = GetDebugBreakType(); |
| 253 DCHECK(debug_break_type >= DEBUG_BREAK_SLOT); | 259 DCHECK(debug_break_type >= DEBUG_BREAK_SLOT); |
| 254 Builtins* builtins = isolate()->builtins(); | 260 Builtins* builtins = isolate()->builtins(); |
| 255 Handle<Code> target = debug_break_type == DEBUG_BREAK_SLOT_AT_RETURN | 261 Handle<Code> target = debug_break_type == DEBUG_BREAK_SLOT_AT_RETURN |
| 256 ? builtins->Return_DebugBreak() | 262 ? builtins->Return_DebugBreak() |
| 257 : builtins->Slot_DebugBreak(); | 263 : builtins->Slot_DebugBreak(); |
| 258 DebugCodegen::PatchDebugBreakSlot(isolate(), rinfo()->pc(), target); | 264 DebugCodegen::PatchDebugBreakSlot(isolate(), rinfo()->pc(), target); |
| 259 } | 265 } |
| 260 | 266 |
| (...skipping 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 isolate_->Throw(*isolate_->factory()->NewEvalError( | 2450 isolate_->Throw(*isolate_->factory()->NewEvalError( |
| 2445 MessageTemplate::kNoSideEffectDebugEvaluate)); | 2451 MessageTemplate::kNoSideEffectDebugEvaluate)); |
| 2446 } | 2452 } |
| 2447 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); | 2453 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); |
| 2448 isolate_->debug()->UpdateHookOnFunctionCall(); | 2454 isolate_->debug()->UpdateHookOnFunctionCall(); |
| 2449 isolate_->debug()->side_effect_check_failed_ = false; | 2455 isolate_->debug()->side_effect_check_failed_ = false; |
| 2450 } | 2456 } |
| 2451 | 2457 |
| 2452 } // namespace internal | 2458 } // namespace internal |
| 2453 } // namespace v8 | 2459 } // namespace v8 |
| OLD | NEW |