V8 Project
v8::internal::HeapObjectsSet Class Reference

#include <heap-snapshot-generator.h>

+ Collaboration diagram for v8::internal::HeapObjectsSet:

Public Member Functions

 HeapObjectsSet ()
 
void Clear ()
 
bool Contains (Object *object)
 
void Insert (Object *obj)
 
const char * GetTag (Object *obj)
 
void SetTag (Object *obj, const char *tag)
 
bool is_empty () const
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (HeapObjectsSet)
 

Private Attributes

HashMap entries_
 

Detailed Description

Definition at line 302 of file heap-snapshot-generator.h.

Constructor & Destructor Documentation

◆ HeapObjectsSet()

v8::internal::HeapObjectsSet::HeapObjectsSet ( )

Member Function Documentation

◆ Clear()

void v8::internal::HeapObjectsSet::Clear ( )

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

743  {
744  entries_.Clear();
745 }

References v8::internal::TemplateHashMapImpl< AllocationPolicy >::Clear(), and entries_.

+ Here is the call graph for this function:

◆ Contains()

bool v8::internal::HeapObjectsSet::Contains ( Object object)

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

748  {
749  if (!obj->IsHeapObject()) return false;
750  HeapObject* object = HeapObject::cast(obj);
751  return entries_.Lookup(object, HeapEntriesMap::Hash(object), false) != NULL;
752 }
static uint32_t Hash(HeapThing thing)
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
Definition: hashmap.h:114
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 entries_, v8::internal::HeapEntriesMap::Hash(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup(), and NULL.

Referenced by v8::internal::V8HeapExplorer::ExtractFixedArrayReferences(), v8::internal::V8HeapExplorer::SetGcSubrootReference(), and v8::internal::NativeObjectsExplorer::VisitSubtreeWrapper().

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

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::HeapObjectsSet::DISALLOW_COPY_AND_ASSIGN ( HeapObjectsSet  )
private

◆ GetTag()

const char * v8::internal::HeapObjectsSet::GetTag ( Object obj)

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

762  {
763  HeapObject* object = HeapObject::cast(obj);
764  HashMap::Entry* cache_entry =
765  entries_.Lookup(object, HeapEntriesMap::Hash(object), false);
766  return cache_entry != NULL
767  ? reinterpret_cast<const char*>(cache_entry->value)
768  : NULL;
769 }

References entries_, v8::internal::HeapEntriesMap::Hash(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup(), and NULL.

Referenced by v8::internal::V8HeapExplorer::AddEntry(), and v8::internal::V8HeapExplorer::GetStrongGcSubrootName().

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

◆ Insert()

void v8::internal::HeapObjectsSet::Insert ( Object obj)

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

755  {
756  if (!obj->IsHeapObject()) return;
757  HeapObject* object = HeapObject::cast(obj);
758  entries_.Lookup(object, HeapEntriesMap::Hash(object), true);
759 }

References entries_, v8::internal::HeapEntriesMap::Hash(), and v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup().

Referenced by v8::internal::NativeObjectsExplorer::FillRetainedObjects(), v8::internal::V8HeapExplorer::MarkAsWeakContainer(), and v8::internal::V8HeapExplorer::SetGcSubrootReference().

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

◆ is_empty()

bool v8::internal::HeapObjectsSet::is_empty ( ) const
inline

Definition at line 310 of file heap-snapshot-generator.h.

310 { return entries_.occupancy() == 0; }
uint32_t occupancy() const
Definition: hashmap.h:61

References entries_, and v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy().

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

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

◆ SetTag()

void v8::internal::HeapObjectsSet::SetTag ( Object obj,
const char *  tag 
)

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

772  {
773  if (!obj->IsHeapObject()) return;
774  HeapObject* object = HeapObject::cast(obj);
775  HashMap::Entry* cache_entry =
776  entries_.Lookup(object, HeapEntriesMap::Hash(object), true);
777  cache_entry->value = const_cast<char*>(tag);
778 }

References entries_, v8::internal::HeapEntriesMap::Hash(), and v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup().

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

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

Member Data Documentation

◆ entries_

HashMap v8::internal::HeapObjectsSet::entries_
private

Definition at line 313 of file heap-snapshot-generator.h.

Referenced by Clear(), Contains(), GetTag(), Insert(), is_empty(), and SetTag().


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