V8 Project
v8::internal::IndexedReferencesExtractor Class Reference
+ Inheritance diagram for v8::internal::IndexedReferencesExtractor:
+ Collaboration diagram for v8::internal::IndexedReferencesExtractor:

Public Member Functions

 IndexedReferencesExtractor (V8HeapExplorer *generator, HeapObject *parent_obj, int parent)
 
void VisitCodeEntry (Address entry_address)
 
void VisitPointers (Object **start, Object **end)
 

Static Public Member Functions

static void MarkVisitedField (HeapObject *obj, int offset)
 

Private Member Functions

bool CheckVisitedAndUnmark (Object **field)
 

Static Private Member Functions

static bool IsMarked (intptr_t p)
 

Private Attributes

V8HeapExplorergenerator_
 
HeapObjectparent_obj_
 
int parent_
 
int next_index_
 

Static Private Attributes

static const intptr_t kTaggingMask = 3
 
static const intptr_t kTag = 3
 

Detailed Description

Definition at line 986 of file heap-snapshot-generator.cc.

Constructor & Destructor Documentation

◆ IndexedReferencesExtractor()

v8::internal::IndexedReferencesExtractor::IndexedReferencesExtractor ( V8HeapExplorer generator,
HeapObject parent_obj,
int  parent 
)
inline

Member Function Documentation

◆ CheckVisitedAndUnmark()

bool v8::internal::IndexedReferencesExtractor::CheckVisitedAndUnmark ( Object **  field)
inlineprivate

Definition at line 1019 of file heap-snapshot-generator.cc.

1019  {
1020  intptr_t p = reinterpret_cast<intptr_t>(*field);
1021  if (IsMarked(p)) {
1022  intptr_t p_untagged = (p & ~kTaggingMask) | kHeapObjectTag;
1023  *field = reinterpret_cast<Object*>(p_untagged);
1024  DCHECK((*field)->IsHeapObject());
1025  return true;
1026  }
1027  return false;
1028  }
#define DCHECK(condition)
Definition: logging.h:205
kSerializedDataOffset Object
Definition: objects-inl.h:5322
const int kHeapObjectTag
Definition: v8.h:5737

References DCHECK, IsMarked(), v8::internal::kHeapObjectTag, and kTaggingMask.

Referenced by VisitPointers().

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

◆ IsMarked()

static bool v8::internal::IndexedReferencesExtractor::IsMarked ( intptr_t  p)
inlinestaticprivate

Definition at line 1033 of file heap-snapshot-generator.cc.

1033 { return (p & kTaggingMask) == kTag; }

References kTag, and kTaggingMask.

Referenced by CheckVisitedAndUnmark(), and MarkVisitedField().

+ Here is the caller graph for this function:

◆ MarkVisitedField()

static void v8::internal::IndexedReferencesExtractor::MarkVisitedField ( HeapObject obj,
int  offset 
)
inlinestatic

Definition at line 1008 of file heap-snapshot-generator.cc.

1008  {
1009  if (offset < 0) return;
1010  Address field = obj->address() + offset;
1011  DCHECK(Memory::Object_at(field)->IsHeapObject());
1012  intptr_t p = reinterpret_cast<intptr_t>(Memory::Object_at(field));
1013  DCHECK(!IsMarked(p));
1014  intptr_t p_tagged = p | kTag;
1015  Memory::Object_at(field) = reinterpret_cast<Object*>(p_tagged);
1016  }
static Object *& Object_at(Address addr)
Definition: v8memory.h:60
byte * Address
Definition: globals.h:101

References v8::internal::HeapObject::address(), DCHECK, IsMarked(), kTag, and v8::internal::Memory::Object_at().

Referenced by v8::internal::V8HeapExplorer::SetContextReference(), v8::internal::V8HeapExplorer::SetInternalReference(), v8::internal::V8HeapExplorer::SetPropertyReference(), and v8::internal::V8HeapExplorer::SetWeakReference().

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

◆ VisitCodeEntry()

void v8::internal::IndexedReferencesExtractor::VisitCodeEntry ( Address  entry_address)
inline

Definition at line 996 of file heap-snapshot-generator.cc.

996  {
997  Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address));
999  generator_->TagCodeObject(code);
1000  }
static Object * GetObjectFromEntryAddress(Address location_of_address)
Definition: objects-inl.h:5029
void SetInternalReference(HeapObject *parent_obj, int parent, const char *reference_name, Object *child, int field_offset=-1)

References generator_, v8::internal::Code::GetObjectFromEntryAddress(), parent_, parent_obj_, v8::internal::V8HeapExplorer::SetInternalReference(), and v8::internal::V8HeapExplorer::TagCodeObject().

+ Here is the call graph for this function:

◆ VisitPointers()

void v8::internal::IndexedReferencesExtractor::VisitPointers ( Object **  start,
Object **  end 
)
inline

Definition at line 1001 of file heap-snapshot-generator.cc.

1001  {
1002  for (Object** p = start; p < end; p++) {
1003  ++next_index_;
1004  if (CheckVisitedAndUnmark(p)) continue;
1006  }
1007  }
void SetHiddenReference(HeapObject *parent_obj, int parent, int index, Object *child)

References CheckVisitedAndUnmark(), generator_, next_index_, parent_, parent_obj_, and v8::internal::V8HeapExplorer::SetHiddenReference().

+ Here is the call graph for this function:

Member Data Documentation

◆ generator_

V8HeapExplorer* v8::internal::IndexedReferencesExtractor::generator_
private

Definition at line 1035 of file heap-snapshot-generator.cc.

Referenced by VisitCodeEntry(), and VisitPointers().

◆ kTag

const intptr_t v8::internal::IndexedReferencesExtractor::kTag = 3
staticprivate

Definition at line 1031 of file heap-snapshot-generator.cc.

Referenced by IsMarked(), and MarkVisitedField().

◆ kTaggingMask

const intptr_t v8::internal::IndexedReferencesExtractor::kTaggingMask = 3
staticprivate

Definition at line 1030 of file heap-snapshot-generator.cc.

Referenced by CheckVisitedAndUnmark(), and IsMarked().

◆ next_index_

int v8::internal::IndexedReferencesExtractor::next_index_
private

Definition at line 1038 of file heap-snapshot-generator.cc.

Referenced by VisitPointers().

◆ parent_

int v8::internal::IndexedReferencesExtractor::parent_
private

Definition at line 1037 of file heap-snapshot-generator.cc.

Referenced by VisitCodeEntry(), and VisitPointers().

◆ parent_obj_

HeapObject* v8::internal::IndexedReferencesExtractor::parent_obj_
private

Definition at line 1036 of file heap-snapshot-generator.cc.

Referenced by VisitCodeEntry(), and VisitPointers().


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