V8 Project
v8::internal::DebugInfo Class Reference

#include <objects.h>

+ Inheritance diagram for v8::internal::DebugInfo:
+ Collaboration diagram for v8::internal::DebugInfo:

Public Member Functions

bool HasBreakPoint (int code_position)
 
ObjectGetBreakPointInfo (int code_position)
 
ObjectGetBreakPointObjects (int code_position)
 
int GetBreakPointCount ()
 
- Public Member Functions inherited from v8::internal::Struct
void InitializeBody (int object_size)
 
- Public Member Functions inherited from v8::internal::HeapObject
Mapmap () const
 
void set_map (Map *value)
 
void set_map_no_write_barrier (Map *value)
 
Mapsynchronized_map ()
 
MapWord synchronized_map_word () const
 
void synchronized_set_map (Map *value)
 
void synchronized_set_map_no_write_barrier (Map *value)
 
void synchronized_set_map_word (MapWord map_word)
 
MapWord map_word () const
 
void set_map_word (MapWord map_word)
 
HeapGetHeap () const
 
IsolateGetIsolate () const
 
Address address ()
 
void Iterate (ObjectVisitor *v)
 
void IterateBody (InstanceType type, int object_size, ObjectVisitor *v)
 
int Size ()
 
bool MayContainRawValues ()
 
int SizeFromMap (Map *map)
 
WriteBarrierMode GetWriteBarrierMode (const DisallowHeapAllocation &promise)
 
void HeapObjectShortPrint (OStream &os)
 
 STATIC_ASSERT (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from v8::internal::Object
bool IsObject () const
 
 INLINE (bool IsFixedArrayBase() const)
 
 INLINE (bool IsExternal() const)
 
 INLINE (bool IsAccessorInfo() const)
 
 INLINE (bool IsStruct() const)
 
 INLINE (bool IsSpecObject()) const
 
 INLINE (bool IsSpecFunction()) const
 
 INLINE (bool IsTemplateInfo()) const
 
 INLINE (bool IsNameDictionary() const)
 
 INLINE (bool IsSeededNumberDictionary() const)
 
 INLINE (bool IsUnseededNumberDictionary() const)
 
 INLINE (bool IsOrderedHashSet() const)
 
 INLINE (bool IsOrderedHashMap() const)
 
bool IsCallable () const
 
 INLINE (bool IsUndefined() const)
 
 INLINE (bool IsNull() const)
 
 INLINE (bool IsTheHole() const)
 
 INLINE (bool IsException() const)
 
 INLINE (bool IsUninitialized() const)
 
 INLINE (bool IsTrue() const)
 
 INLINE (bool IsFalse() const)
 
 INLINE (bool IsArgumentsMarker() const)
 
 INLINE (bool IsFiller() const)
 
double Number ()
 
 INLINE (bool IsNaN() const)
 
 INLINE (bool IsMinusZero() const)
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation ()
 
bool FitsRepresentation (Representation representation)
 
Handle< HeapTypeOptimalType (Isolate *isolate, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
bool BooleanValue ()
 
ObjectGetHash ()
 
bool SameValue (Object *other)
 
bool SameValueZero (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint (FILE *out=stdout)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static void ClearBreakPoint (Handle< DebugInfo > debug_info, int code_position, Handle< Object > break_point_object)
 
static void SetBreakPoint (Handle< DebugInfo > debug_info, int code_position, int source_position, int statement_position, Handle< Object > break_point_object)
 
static ObjectFindBreakPointInfo (Handle< DebugInfo > debug_info, Handle< Object > break_point_object)
 
- Static Public Member Functions inherited from v8::internal::HeapObject
static HeapObjectFromAddress (Address address)
 
static Object ** RawField (HeapObject *obj, int offset)
 
static void UpdateMapCodeCache (Handle< HeapObject > object, Handle< Name > name, Handle< Code > code)
 
- Static Public Member Functions inherited from v8::internal::Object
static Handle< ObjectNewStorageFor (Isolate *isolate, Handle< Object > object, Representation representation)
 
static Handle< ObjectWrapForRead (Isolate *isolate, Handle< Object > object, Representation representation)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object, Handle< Context > context)
 
static MUST_USE_RESULT MaybeHandle< SmiToSmi (Isolate *isolate, Handle< Object > object)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (LookupIterator *it)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode, StorePropertyMode data_store_mode=NORMAL_PROPERTY)
 
static MUST_USE_RESULT MaybeHandle< ObjectWriteToReadOnlyProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode)
 
static Handle< ObjectSetDataProperty (LookupIterator *it, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectAddDataProperty (LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyOrElement (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Isolate *isolate, Handle< Object > object, const char *key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithDefinedGetter (Handle< Object > receiver, Handle< JSReceiver > getter)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithDefinedSetter (Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< SmiGetOrCreateHash (Isolate *isolate, Handle< Object > object)
 

Static Public Attributes

static const int kSharedFunctionInfoIndex = Struct::kHeaderSize
 
static const int kOriginalCodeIndex = kSharedFunctionInfoIndex + kPointerSize
 
static const int kPatchedCodeIndex = kOriginalCodeIndex + kPointerSize
 
static const int kActiveBreakPointsCountIndex
 
static const int kBreakPointsStateIndex
 
static const int kSize = kBreakPointsStateIndex + kPointerSize
 
static const int kEstimatedNofBreakPointsInFunction = 16
 
- Static Public Attributes inherited from v8::internal::HeapObject
static const int kMapOffset = Object::kHeaderSize
 
static const int kHeaderSize = kMapOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::Object
static const int kHeaderSize = 0
 

Private Member Functions

int GetBreakPointInfoIndex (int code_position)
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (DebugInfo)
 

Static Private Attributes

static const int kNoBreakPointInfo = -1
 

Additional Inherited Members

- Public Types inherited from v8::internal::Object
enum  StoreFromKeyed { MAY_BE_STORE_FROM_KEYED , CERTAINLY_NOT_STORE_FROM_KEYED }
 
enum  StorePropertyMode { NORMAL_PROPERTY , SUPER_PROPERTY }
 
- Protected Member Functions inherited from v8::internal::HeapObject
void IteratePointers (ObjectVisitor *v, int start, int end)
 
void IteratePointer (ObjectVisitor *v, int offset)
 
void IterateNextCodeLink (ObjectVisitor *v, int offset)
 

Detailed Description

Definition at line 10574 of file objects.h.

Member Function Documentation

◆ ClearBreakPoint()

void v8::internal::DebugInfo::ClearBreakPoint ( Handle< DebugInfo debug_info,
int  code_position,
Handle< Object break_point_object 
)
static

Definition at line 15891 of file objects.cc.

15893  {
15894  Handle<Object> break_point_info(debug_info->GetBreakPointInfo(code_position),
15895  debug_info->GetIsolate());
15896  if (break_point_info->IsUndefined()) return;
15898  Handle<BreakPointInfo>::cast(break_point_info),
15899  break_point_object);
15900 }
static void ClearBreakPoint(Handle< BreakPointInfo > info, Handle< Object > break_point_object)
Definition: objects.cc:16020
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116

References v8::internal::BreakPointInfo::ClearBreakPoint().

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

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::DebugInfo::DISALLOW_IMPLICIT_CONSTRUCTORS ( DebugInfo  )
private

◆ FindBreakPointInfo()

Object * v8::internal::DebugInfo::FindBreakPointInfo ( Handle< DebugInfo debug_info,
Handle< Object break_point_object 
)
static

Definition at line 15983 of file objects.cc.

15984  {
15985  Heap* heap = debug_info->GetHeap();
15986  if (debug_info->break_points()->IsUndefined()) return heap->undefined_value();
15987  for (int i = 0; i < debug_info->break_points()->length(); i++) {
15988  if (!debug_info->break_points()->get(i)->IsUndefined()) {
15989  Handle<BreakPointInfo> break_point_info =
15990  Handle<BreakPointInfo>(BreakPointInfo::cast(
15991  debug_info->break_points()->get(i)));
15992  if (BreakPointInfo::HasBreakPointObject(break_point_info,
15993  break_point_object)) {
15994  return *break_point_info;
15995  }
15996  }
15997  }
15998  return heap->undefined_value();
15999 }
static bool HasBreakPointObject(Handle< BreakPointInfo > info, Handle< Object > break_point_object)
Definition: objects.cc:16091

References v8::internal::BreakPointInfo::HasBreakPointObject().

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

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

◆ GetBreakPointCount()

int v8::internal::DebugInfo::GetBreakPointCount ( )

Definition at line 15969 of file objects.cc.

15969  {
15970  if (break_points()->IsUndefined()) return 0;
15971  int count = 0;
15972  for (int i = 0; i < break_points()->length(); i++) {
15973  if (!break_points()->get(i)->IsUndefined()) {
15974  BreakPointInfo* break_point_info =
15975  BreakPointInfo::cast(break_points()->get(i));
15976  count += break_point_info->GetBreakPointCount();
15977  }
15978  }
15979  return count;
15980 }

References v8::internal::BreakPointInfo::GetBreakPointCount().

+ Here is the call graph for this function:

◆ GetBreakPointInfo()

Object * v8::internal::DebugInfo::GetBreakPointInfo ( int  code_position)

Definition at line 15880 of file objects.cc.

15880  {
15881  // Find the index of the break point info object for this code position.
15882  int index = GetBreakPointInfoIndex(code_position);
15883 
15884  // Return the break point info object if any.
15885  if (index == kNoBreakPointInfo) return GetHeap()->undefined_value();
15886  return BreakPointInfo::cast(break_points()->get(index));
15887 }
static const int kNoBreakPointInfo
Definition: objects.h:10624
int GetBreakPointInfoIndex(int code_position)
Definition: objects.cc:16004
Heap * GetHeap() const
Definition: objects-inl.h:1379

References GetBreakPointInfoIndex(), v8::internal::HeapObject::GetHeap(), and kNoBreakPointInfo.

Referenced by GetBreakPointObjects(), and HasBreakPoint().

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

◆ GetBreakPointInfoIndex()

int v8::internal::DebugInfo::GetBreakPointInfoIndex ( int  code_position)
private

Definition at line 16004 of file objects.cc.

16004  {
16005  if (break_points()->IsUndefined()) return kNoBreakPointInfo;
16006  for (int i = 0; i < break_points()->length(); i++) {
16007  if (!break_points()->get(i)->IsUndefined()) {
16008  BreakPointInfo* break_point_info =
16009  BreakPointInfo::cast(break_points()->get(i));
16010  if (break_point_info->code_position()->value() == code_position) {
16011  return i;
16012  }
16013  }
16014  }
16015  return kNoBreakPointInfo;
16016 }

References kNoBreakPointInfo.

Referenced by GetBreakPointInfo().

+ Here is the caller graph for this function:

◆ GetBreakPointObjects()

Object * v8::internal::DebugInfo::GetBreakPointObjects ( int  code_position)

Definition at line 15959 of file objects.cc.

15959  {
15960  Object* break_point_info = GetBreakPointInfo(code_position);
15961  if (break_point_info->IsUndefined()) {
15962  return GetHeap()->undefined_value();
15963  }
15964  return BreakPointInfo::cast(break_point_info)->break_point_objects();
15965 }
Object * GetBreakPointInfo(int code_position)
Definition: objects.cc:15880
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References GetBreakPointInfo(), and v8::internal::HeapObject::GetHeap().

+ Here is the call graph for this function:

◆ HasBreakPoint()

bool v8::internal::DebugInfo::HasBreakPoint ( int  code_position)

Definition at line 15868 of file objects.cc.

15868  {
15869  // Get the break point info object for this code position.
15870  Object* break_point_info = GetBreakPointInfo(code_position);
15871 
15872  // If there is no break point info object or no break points in the break
15873  // point info object there is no break point at this code position.
15874  if (break_point_info->IsUndefined()) return false;
15875  return BreakPointInfo::cast(break_point_info)->GetBreakPointCount() > 0;
15876 }

References GetBreakPointInfo().

+ Here is the call graph for this function:

◆ SetBreakPoint()

void v8::internal::DebugInfo::SetBreakPoint ( Handle< DebugInfo debug_info,
int  code_position,
int  source_position,
int  statement_position,
Handle< Object break_point_object 
)
static

Definition at line 15903 of file objects.cc.

15907  {
15908  Isolate* isolate = debug_info->GetIsolate();
15909  Handle<Object> break_point_info(debug_info->GetBreakPointInfo(code_position),
15910  isolate);
15911  if (!break_point_info->IsUndefined()) {
15913  Handle<BreakPointInfo>::cast(break_point_info),
15914  break_point_object);
15915  return;
15916  }
15917 
15918  // Adding a new break point for a code position which did not have any
15919  // break points before. Try to find a free slot.
15920  int index = kNoBreakPointInfo;
15921  for (int i = 0; i < debug_info->break_points()->length(); i++) {
15922  if (debug_info->break_points()->get(i)->IsUndefined()) {
15923  index = i;
15924  break;
15925  }
15926  }
15927  if (index == kNoBreakPointInfo) {
15928  // No free slot - extend break point info array.
15929  Handle<FixedArray> old_break_points =
15930  Handle<FixedArray>(FixedArray::cast(debug_info->break_points()));
15931  Handle<FixedArray> new_break_points =
15932  isolate->factory()->NewFixedArray(
15933  old_break_points->length() +
15935 
15936  debug_info->set_break_points(*new_break_points);
15937  for (int i = 0; i < old_break_points->length(); i++) {
15938  new_break_points->set(i, old_break_points->get(i));
15939  }
15940  index = old_break_points->length();
15941  }
15942  DCHECK(index != kNoBreakPointInfo);
15943 
15944  // Allocate new BreakPointInfo object and set the break point.
15945  Handle<BreakPointInfo> new_break_point_info = Handle<BreakPointInfo>::cast(
15946  isolate->factory()->NewStruct(BREAK_POINT_INFO_TYPE));
15947  new_break_point_info->set_code_position(Smi::FromInt(code_position));
15948  new_break_point_info->set_source_position(Smi::FromInt(source_position));
15949  new_break_point_info->
15950  set_statement_position(Smi::FromInt(statement_position));
15951  new_break_point_info->set_break_point_objects(
15952  isolate->heap()->undefined_value());
15953  BreakPointInfo::SetBreakPoint(new_break_point_info, break_point_object);
15954  debug_info->break_points()->set(index, *new_break_point_info);
15955 }
static void SetBreakPoint(Handle< BreakPointInfo > info, Handle< Object > break_point_object)
Definition: objects.cc:16055
static const int kEstimatedNofBreakPointsInFunction
Definition: objects.h:10621
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
#define DCHECK(condition)
Definition: logging.h:205
@ BREAK_POINT_INFO_TYPE
Definition: objects.h:716

References v8::internal::BREAK_POINT_INFO_TYPE, v8::internal::Handle< T >::cast(), DCHECK, v8::internal::Isolate::factory(), v8::internal::Smi::FromInt(), v8::internal::Isolate::heap(), kEstimatedNofBreakPointsInFunction, kNoBreakPointInfo, and v8::internal::BreakPointInfo::SetBreakPoint().

Referenced by v8::internal::BreakLocationIterator::SetBreakPoint().

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

Member Data Documentation

◆ kActiveBreakPointsCountIndex

const int v8::internal::DebugInfo::kActiveBreakPointsCountIndex
static
Initial value:
=
static const int kPatchedCodeIndex
Definition: objects.h:10614
const int kPointerSize
Definition: globals.h:129

Definition at line 10615 of file objects.h.

◆ kBreakPointsStateIndex

const int v8::internal::DebugInfo::kBreakPointsStateIndex
static
Initial value:

Definition at line 10617 of file objects.h.

◆ kEstimatedNofBreakPointsInFunction

const int v8::internal::DebugInfo::kEstimatedNofBreakPointsInFunction = 16
static

Definition at line 10621 of file objects.h.

Referenced by SetBreakPoint().

◆ kNoBreakPointInfo

const int v8::internal::DebugInfo::kNoBreakPointInfo = -1
staticprivate

Definition at line 10624 of file objects.h.

Referenced by GetBreakPointInfo(), GetBreakPointInfoIndex(), and SetBreakPoint().

◆ kOriginalCodeIndex

const int v8::internal::DebugInfo::kOriginalCodeIndex = kSharedFunctionInfoIndex + kPointerSize
static

Definition at line 10613 of file objects.h.

◆ kPatchedCodeIndex

const int v8::internal::DebugInfo::kPatchedCodeIndex = kOriginalCodeIndex + kPointerSize
static

Definition at line 10614 of file objects.h.

◆ kSharedFunctionInfoIndex

const int v8::internal::DebugInfo::kSharedFunctionInfoIndex = Struct::kHeaderSize
static

Definition at line 10612 of file objects.h.

◆ kSize

const int v8::internal::DebugInfo::kSize = kBreakPointsStateIndex + kPointerSize
static

Definition at line 10619 of file objects.h.


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