V8 Project
v8::internal::BreakLocationIterator Class Reference

#include <debug.h>

+ Collaboration diagram for v8::internal::BreakLocationIterator:

Public Member Functions

 BreakLocationIterator (Handle< DebugInfo > debug_info, BreakLocatorType type)
 
virtual ~BreakLocationIterator ()
 
void Next ()
 
void Next (int count)
 
void FindBreakLocationFromAddress (Address pc)
 
void FindBreakLocationFromPosition (int position, BreakPositionAlignment alignment)
 
void Reset ()
 
bool Done () const
 
void SetBreakPoint (Handle< Object > break_point_object)
 
void ClearBreakPoint (Handle< Object > break_point_object)
 
void SetOneShot ()
 
void ClearOneShot ()
 
bool IsStepInLocation (Isolate *isolate)
 
void PrepareStepIn (Isolate *isolate)
 
bool IsExit () const
 
bool HasBreakPoint ()
 
bool IsDebugBreak ()
 
ObjectBreakPointObjects ()
 
void ClearAllDebugBreak ()
 
int code_position ()
 
int break_point ()
 
int position ()
 
int statement_position ()
 
Address pc ()
 
Codecode ()
 
RelocInforinfo ()
 
RelocInfo::Mode rmode () const
 
RelocInfooriginal_rinfo ()
 
RelocInfo::Mode original_rmode () const
 
bool IsDebuggerStatement ()
 

Protected Member Functions

bool RinfoDone () const
 
void RinfoNext ()
 

Protected Attributes

BreakLocatorType type_
 
int break_point_
 
int position_
 
int statement_position_
 
Handle< DebugInfodebug_info_
 
RelocIteratorreloc_iterator_
 
RelocIteratorreloc_iterator_original_
 

Private Member Functions

void SetDebugBreak ()
 
void ClearDebugBreak ()
 
void SetDebugBreakAtIC ()
 
void ClearDebugBreakAtIC ()
 
bool IsDebugBreakAtReturn ()
 
void SetDebugBreakAtReturn ()
 
void ClearDebugBreakAtReturn ()
 
bool IsDebugBreakSlot ()
 
bool IsDebugBreakAtSlot ()
 
void SetDebugBreakAtSlot ()
 
void ClearDebugBreakAtSlot ()
 
 DISALLOW_COPY_AND_ASSIGN (BreakLocationIterator)
 

Detailed Description

Definition at line 68 of file debug.h.

Constructor & Destructor Documentation

◆ BreakLocationIterator()

v8::internal::BreakLocationIterator::BreakLocationIterator ( Handle< DebugInfo debug_info,
BreakLocatorType  type 
)
explicit

Definition at line 62 of file debug.cc.

63  {
64  debug_info_ = debug_info;
65  type_ = type;
68  Reset(); // Initialize the rest of the member variables.
69 }
Handle< DebugInfo > debug_info_
Definition: debug.h:123
RelocIterator * reloc_iterator_
Definition: debug.h:124
RelocIterator * reloc_iterator_original_
Definition: debug.h:125
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References debug_info_, NULL, reloc_iterator_, reloc_iterator_original_, Reset(), and type_.

+ Here is the call graph for this function:

◆ ~BreakLocationIterator()

v8::internal::BreakLocationIterator::~BreakLocationIterator ( )
virtual

Definition at line 72 of file debug.cc.

72  {
75  delete reloc_iterator_;
77 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, NULL, reloc_iterator_, and reloc_iterator_original_.

Member Function Documentation

◆ break_point()

int v8::internal::BreakLocationIterator::break_point ( )
inline

Definition at line 97 of file debug.h.

References break_point_.

Referenced by FindBreakLocationFromAddress(), and FindBreakLocationFromPosition().

+ Here is the caller graph for this function:

◆ BreakPointObjects()

Object * v8::internal::BreakLocationIterator::BreakPointObjects ( )

Definition at line 519 of file debug.cc.

519  {
520  return debug_info_->GetBreakPointObjects(code_position());
521 }

References code_position(), and debug_info_.

Referenced by v8::internal::Debug::Break().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearAllDebugBreak()

void v8::internal::BreakLocationIterator::ClearAllDebugBreak ( )

Definition at line 527 of file debug.cc.

527  {
528  while (!Done()) {
529  ClearDebugBreak();
530  Next();
531  }
532 }

References ClearDebugBreak(), Done(), and Next().

Referenced by v8::internal::Debug::ClearAllBreakPoints(), and v8::internal::Debug::HandleWeakDebugInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearBreakPoint()

void v8::internal::BreakLocationIterator::ClearBreakPoint ( Handle< Object break_point_object)

Definition at line 281 of file debug.cc.

281  {
282  // Clear the break point information.
283  DebugInfo::ClearBreakPoint(debug_info_, code_position(), break_point_object);
284  // If there are no more break points here remove the debug break.
285  if (!HasBreakPoint()) {
286  ClearDebugBreak();
287  DCHECK(!IsDebugBreak());
288  }
289 }
static void ClearBreakPoint(Handle< DebugInfo > debug_info, int code_position, Handle< Object > break_point_object)
Definition: objects.cc:15891

References v8::internal::DebugInfo::ClearBreakPoint(), ClearDebugBreak(), code_position(), DCHECK, debug_info_, HasBreakPoint(), and IsDebugBreak().

Referenced by v8::internal::Debug::ClearBreakPoint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearDebugBreak()

void v8::internal::BreakLocationIterator::ClearDebugBreak ( )
private

Definition at line 347 of file debug.cc.

347  {
348  // Debugger statement always calls debugger. No need to modify it.
349  if (IsDebuggerStatement()) return;
350 
351  if (RelocInfo::IsJSReturn(rmode())) {
352  // Restore the frame exit code.
354  } else if (IsDebugBreakSlot()) {
355  // Restore the code in the break slot.
357  } else {
358  // Patch the IC call.
360  }
361  DCHECK(!IsDebugBreak());
362 }
RelocInfo::Mode rmode() const
Definition: debug.h:103
static bool IsJSReturn(Mode mode)
Definition: assembler.h:412

References ClearDebugBreakAtIC(), ClearDebugBreakAtReturn(), ClearDebugBreakAtSlot(), DCHECK, IsDebugBreak(), IsDebugBreakSlot(), IsDebuggerStatement(), v8::internal::RelocInfo::IsJSReturn(), and rmode().

Referenced by ClearAllDebugBreak(), ClearBreakPoint(), and ClearOneShot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearDebugBreakAtIC()

void v8::internal::BreakLocationIterator::ClearDebugBreakAtIC ( )
private

Definition at line 503 of file debug.cc.

503  {
504  // Patch the code to the original invoke.
505  rinfo()->set_target_address(original_rinfo()->target_address());
506 }

References original_rinfo(), and rinfo().

Referenced by ClearDebugBreak().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearDebugBreakAtReturn()

void v8::internal::BreakLocationIterator::ClearDebugBreakAtReturn ( )
private

Referenced by ClearDebugBreak().

+ Here is the caller graph for this function:

◆ ClearDebugBreakAtSlot()

void v8::internal::BreakLocationIterator::ClearDebugBreakAtSlot ( )
private

Referenced by ClearDebugBreak().

+ Here is the caller graph for this function:

◆ ClearOneShot()

void v8::internal::BreakLocationIterator::ClearOneShot ( )

Definition at line 307 of file debug.cc.

307  {
308  // Debugger statement always calls debugger. No need to modify it.
309  if (IsDebuggerStatement()) return;
310 
311  // If there is a real break point here no more to do.
312  if (HasBreakPoint()) {
313  DCHECK(IsDebugBreak());
314  return;
315  }
316 
317  // Patch code removing debug break.
318  ClearDebugBreak();
319  DCHECK(!IsDebugBreak());
320 }

References ClearDebugBreak(), DCHECK, HasBreakPoint(), IsDebugBreak(), and IsDebuggerStatement().

Referenced by v8::internal::Debug::ClearOneShot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ code()

Code* v8::internal::BreakLocationIterator::code ( )
inline

Definition at line 101 of file debug.h.

101 { return debug_info_->code(); }

References debug_info_.

Referenced by Next(), and v8::internal::Debug::StepNextContinue().

+ Here is the caller graph for this function:

◆ code_position()

int v8::internal::BreakLocationIterator::code_position ( )
inline

Definition at line 94 of file debug.h.

94  {
95  return static_cast<int>(pc() - debug_info_->code()->entry());
96  }

References debug_info_, and pc().

Referenced by BreakPointObjects(), ClearBreakPoint(), HasBreakPoint(), and SetBreakPoint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::BreakLocationIterator::DISALLOW_COPY_AND_ASSIGN ( BreakLocationIterator  )
private

◆ Done()

bool v8::internal::BreakLocationIterator::Done ( ) const

Definition at line 264 of file debug.cc.

264  {
265  return RinfoDone();
266 }

References RinfoDone().

Referenced by ClearAllDebugBreak(), v8::internal::Debug::ClearOneShot(), FindBreakLocationFromAddress(), FindBreakLocationFromPosition(), v8::internal::Debug::FloodWithOneShot(), and v8::internal::RUNTIME_FUNCTION().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindBreakLocationFromAddress()

void v8::internal::BreakLocationIterator::FindBreakLocationFromAddress ( Address  pc)

Definition at line 187 of file debug.cc.

187  {
188  // Run through all break points to locate the one closest to the address.
189  int closest_break_point = 0;
190  int distance = kMaxInt;
191  while (!Done()) {
192  // Check if this break point is closer that what was previously found.
193  if (this->pc() <= pc && pc - this->pc() < distance) {
194  closest_break_point = break_point();
195  distance = static_cast<int>(pc - this->pc());
196  // Check whether we can't get any closer.
197  if (distance == 0) break;
198  }
199  Next();
200  }
201 
202  // Move to the break point found.
203  Reset();
204  Next(closest_break_point);
205 }
const int kMaxInt
Definition: globals.h:109

References break_point(), Done(), v8::internal::kMaxInt, Next(), pc(), and Reset().

Referenced by v8::internal::Debug::Break(), v8::internal::Debug::ClearBreakPoint(), v8::internal::Debug::PrepareStep(), v8::internal::RUNTIME_FUNCTION(), and v8::internal::ScopeIterator::ScopeIterator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindBreakLocationFromPosition()

void v8::internal::BreakLocationIterator::FindBreakLocationFromPosition ( int  position,
BreakPositionAlignment  alignment 
)

Definition at line 209 of file debug.cc.

210  {
211  // Run through all break points to locate the one closest to the source
212  // position.
213  int closest_break_point = 0;
214  int distance = kMaxInt;
215 
216  while (!Done()) {
217  int next_position;
218  switch (alignment) {
219  case STATEMENT_ALIGNED:
220  next_position = this->statement_position();
221  break;
223  next_position = this->position();
224  break;
225  default:
226  UNREACHABLE();
227  next_position = this->statement_position();
228  }
229  // Check if this break point is closer that what was previously found.
230  if (position <= next_position && next_position - position < distance) {
231  closest_break_point = break_point();
232  distance = next_position - position;
233  // Check whether we can't get any closer.
234  if (distance == 0) break;
235  }
236  Next();
237  }
238 
239  // Move to the break point found.
240  Reset();
241  Next(closest_break_point);
242 }
#define UNREACHABLE()
Definition: logging.h:30
@ STATEMENT_ALIGNED
Definition: debug.h:61
@ BREAK_POSITION_ALIGNED
Definition: debug.h:62

References break_point(), v8::internal::BREAK_POSITION_ALIGNED, Done(), v8::internal::kMaxInt, Next(), position(), Reset(), v8::internal::STATEMENT_ALIGNED, statement_position(), and UNREACHABLE.

Referenced by v8::internal::Debug::SetBreakPoint(), and v8::internal::Debug::SetBreakPointForScript().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasBreakPoint()

bool v8::internal::BreakLocationIterator::HasBreakPoint ( )

Definition at line 421 of file debug.cc.

421  {
422  return debug_info_->HasBreakPoint(code_position());
423 }

References code_position(), and debug_info_.

Referenced by v8::internal::Debug::Break(), ClearBreakPoint(), ClearOneShot(), SetBreakPoint(), and SetOneShot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsDebugBreak()

bool v8::internal::BreakLocationIterator::IsDebugBreak ( )

Definition at line 427 of file debug.cc.

427  {
428  if (RelocInfo::IsJSReturn(rmode())) {
429  return IsDebugBreakAtReturn();
430  } else if (IsDebugBreakSlot()) {
431  return IsDebugBreakAtSlot();
432  } else {
433  return Debug::IsDebugBreak(rinfo()->target_address());
434  }
435 }
static bool IsDebugBreak(Address addr)
Definition: debug.cc:1541

References v8::internal::Debug::IsDebugBreak(), IsDebugBreakAtReturn(), IsDebugBreakAtSlot(), IsDebugBreakSlot(), v8::internal::RelocInfo::IsJSReturn(), rinfo(), and rmode().

Referenced by ClearBreakPoint(), ClearDebugBreak(), ClearOneShot(), v8::internal::Debug::PrepareStep(), PrepareStepIn(), SetBreakPoint(), SetDebugBreak(), and SetOneShot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsDebugBreakAtReturn()

bool v8::internal::BreakLocationIterator::IsDebugBreakAtReturn ( )
private

Referenced by IsDebugBreak().

+ Here is the caller graph for this function:

◆ IsDebugBreakAtSlot()

bool v8::internal::BreakLocationIterator::IsDebugBreakAtSlot ( )
private

Referenced by IsDebugBreak().

+ Here is the caller graph for this function:

◆ IsDebugBreakSlot()

bool v8::internal::BreakLocationIterator::IsDebugBreakSlot ( )
private

Definition at line 514 of file debug.cc.

514  {
516 }

References v8::internal::RelocInfo::DEBUG_BREAK_SLOT, and rmode().

Referenced by ClearDebugBreak(), IsDebugBreak(), Next(), and SetDebugBreak().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsDebuggerStatement()

bool v8::internal::BreakLocationIterator::IsDebuggerStatement ( )

Definition at line 509 of file debug.cc.

509  {
510  return RelocInfo::DEBUG_BREAK == rmode();
511 }

References v8::internal::RelocInfo::DEBUG_BREAK, and rmode().

Referenced by ClearDebugBreak(), ClearOneShot(), Next(), SetBreakPoint(), SetDebugBreak(), and SetOneShot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsExit()

bool v8::internal::BreakLocationIterator::IsExit ( ) const

Definition at line 416 of file debug.cc.

416  {
417  return (RelocInfo::IsJSReturn(rmode()));
418 }

References v8::internal::RelocInfo::IsJSReturn(), and rmode().

Referenced by v8::internal::Debug::PrepareStep(), v8::internal::ScopeIterator::ScopeIterator(), and v8::internal::Debug::StepNextContinue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsStepInLocation()

bool v8::internal::BreakLocationIterator::IsStepInLocation ( Isolate isolate)

Definition at line 365 of file debug.cc.

365  {
367  return true;
368  } else if (RelocInfo::IsCodeTarget(rmode())) {
369  HandleScope scope(debug_info_->GetIsolate());
370  Address target = original_rinfo()->target_address();
371  Handle<Code> target_code(Code::GetCodeFromTargetAddress(target));
372  if (target_code->kind() == Code::STUB) {
373  return CodeStub::GetMajorKey(*target_code) == CodeStub::CallFunction;
374  }
375  return target_code->is_call_stub();
376  }
377  return false;
378 }
RelocInfo::Mode original_rmode() const
Definition: debug.h:109
static Code * GetCodeFromTargetAddress(Address address)
Definition: objects-inl.h:5018
static bool IsCodeTarget(Mode mode)
Definition: assembler.h:399
static bool IsConstructCall(Mode mode)
Definition: assembler.h:396
byte * Address
Definition: globals.h:101

References debug_info_, v8::internal::Code::GetCodeFromTargetAddress(), v8::internal::RelocInfo::IsCodeTarget(), v8::internal::RelocInfo::IsConstructCall(), original_rinfo(), original_rmode(), rmode(), and v8::internal::STUB.

Referenced by v8::internal::RUNTIME_FUNCTION().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Next() [1/2]

void v8::internal::BreakLocationIterator::Next ( )

Definition at line 96 of file debug.cc.

96  {
98  DCHECK(!RinfoDone());
99 
100  // Iterate through reloc info for code and original code stopping at each
101  // breakable code target.
102  bool first = break_point_ == -1;
103  while (!RinfoDone()) {
104  if (!first) RinfoNext();
105  first = false;
106  if (RinfoDone()) return;
107 
108  // Whenever a statement position or (plain) position is passed update the
109  // current value of these.
110  if (RelocInfo::IsPosition(rmode())) {
112  statement_position_ = static_cast<int>(
113  rinfo()->data() - debug_info_->shared()->start_position());
114  }
115  // Always update the position as we don't want that to be before the
116  // statement position.
117  position_ = static_cast<int>(
118  rinfo()->data() - debug_info_->shared()->start_position());
119  DCHECK(position_ >= 0);
121  }
122 
123  if (IsDebugBreakSlot()) {
124  // There is always a possible break point at a debug break slot.
125  break_point_++;
126  return;
127  } else if (RelocInfo::IsCodeTarget(rmode())) {
128  // Check for breakable code target. Look in the original code as setting
129  // break points can cause the code targets in the running (debugged) code
130  // to be of a different kind than in the original code.
131  Address target = original_rinfo()->target_address();
132  Code* code = Code::GetCodeFromTargetAddress(target);
133  if ((code->is_inline_cache_stub() &&
134  !code->is_binary_op_stub() &&
135  !code->is_compare_ic_stub() &&
138  break_point_++;
139  return;
140  }
141  if (code->kind() == Code::STUB) {
142  if (IsDebuggerStatement()) {
143  break_point_++;
144  return;
145  } else if (type_ == ALL_BREAK_LOCATIONS) {
146  if (IsBreakStub(code)) {
147  break_point_++;
148  return;
149  }
150  } else {
152  if (IsSourceBreakStub(code)) {
153  break_point_++;
154  return;
155  }
156  }
157  }
158  }
159 
160  // Check for break at return.
161  if (RelocInfo::IsJSReturn(rmode())) {
162  // Set the positions to the end of the function.
163  if (debug_info_->shared()->HasSourceCode()) {
164  position_ = debug_info_->shared()->end_position() -
165  debug_info_->shared()->start_position() - 1;
166  } else {
167  position_ = 0;
168  }
170  break_point_++;
171  return;
172  }
173  }
174 }
bool is_compare_ic_stub()
Definition: objects.h:5055
bool is_inline_cache_stub()
Definition: objects-inl.h:4921
bool is_binary_op_stub()
Definition: objects.h:5054
bool is_to_boolean_ic_stub()
Definition: objects.h:5057
static bool IsPosition(Mode mode)
Definition: assembler.h:424
intptr_t data() const
Definition: assembler.h:460
static bool IsStatementPosition(Mode mode)
Definition: assembler.h:427
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
static bool IsSourceBreakStub(Code *code)
Definition: debug.cc:82
@ ALL_BREAK_LOCATIONS
Definition: debug.h:53
@ SOURCE_BREAK_LOCATIONS
Definition: debug.h:54
static bool IsBreakStub(Code *code)
Definition: debug.cc:90

References v8::internal::ALL_BREAK_LOCATIONS, break_point_, code(), v8::internal::RelocInfo::data(), DCHECK, debug_info_, v8::internal::Code::GetCodeFromTargetAddress(), v8::internal::Code::is_binary_op_stub(), v8::internal::Code::is_compare_ic_stub(), v8::internal::Code::is_inline_cache_stub(), v8::internal::Code::is_to_boolean_ic_stub(), v8::internal::IsBreakStub(), v8::internal::RelocInfo::IsCodeTarget(), v8::internal::RelocInfo::IsConstructCall(), IsDebugBreakSlot(), IsDebuggerStatement(), v8::internal::RelocInfo::IsJSReturn(), v8::internal::RelocInfo::IsPosition(), v8::internal::IsSourceBreakStub(), v8::internal::RelocInfo::IsStatementPosition(), v8::internal::Code::kind(), original_rinfo(), position_, rinfo(), RinfoDone(), RinfoNext(), rmode(), v8::internal::SOURCE_BREAK_LOCATIONS, statement_position_, v8::internal::STUB, and type_.

Referenced by ClearAllDebugBreak(), v8::internal::Debug::ClearOneShot(), FindBreakLocationFromAddress(), FindBreakLocationFromPosition(), v8::internal::Debug::FloodWithOneShot(), Next(), Reset(), and v8::internal::RUNTIME_FUNCTION().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Next() [2/2]

void v8::internal::BreakLocationIterator::Next ( int  count)

Definition at line 177 of file debug.cc.

177  {
178  while (count > 0) {
179  Next();
180  count--;
181  }
182 }

References Next().

+ Here is the call graph for this function:

◆ original_rinfo()

RelocInfo* v8::internal::BreakLocationIterator::original_rinfo ( )
inline

Definition at line 106 of file debug.h.

106  {
108  }

References reloc_iterator_original_, and v8::internal::RelocIterator::rinfo().

Referenced by ClearDebugBreakAtIC(), IsStepInLocation(), Next(), v8::internal::Debug::PrepareStep(), PrepareStepIn(), and SetDebugBreakAtIC().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ original_rmode()

RelocInfo::Mode v8::internal::BreakLocationIterator::original_rmode ( ) const
inline

Definition at line 109 of file debug.h.

109  {
110  return reloc_iterator_original_->rinfo()->rmode();
111  }
Mode rmode() const
Definition: assembler.h:459

References reloc_iterator_original_, v8::internal::RelocIterator::rinfo(), and v8::internal::RelocInfo::rmode().

Referenced by IsStepInLocation(), and RinfoNext().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pc()

Address v8::internal::BreakLocationIterator::pc ( )
inline

Definition at line 100 of file debug.h.

100 { return reloc_iterator_->rinfo()->pc(); }
byte * pc() const
Definition: assembler.h:457

References v8::internal::RelocInfo::pc(), reloc_iterator_, and v8::internal::RelocIterator::rinfo().

Referenced by code_position(), FindBreakLocationFromAddress(), and v8::internal::RUNTIME_FUNCTION().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ position()

int v8::internal::BreakLocationIterator::position ( )
inline

Definition at line 98 of file debug.h.

98 { return position_; }

References position_.

Referenced by FindBreakLocationFromPosition(), v8::internal::RUNTIME_FUNCTION(), v8::internal::Debug::SetBreakPoint(), SetBreakPoint(), and v8::internal::Debug::SetBreakPointForScript().

+ Here is the caller graph for this function:

◆ PrepareStepIn()

void v8::internal::BreakLocationIterator::PrepareStepIn ( Isolate isolate)

Definition at line 381 of file debug.cc.

381  {
382 #ifdef DEBUG
383  HandleScope scope(isolate);
384  // Step in can only be prepared if currently positioned on an IC call,
385  // construct call or CallFunction stub call.
386  Address target = rinfo()->target_address();
387  Handle<Code> target_code(Code::GetCodeFromTargetAddress(target));
388  // All the following stuff is needed only for assertion checks so the code
389  // is wrapped in ifdef.
390  Handle<Code> maybe_call_function_stub = target_code;
391  if (IsDebugBreak()) {
392  Address original_target = original_rinfo()->target_address();
393  maybe_call_function_stub =
394  Handle<Code>(Code::GetCodeFromTargetAddress(original_target));
395  }
396  bool is_call_function_stub =
397  (maybe_call_function_stub->kind() == Code::STUB &&
398  CodeStub::GetMajorKey(*maybe_call_function_stub) ==
399  CodeStub::CallFunction);
400 
401  // Step in through construct call requires no changes to the running code.
402  // Step in through getters/setters should already be prepared as well
403  // because caller of this function (Debug::PrepareStep) is expected to
404  // flood the top frame's function with one shot breakpoints.
405  // Step in through CallFunction stub should also be prepared by caller of
406  // this function (Debug::PrepareStep) which should flood target function
407  // with breakpoints.
409  target_code->is_inline_cache_stub() ||
410  is_call_function_stub);
411 #endif
412 }

References DCHECK, v8::internal::Code::GetCodeFromTargetAddress(), v8::internal::RelocInfo::IsConstructCall(), IsDebugBreak(), original_rinfo(), rinfo(), rmode(), and v8::internal::STUB.

Referenced by v8::internal::Debug::PrepareStep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Reset()

void v8::internal::BreakLocationIterator::Reset ( )

Definition at line 245 of file debug.cc.

245  {
246  // Create relocation iterators for the two code objects.
247  if (reloc_iterator_ != NULL) delete reloc_iterator_;
249  reloc_iterator_ = new RelocIterator(
250  debug_info_->code(),
252  reloc_iterator_original_ = new RelocIterator(
253  debug_info_->original_code(),
255 
256  // Position at the first break point.
257  break_point_ = -1;
258  position_ = 1;
260  Next();
261 }
static int ModeMask(Mode mode)
Definition: assembler.h:445

References break_point_, v8::internal::RelocInfo::CODE_AGE_SEQUENCE, debug_info_, v8::internal::RelocInfo::ModeMask(), Next(), NULL, position_, reloc_iterator_, reloc_iterator_original_, and statement_position_.

Referenced by BreakLocationIterator(), FindBreakLocationFromAddress(), and FindBreakLocationFromPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rinfo()

RelocInfo* v8::internal::BreakLocationIterator::rinfo ( )
inline

Definition at line 102 of file debug.h.

102 { return reloc_iterator_->rinfo(); }

References reloc_iterator_, and v8::internal::RelocIterator::rinfo().

Referenced by ClearDebugBreakAtIC(), IsDebugBreak(), Next(), v8::internal::Debug::PrepareStep(), PrepareStepIn(), and SetDebugBreakAtIC().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RinfoDone()

bool v8::internal::BreakLocationIterator::RinfoDone ( ) const
protected

Definition at line 535 of file debug.cc.

535  {
537  return reloc_iterator_->done();
538 }

References DCHECK, v8::internal::RelocIterator::done(), reloc_iterator_, and reloc_iterator_original_.

Referenced by Done(), and Next().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RinfoNext()

void v8::internal::BreakLocationIterator::RinfoNext ( )
protected

Definition at line 541 of file debug.cc.

541  {
544 #ifdef DEBUG
546  if (!reloc_iterator_->done()) {
547  DCHECK(rmode() == original_rmode());
548  }
549 #endif
550 }

References DCHECK, v8::internal::RelocIterator::done(), v8::internal::RelocIterator::next(), original_rmode(), reloc_iterator_, reloc_iterator_original_, and rmode().

Referenced by Next().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rmode()

RelocInfo::Mode v8::internal::BreakLocationIterator::rmode ( ) const
inline

Definition at line 103 of file debug.h.

103  {
104  return reloc_iterator_->rinfo()->rmode();
105  }

References reloc_iterator_, v8::internal::RelocIterator::rinfo(), and v8::internal::RelocInfo::rmode().

Referenced by ClearDebugBreak(), IsDebugBreak(), IsDebugBreakSlot(), IsDebuggerStatement(), IsExit(), IsStepInLocation(), Next(), v8::internal::Debug::PrepareStep(), PrepareStepIn(), RinfoNext(), SetDebugBreak(), and SetDebugBreakAtIC().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetBreakPoint()

void v8::internal::BreakLocationIterator::SetBreakPoint ( Handle< Object break_point_object)

Definition at line 269 of file debug.cc.

269  {
270  // If there is not already a real break point here patch code with debug
271  // break.
272  if (!HasBreakPoint()) SetDebugBreak();
274  // Set the break point information.
277  break_point_object);
278 }
static void SetBreakPoint(Handle< DebugInfo > debug_info, int code_position, int source_position, int statement_position, Handle< Object > break_point_object)
Definition: objects.cc:15903

References code_position(), DCHECK, debug_info_, HasBreakPoint(), IsDebugBreak(), IsDebuggerStatement(), position(), v8::internal::DebugInfo::SetBreakPoint(), SetDebugBreak(), and statement_position().

Referenced by v8::internal::Debug::SetBreakPoint(), and v8::internal::Debug::SetBreakPointForScript().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDebugBreak()

void v8::internal::BreakLocationIterator::SetDebugBreak ( )
private

Definition at line 323 of file debug.cc.

323  {
324  // Debugger statement always calls debugger. No need to modify it.
325  if (IsDebuggerStatement()) return;
326 
327  // If there is already a break point here just return. This might happen if
328  // the same code is flooded with break points twice. Flooding the same
329  // function twice might happen when stepping in a function with an exception
330  // handler as the handler and the function is the same.
331  if (IsDebugBreak()) return;
332 
333  if (RelocInfo::IsJSReturn(rmode())) {
334  // Patch the frame exit code with a break point.
336  } else if (IsDebugBreakSlot()) {
337  // Patch the code in the break slot.
339  } else {
340  // Patch the IC call.
342  }
343  DCHECK(IsDebugBreak());
344 }

References DCHECK, IsDebugBreak(), IsDebugBreakSlot(), IsDebuggerStatement(), v8::internal::RelocInfo::IsJSReturn(), rmode(), SetDebugBreakAtIC(), SetDebugBreakAtReturn(), and SetDebugBreakAtSlot().

Referenced by SetBreakPoint(), and SetOneShot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDebugBreakAtIC()

void v8::internal::BreakLocationIterator::SetDebugBreakAtIC ( )
private

Definition at line 485 of file debug.cc.

485  {
486  // Patch the original code with the current address as the current address
487  // might have changed by the inline caching since the code was copied.
488  original_rinfo()->set_target_address(rinfo()->target_address());
489 
492  Address target = rinfo()->target_address();
493  Handle<Code> target_code(Code::GetCodeFromTargetAddress(target));
494 
495  // Patch the code to invoke the builtin debug break function matching the
496  // calling convention used by the call site.
497  Handle<Code> dbgbrk_code = DebugBreakForIC(target_code, mode);
498  rinfo()->set_target_address(dbgbrk_code->entry());
499  }
500 }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
static Handle< Code > DebugBreakForIC(Handle< Code > code, RelocInfo::Mode mode)
Definition: debug.cc:439

References v8::internal::DebugBreakForIC(), v8::internal::Code::GetCodeFromTargetAddress(), v8::internal::RelocInfo::IsCodeTarget(), mode(), original_rinfo(), rinfo(), and rmode().

Referenced by SetDebugBreak().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDebugBreakAtReturn()

void v8::internal::BreakLocationIterator::SetDebugBreakAtReturn ( )
private

Referenced by SetDebugBreak().

+ Here is the caller graph for this function:

◆ SetDebugBreakAtSlot()

void v8::internal::BreakLocationIterator::SetDebugBreakAtSlot ( )
private

Referenced by SetDebugBreak().

+ Here is the caller graph for this function:

◆ SetOneShot()

void v8::internal::BreakLocationIterator::SetOneShot ( )

Definition at line 292 of file debug.cc.

292  {
293  // Debugger statement always calls debugger. No need to modify it.
294  if (IsDebuggerStatement()) return;
295 
296  // If there is a real break point here no more to do.
297  if (HasBreakPoint()) {
298  DCHECK(IsDebugBreak());
299  return;
300  }
301 
302  // Patch code with debug break.
303  SetDebugBreak();
304 }

References DCHECK, HasBreakPoint(), IsDebugBreak(), IsDebuggerStatement(), and SetDebugBreak().

Referenced by v8::internal::Debug::FloodWithOneShot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ statement_position()

int v8::internal::BreakLocationIterator::statement_position ( )
inline

Definition at line 99 of file debug.h.

99 { return statement_position_; }

References statement_position_.

Referenced by FindBreakLocationFromPosition(), v8::internal::RUNTIME_FUNCTION(), and SetBreakPoint().

+ Here is the caller graph for this function:

Member Data Documentation

◆ break_point_

int v8::internal::BreakLocationIterator::break_point_
protected

Definition at line 120 of file debug.h.

Referenced by break_point(), Next(), and Reset().

◆ debug_info_

Handle<DebugInfo> v8::internal::BreakLocationIterator::debug_info_
protected

◆ position_

int v8::internal::BreakLocationIterator::position_
protected

Definition at line 121 of file debug.h.

Referenced by Next(), position(), and Reset().

◆ reloc_iterator_

RelocIterator* v8::internal::BreakLocationIterator::reloc_iterator_
protected

◆ reloc_iterator_original_

RelocIterator* v8::internal::BreakLocationIterator::reloc_iterator_original_
protected

◆ statement_position_

int v8::internal::BreakLocationIterator::statement_position_
protected

Definition at line 122 of file debug.h.

Referenced by Next(), Reset(), and statement_position().

◆ type_

BreakLocatorType v8::internal::BreakLocationIterator::type_
protected

Definition at line 119 of file debug.h.

Referenced by BreakLocationIterator(), and Next().


The documentation for this class was generated from the following files: