| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 while (!Done()) { | 193 while (!Done()) { |
| 194 if (!first) source_position_iterator_.Advance(); | 194 if (!first) source_position_iterator_.Advance(); |
| 195 first = false; | 195 first = false; |
| 196 if (Done()) return; | 196 if (Done()) return; |
| 197 position_ = source_position_iterator_.source_position() - start_position_; | 197 position_ = source_position_iterator_.source_position() - start_position_; |
| 198 if (source_position_iterator_.is_statement()) { | 198 if (source_position_iterator_.is_statement()) { |
| 199 statement_position_ = position_; | 199 statement_position_ = position_; |
| 200 } | 200 } |
| 201 DCHECK(position_ >= 0); | 201 DCHECK(position_ >= 0); |
| 202 DCHECK(statement_position_ >= 0); | 202 DCHECK(statement_position_ >= 0); |
| 203 break_index_++; | |
| 204 | 203 |
| 205 enum DebugBreakType type = GetDebugBreakType(); | 204 enum DebugBreakType type = GetDebugBreakType(); |
| 206 if (type == NOT_DEBUG_BREAK) continue; | 205 if (type == NOT_DEBUG_BREAK) continue; |
| 207 | 206 |
| 208 if (break_locator_type_ == ALL_BREAK_LOCATIONS) break; | 207 if (break_locator_type_ == ALL_BREAK_LOCATIONS) break; |
| 209 | 208 |
| 210 DCHECK_EQ(CALLS_AND_RETURNS, break_locator_type_); | 209 DCHECK_EQ(CALLS_AND_RETURNS, break_locator_type_); |
| 211 if (type == DEBUG_BREAK_SLOT_AT_CALL) break; | 210 if (type == DEBUG_BREAK_SLOT_AT_CALL) break; |
| 212 if (type == DEBUG_BREAK_SLOT_AT_RETURN) { | 211 if (type == DEBUG_BREAK_SLOT_AT_RETURN) { |
| 213 DCHECK_EQ(ReturnPosition(), position_); | 212 DCHECK_EQ(ReturnPosition(), position_); |
| 214 DCHECK_EQ(ReturnPosition(), statement_position_); | 213 DCHECK_EQ(ReturnPosition(), statement_position_); |
| 215 break; | 214 break; |
| 216 } | 215 } |
| 217 } | 216 } |
| 217 break_index_++; |
| 218 } | 218 } |
| 219 | 219 |
| 220 BreakLocation::DebugBreakType | 220 BreakLocation::DebugBreakType |
| 221 BreakLocation::BytecodeArrayIterator::GetDebugBreakType() { | 221 BreakLocation::BytecodeArrayIterator::GetDebugBreakType() { |
| 222 BytecodeArray* bytecode_array = debug_info_->original_bytecode_array(); | 222 BytecodeArray* bytecode_array = debug_info_->original_bytecode_array(); |
| 223 interpreter::Bytecode bytecode = | 223 interpreter::Bytecode bytecode = |
| 224 interpreter::Bytecodes::FromByte(bytecode_array->get(code_offset())); | 224 interpreter::Bytecodes::FromByte(bytecode_array->get(code_offset())); |
| 225 | 225 |
| 226 if (bytecode == interpreter::Bytecode::kDebugger) { | 226 if (bytecode == interpreter::Bytecode::kDebugger) { |
| 227 return DEBUGGER_STATEMENT; | 227 return DEBUGGER_STATEMENT; |
| (...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2620 } | 2620 } |
| 2621 | 2621 |
| 2622 | 2622 |
| 2623 void LockingCommandMessageQueue::Clear() { | 2623 void LockingCommandMessageQueue::Clear() { |
| 2624 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2624 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
| 2625 queue_.Clear(); | 2625 queue_.Clear(); |
| 2626 } | 2626 } |
| 2627 | 2627 |
| 2628 } // namespace internal | 2628 } // namespace internal |
| 2629 } // namespace v8 | 2629 } // namespace v8 |
| OLD | NEW |