V8 Project
v8::internal::MarkingDeque Class Reference

#include <mark-compact.h>

+ Collaboration diagram for v8::internal::MarkingDeque:

Public Member Functions

 MarkingDeque ()
 
void Initialize (Address low, Address high)
 
bool IsFull ()
 
bool IsEmpty ()
 
bool overflowed () const
 
void ClearOverflowed ()
 
void SetOverflowed ()
 
 INLINE (void PushBlack(HeapObject *object))
 
 INLINE (void PushGrey(HeapObject *object))
 
 INLINE (HeapObject *Pop())
 
 INLINE (void UnshiftGrey(HeapObject *object))
 
HeapObject ** array ()
 
int bottom ()
 
int top ()
 
int mask ()
 
void set_top (int top)
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (MarkingDeque)
 

Private Attributes

HeapObject ** array_
 
int top_
 
int bottom_
 
int mask_
 
bool overflowed_
 

Detailed Description

Definition at line 140 of file mark-compact.h.

Constructor & Destructor Documentation

◆ MarkingDeque()

v8::internal::MarkingDeque::MarkingDeque ( )
inline

Definition at line 142 of file mark-compact.h.

143  : array_(NULL), top_(0), bottom_(0), mask_(0), overflowed_(false) {}
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

Member Function Documentation

◆ array()

HeapObject** v8::internal::MarkingDeque::array ( )
inline

Definition at line 209 of file mark-compact.h.

209 { return array_; }

References array_.

Referenced by v8::internal::IncrementalMarking::UpdateMarkingDequeAfterScavenge().

+ Here is the caller graph for this function:

◆ bottom()

int v8::internal::MarkingDeque::bottom ( )
inline

Definition at line 210 of file mark-compact.h.

210 { return bottom_; }

References bottom_.

Referenced by v8::internal::IncrementalMarking::UpdateMarkingDequeAfterScavenge().

+ Here is the caller graph for this function:

◆ ClearOverflowed()

void v8::internal::MarkingDeque::ClearOverflowed ( )
inline

Definition at line 162 of file mark-compact.h.

162 { overflowed_ = false; }

References overflowed_.

Referenced by v8::internal::MarkCompactCollector::MarkLiveObjects(), and v8::internal::MarkCompactCollector::RefillMarkingDeque().

+ Here is the caller graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::MarkingDeque::DISALLOW_COPY_AND_ASSIGN ( MarkingDeque  )
private

◆ Initialize()

void v8::internal::MarkingDeque::Initialize ( Address  low,
Address  high 
)
inline

Definition at line 145 of file mark-compact.h.

145  {
146  HeapObject** obj_low = reinterpret_cast<HeapObject**>(low);
147  HeapObject** obj_high = reinterpret_cast<HeapObject**>(high);
148  array_ = obj_low;
150  static_cast<uint32_t>(obj_high - obj_low)) -
151  1;
152  top_ = bottom_ = 0;
153  overflowed_ = false;
154  }
uint32_t RoundDownToPowerOfTwo32(uint32_t value)
Definition: bits.h:99

References array_, bottom_, mask_, overflowed_, v8::base::bits::RoundDownToPowerOfTwo32(), and top_.

Referenced by v8::internal::MarkCompactCollector::MarkLiveObjects(), and v8::internal::IncrementalMarking::StartMarking().

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

◆ INLINE() [1/4]

v8::internal::MarkingDeque::INLINE ( HeapObject Pop())
inline

Definition at line 191 of file mark-compact.h.

191  {
192  DCHECK(!IsEmpty());
193  top_ = ((top_ - 1) & mask_);
194  HeapObject* object = array_[top_];
195  DCHECK(object->IsHeapObject());
196  return object;
197  }
#define DCHECK(condition)
Definition: logging.h:205

References array_, DCHECK, IsEmpty(), mask_, and top_.

+ Here is the call graph for this function:

◆ INLINE() [2/4]

v8::internal::MarkingDeque::INLINE ( void   PushBlackHeapObject *object)
inline

Definition at line 169 of file mark-compact.h.

169  {
170  DCHECK(object->IsHeapObject());
171  if (IsFull()) {
172  Marking::BlackToGrey(object);
173  MemoryChunk::IncrementLiveBytesFromGC(object->address(), -object->Size());
174  SetOverflowed();
175  } else {
176  array_[top_] = object;
177  top_ = ((top_ + 1) & mask_);
178  }
179  }
static void IncrementLiveBytesFromGC(Address address, int by)
Definition: spaces.h:517

References v8::internal::HeapObject::address(), array_, DCHECK, v8::internal::MemoryChunk::IncrementLiveBytesFromGC(), IsFull(), mask_, SetOverflowed(), v8::internal::HeapObject::Size(), and top_.

+ Here is the call graph for this function:

◆ INLINE() [3/4]

v8::internal::MarkingDeque::INLINE ( void   PushGreyHeapObject *object)
inline

Definition at line 181 of file mark-compact.h.

181  {
182  DCHECK(object->IsHeapObject());
183  if (IsFull()) {
184  SetOverflowed();
185  } else {
186  array_[top_] = object;
187  top_ = ((top_ + 1) & mask_);
188  }
189  }

References array_, DCHECK, IsFull(), mask_, SetOverflowed(), and top_.

+ Here is the call graph for this function:

◆ INLINE() [4/4]

v8::internal::MarkingDeque::INLINE ( void   UnshiftGreyHeapObject *object)
inline

Definition at line 199 of file mark-compact.h.

199  {
200  DCHECK(object->IsHeapObject());
201  if (IsFull()) {
202  SetOverflowed();
203  } else {
204  bottom_ = ((bottom_ - 1) & mask_);
205  array_[bottom_] = object;
206  }
207  }

References array_, bottom_, DCHECK, IsFull(), mask_, and SetOverflowed().

+ Here is the call graph for this function:

◆ IsEmpty()

bool v8::internal::MarkingDeque::IsEmpty ( )
inline

Definition at line 158 of file mark-compact.h.

158 { return top_ == bottom_; }

References bottom_, and top_.

Referenced by v8::internal::MarkCompactCollector::EmptyMarkingDeque(), v8::internal::IncrementalMarking::Finalize(), INLINE(), v8::internal::MarkCompactCollector::ProcessEphemeralMarking(), and v8::internal::IncrementalMarking::Step().

+ Here is the caller graph for this function:

◆ IsFull()

bool v8::internal::MarkingDeque::IsFull ( )
inline

Definition at line 156 of file mark-compact.h.

156 { return ((top_ + 1) & mask_) == bottom_; }

References bottom_, mask_, and top_.

Referenced by v8::internal::DiscoverGreyObjectsInNewSpace(), v8::internal::DiscoverGreyObjectsInSpace(), v8::internal::DiscoverGreyObjectsOnPage(), v8::internal::DiscoverGreyObjectsWithIterator(), INLINE(), v8::internal::MarkCompactCollector::RefillMarkingDeque(), and v8::internal::IncrementalMarkingMarkingVisitor::VisitFixedArrayIncremental().

+ Here is the caller graph for this function:

◆ mask()

int v8::internal::MarkingDeque::mask ( )
inline

Definition at line 212 of file mark-compact.h.

212 { return mask_; }

References mask_.

Referenced by v8::internal::IncrementalMarking::UpdateMarkingDequeAfterScavenge().

+ Here is the caller graph for this function:

◆ overflowed()

bool v8::internal::MarkingDeque::overflowed ( ) const
inline

Definition at line 160 of file mark-compact.h.

160 { return overflowed_; }

References overflowed_.

Referenced by v8::internal::MarkCompactCollector::MarkLiveObjects(), v8::internal::MarkCompactCollector::MarkRoots(), v8::internal::MarkCompactCollector::ProcessMarkingDeque(), and v8::internal::MarkCompactCollector::RefillMarkingDeque().

+ Here is the caller graph for this function:

◆ set_top()

void v8::internal::MarkingDeque::set_top ( int  top)
inline

Definition at line 213 of file mark-compact.h.

References top(), and top_.

Referenced by v8::internal::IncrementalMarking::UpdateMarkingDequeAfterScavenge().

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

◆ SetOverflowed()

void v8::internal::MarkingDeque::SetOverflowed ( )
inline

Definition at line 164 of file mark-compact.h.

164 { overflowed_ = true; }

References overflowed_.

Referenced by INLINE(), and v8::internal::MarkCompactCollector::MarkLiveObjects().

+ Here is the caller graph for this function:

◆ top()

int v8::internal::MarkingDeque::top ( )
inline

Definition at line 211 of file mark-compact.h.

211 { return top_; }

References top_.

Referenced by set_top(), and v8::internal::IncrementalMarking::UpdateMarkingDequeAfterScavenge().

+ Here is the caller graph for this function:

Member Data Documentation

◆ array_

HeapObject** v8::internal::MarkingDeque::array_
private

Definition at line 216 of file mark-compact.h.

Referenced by array(), Initialize(), and INLINE().

◆ bottom_

int v8::internal::MarkingDeque::bottom_
private

Definition at line 221 of file mark-compact.h.

Referenced by bottom(), Initialize(), INLINE(), IsEmpty(), and IsFull().

◆ mask_

int v8::internal::MarkingDeque::mask_
private

Definition at line 222 of file mark-compact.h.

Referenced by Initialize(), INLINE(), IsFull(), and mask().

◆ overflowed_

bool v8::internal::MarkingDeque::overflowed_
private

Definition at line 223 of file mark-compact.h.

Referenced by ClearOverflowed(), Initialize(), overflowed(), and SetOverflowed().

◆ top_

int v8::internal::MarkingDeque::top_
private

Definition at line 220 of file mark-compact.h.

Referenced by Initialize(), INLINE(), IsEmpty(), IsFull(), set_top(), and top().


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