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

Classes

struct  IndexTag
 

Public Member Functions

 RootsReferencesExtractor (Heap *heap)
 
void VisitPointers (Object **start, Object **end)
 
void SetCollectingAllReferences ()
 
void FillReferences (V8HeapExplorer *explorer)
 
void Synchronize (VisitorSynchronization::SyncTag tag)
 

Private Attributes

bool collecting_all_references_
 
List< Object * > strong_references_
 
List< Object * > all_references_
 
int previous_reference_count_
 
List< IndexTagreference_tags_
 
Heapheap_
 

Detailed Description

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

Constructor & Destructor Documentation

◆ RootsReferencesExtractor()

v8::internal::RootsReferencesExtractor::RootsReferencesExtractor ( Heap heap)
inlineexplicit

Member Function Documentation

◆ FillReferences()

void v8::internal::RootsReferencesExtractor::FillReferences ( V8HeapExplorer explorer)
inline

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

1804  {
1805  DCHECK(strong_references_.length() <= all_references_.length());
1806  Builtins* builtins = heap_->isolate()->builtins();
1807  int strong_index = 0, all_index = 0, tags_index = 0, builtin_index = 0;
1808  while (all_index < all_references_.length()) {
1809  bool is_strong = strong_index < strong_references_.length()
1810  && strong_references_[strong_index] == all_references_[all_index];
1811  explorer->SetGcSubrootReference(reference_tags_[tags_index].tag,
1812  !is_strong,
1813  all_references_[all_index]);
1814  if (reference_tags_[tags_index].tag ==
1815  VisitorSynchronization::kBuiltins) {
1816  DCHECK(all_references_[all_index]->IsCode());
1817  explorer->TagBuiltinCodeObject(
1818  Code::cast(all_references_[all_index]),
1819  builtins->name(builtin_index++));
1820  }
1821  ++all_index;
1822  if (is_strong) ++strong_index;
1823  if (reference_tags_[tags_index].index == all_index) ++tags_index;
1824  }
1825  }
Isolate * isolate()
Definition: heap-inl.h:589
Builtins * builtins()
Definition: isolate.h:947
#define DCHECK(condition)
Definition: logging.h:205

References all_references_, v8::internal::Isolate::builtins(), DCHECK, heap_, v8::internal::Heap::isolate(), v8::internal::Builtins::name(), reference_tags_, v8::internal::V8HeapExplorer::SetGcSubrootReference(), strong_references_, and v8::internal::V8HeapExplorer::TagBuiltinCodeObject().

Referenced by v8::internal::V8HeapExplorer::IterateAndExtractReferences().

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

◆ SetCollectingAllReferences()

void v8::internal::RootsReferencesExtractor::SetCollectingAllReferences ( )
inline

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

1802 { collecting_all_references_ = true; }

References collecting_all_references_.

Referenced by v8::internal::V8HeapExplorer::IterateAndExtractReferences().

+ Here is the caller graph for this function:

◆ Synchronize()

void v8::internal::RootsReferencesExtractor::Synchronize ( VisitorSynchronization::SyncTag  tag)
inline

◆ VisitPointers()

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

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

1794  {
1796  for (Object** p = start; p < end; p++) all_references_.Add(*p);
1797  } else {
1798  for (Object** p = start; p < end; p++) strong_references_.Add(*p);
1799  }
1800  }
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References all_references_, collecting_all_references_, and strong_references_.

Member Data Documentation

◆ all_references_

List<Object*> v8::internal::RootsReferencesExtractor::all_references_
private

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

Referenced by FillReferences(), Synchronize(), and VisitPointers().

◆ collecting_all_references_

bool v8::internal::RootsReferencesExtractor::collecting_all_references_
private

◆ heap_

Heap* v8::internal::RootsReferencesExtractor::heap_
private

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

Referenced by FillReferences().

◆ previous_reference_count_

int v8::internal::RootsReferencesExtractor::previous_reference_count_
private

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

Referenced by Synchronize().

◆ reference_tags_

List<IndexTag> v8::internal::RootsReferencesExtractor::reference_tags_
private

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

Referenced by FillReferences(), and Synchronize().

◆ strong_references_

List<Object*> v8::internal::RootsReferencesExtractor::strong_references_
private

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

Referenced by FillReferences(), and VisitPointers().


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