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 "src/api.h" | 7 #include "src/api.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (!Done()) Next(); | 79 if (!Done()) Next(); |
80 } | 80 } |
81 | 81 |
82 | 82 |
83 int BreakLocation::Iterator::GetModeMask(BreakLocatorType type) { | 83 int BreakLocation::Iterator::GetModeMask(BreakLocatorType type) { |
84 int mask = 0; | 84 int mask = 0; |
85 mask |= RelocInfo::ModeMask(RelocInfo::POSITION); | 85 mask |= RelocInfo::ModeMask(RelocInfo::POSITION); |
86 mask |= RelocInfo::ModeMask(RelocInfo::STATEMENT_POSITION); | 86 mask |= RelocInfo::ModeMask(RelocInfo::STATEMENT_POSITION); |
87 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN); | 87 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN); |
88 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_CALL); | 88 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_CALL); |
89 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL); | |
90 if (type == ALL_BREAK_LOCATIONS) { | 89 if (type == ALL_BREAK_LOCATIONS) { |
91 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION); | 90 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION); |
92 mask |= RelocInfo::ModeMask(RelocInfo::DEBUGGER_STATEMENT); | 91 mask |= RelocInfo::ModeMask(RelocInfo::DEBUGGER_STATEMENT); |
93 } | 92 } |
94 return mask; | 93 return mask; |
95 } | 94 } |
96 | 95 |
97 | 96 |
98 void BreakLocation::Iterator::Next() { | 97 void BreakLocation::Iterator::Next() { |
99 DisallowHeapAllocation no_gc; | 98 DisallowHeapAllocation no_gc; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 void BreakLocation::ClearDebugBreak() { | 292 void BreakLocation::ClearDebugBreak() { |
294 // Debugger statement always calls debugger. No need to modify it. | 293 // Debugger statement always calls debugger. No need to modify it. |
295 if (IsDebuggerStatement()) return; | 294 if (IsDebuggerStatement()) return; |
296 | 295 |
297 DCHECK(IsDebugBreakSlot()); | 296 DCHECK(IsDebugBreakSlot()); |
298 DebugCodegen::ClearDebugBreakSlot(debug_info_->GetIsolate(), pc()); | 297 DebugCodegen::ClearDebugBreakSlot(debug_info_->GetIsolate(), pc()); |
299 DCHECK(!IsDebugBreak()); | 298 DCHECK(!IsDebugBreak()); |
300 } | 299 } |
301 | 300 |
302 | 301 |
303 bool BreakLocation::IsStepInLocation() const { | |
304 return IsConstructCall() || IsCall(); | |
305 } | |
306 | |
307 | |
308 bool BreakLocation::IsDebugBreak() const { | 302 bool BreakLocation::IsDebugBreak() const { |
309 if (IsDebugBreakSlot()) { | 303 if (IsDebugBreakSlot()) { |
310 return rinfo().IsPatchedDebugBreakSlotSequence(); | 304 return rinfo().IsPatchedDebugBreakSlotSequence(); |
311 } | 305 } |
312 return false; | 306 return false; |
313 } | 307 } |
314 | 308 |
315 | 309 |
316 Handle<Object> BreakLocation::BreakPointObjects() const { | 310 Handle<Object> BreakLocation::BreakPointObjects() const { |
317 return debug_info_->GetBreakPointObjects(pc_offset_); | 311 return debug_info_->GetBreakPointObjects(pc_offset_); |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 // that is currently taken by active debugger call. | 1593 // that is currently taken by active debugger call. |
1600 if (break_frame_id() == StackFrame::NO_ID) { | 1594 if (break_frame_id() == StackFrame::NO_ID) { |
1601 continue; // We are not stepping. | 1595 continue; // We are not stepping. |
1602 } else { | 1596 } else { |
1603 JavaScriptFrameIterator frame_it(isolate_, break_frame_id()); | 1597 JavaScriptFrameIterator frame_it(isolate_, break_frame_id()); |
1604 // If our frame is a top frame and we are stepping, we can do step-in | 1598 // If our frame is a top frame and we are stepping, we can do step-in |
1605 // at this place. | 1599 // at this place. |
1606 if (frame_it.frame()->id() != frame_id) continue; | 1600 if (frame_it.frame()->id() != frame_id) continue; |
1607 } | 1601 } |
1608 } | 1602 } |
1609 if (location.IsStepInLocation()) results_out->Add(location.position()); | 1603 if (location.IsCall()) results_out->Add(location.position()); |
1610 } | 1604 } |
1611 } | 1605 } |
1612 | 1606 |
1613 | 1607 |
1614 void Debug::RecordEvalCaller(Handle<Script> script) { | 1608 void Debug::RecordEvalCaller(Handle<Script> script) { |
1615 script->set_compilation_type(Script::COMPILATION_TYPE_EVAL); | 1609 script->set_compilation_type(Script::COMPILATION_TYPE_EVAL); |
1616 // For eval scripts add information on the function from which eval was | 1610 // For eval scripts add information on the function from which eval was |
1617 // called. | 1611 // called. |
1618 StackTraceFrameIterator it(script->GetIsolate()); | 1612 StackTraceFrameIterator it(script->GetIsolate()); |
1619 if (!it.done()) { | 1613 if (!it.done()) { |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2526 } | 2520 } |
2527 | 2521 |
2528 | 2522 |
2529 void LockingCommandMessageQueue::Clear() { | 2523 void LockingCommandMessageQueue::Clear() { |
2530 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2524 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2531 queue_.Clear(); | 2525 queue_.Clear(); |
2532 } | 2526 } |
2533 | 2527 |
2534 } // namespace internal | 2528 } // namespace internal |
2535 } // namespace v8 | 2529 } // namespace v8 |
OLD | NEW |