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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 Next(); | 180 Next(); |
181 } | 181 } |
182 return closest_break; | 182 return closest_break; |
183 } | 183 } |
184 | 184 |
185 CodeBreakIterator::CodeBreakIterator(Handle<DebugInfo> debug_info) | 185 CodeBreakIterator::CodeBreakIterator(Handle<DebugInfo> debug_info) |
186 : BreakIterator(debug_info), | 186 : BreakIterator(debug_info), |
187 reloc_iterator_(debug_info->DebugCode(), GetModeMask()), | 187 reloc_iterator_(debug_info->DebugCode(), GetModeMask()), |
188 source_position_iterator_( | 188 source_position_iterator_( |
189 debug_info->DebugCode()->source_position_table()) { | 189 debug_info->DebugCode()->SourcePositionTable()) { |
190 // There is at least one break location. | 190 // There is at least one break location. |
191 DCHECK(!Done()); | 191 DCHECK(!Done()); |
192 Next(); | 192 Next(); |
193 } | 193 } |
194 | 194 |
195 int CodeBreakIterator::GetModeMask() { | 195 int CodeBreakIterator::GetModeMask() { |
196 int mask = 0; | 196 int mask = 0; |
197 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN); | 197 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN); |
198 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_CALL); | 198 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_CALL); |
199 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_TAIL_CALL); | 199 mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_TAIL_CALL); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 BreakLocation CodeBreakIterator::GetBreakLocation() { | 271 BreakLocation CodeBreakIterator::GetBreakLocation() { |
272 Handle<AbstractCode> code(AbstractCode::cast(debug_info_->DebugCode())); | 272 Handle<AbstractCode> code(AbstractCode::cast(debug_info_->DebugCode())); |
273 return BreakLocation(code, GetDebugBreakType(), code_offset(), position_); | 273 return BreakLocation(code, GetDebugBreakType(), code_offset(), position_); |
274 } | 274 } |
275 | 275 |
276 BytecodeArrayBreakIterator::BytecodeArrayBreakIterator( | 276 BytecodeArrayBreakIterator::BytecodeArrayBreakIterator( |
277 Handle<DebugInfo> debug_info) | 277 Handle<DebugInfo> debug_info) |
278 : BreakIterator(debug_info), | 278 : BreakIterator(debug_info), |
279 source_position_iterator_( | 279 source_position_iterator_( |
280 debug_info->DebugBytecodeArray()->source_position_table()) { | 280 debug_info->DebugBytecodeArray()->SourcePositionTable()) { |
281 // There is at least one break location. | 281 // There is at least one break location. |
282 DCHECK(!Done()); | 282 DCHECK(!Done()); |
283 Next(); | 283 Next(); |
284 } | 284 } |
285 | 285 |
286 void BytecodeArrayBreakIterator::Next() { | 286 void BytecodeArrayBreakIterator::Next() { |
287 DisallowHeapAllocation no_gc; | 287 DisallowHeapAllocation no_gc; |
288 DCHECK(!Done()); | 288 DCHECK(!Done()); |
289 bool first = break_index_ == -1; | 289 bool first = break_index_ == -1; |
290 while (!Done()) { | 290 while (!Done()) { |
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 isolate_->Throw(*isolate_->factory()->NewEvalError( | 2494 isolate_->Throw(*isolate_->factory()->NewEvalError( |
2495 MessageTemplate::kNoSideEffectDebugEvaluate)); | 2495 MessageTemplate::kNoSideEffectDebugEvaluate)); |
2496 } | 2496 } |
2497 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); | 2497 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); |
2498 isolate_->debug()->UpdateHookOnFunctionCall(); | 2498 isolate_->debug()->UpdateHookOnFunctionCall(); |
2499 isolate_->debug()->side_effect_check_failed_ = false; | 2499 isolate_->debug()->side_effect_check_failed_ = false; |
2500 } | 2500 } |
2501 | 2501 |
2502 } // namespace internal | 2502 } // namespace internal |
2503 } // namespace v8 | 2503 } // namespace v8 |
OLD | NEW |