V8 Project
v8::internal::MemoryChunk Class Reference

#include <spaces.h>

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

Public Types

enum  MemoryChunkFlags {
  IS_EXECUTABLE , ABOUT_TO_BE_FREED , POINTERS_TO_HERE_ARE_INTERESTING , POINTERS_FROM_HERE_ARE_INTERESTING ,
  SCAN_ON_SCAVENGE , IN_FROM_SPACE , IN_TO_SPACE , NEW_SPACE_BELOW_AGE_MARK ,
  CONTAINS_ONLY_DATA , EVACUATION_CANDIDATE , RESCAN_ON_EVACUATION , WAS_SWEPT ,
  HAS_PROGRESS_BAR , NUM_MEMORY_CHUNK_FLAGS
}
 
enum  ParallelSweepingState { SWEEPING_DONE , SWEEPING_FINALIZE , SWEEPING_IN_PROGRESS , SWEEPING_PENDING }
 

Public Member Functions

Address address ()
 
bool is_valid ()
 
MemoryChunknext_chunk () const
 
MemoryChunkprev_chunk () const
 
void set_next_chunk (MemoryChunk *next)
 
void set_prev_chunk (MemoryChunk *prev)
 
Spaceowner () const
 
void set_owner (Space *space)
 
base::VirtualMemoryreserved_memory ()
 
void InitializeReservedMemory ()
 
void set_reserved_memory (base::VirtualMemory *reservation)
 
bool scan_on_scavenge ()
 
void initialize_scan_on_scavenge (bool scan)
 
void set_scan_on_scavenge (bool scan)
 
int store_buffer_counter ()
 
void set_store_buffer_counter (int counter)
 
bool Contains (Address addr)
 
bool ContainsLimit (Address addr)
 
void SetFlag (int flag)
 
void ClearFlag (int flag)
 
void SetFlagTo (int flag, bool value)
 
bool IsFlagSet (int flag)
 
void SetFlags (intptr_t flags, intptr_t mask)
 
intptr_t GetFlags ()
 
ParallelSweepingState parallel_sweeping ()
 
void set_parallel_sweeping (ParallelSweepingState state)
 
bool TryParallelSweeping ()
 
bool SweepingCompleted ()
 
void ResetLiveBytes ()
 
void IncrementLiveBytes (int by)
 
int LiveBytes ()
 
int write_barrier_counter ()
 
void set_write_barrier_counter (int counter)
 
int progress_bar ()
 
void set_progress_bar (int progress_bar)
 
void ResetProgressBar ()
 
bool IsLeftOfProgressBar (Object **slot)
 
size_t size () const
 
void set_size (size_t size)
 
void SetArea (Address area_start, Address area_end)
 
Executability executable ()
 
bool ContainsOnlyData ()
 
bool InNewSpace ()
 
bool InToSpace ()
 
bool InFromSpace ()
 
Bitmapmarkbits ()
 
void PrintMarkbits ()
 
uint32_t AddressToMarkbitIndex (Address addr)
 
Address MarkbitIndexToAddress (uint32_t index)
 
void InsertAfter (MemoryChunk *other)
 
void Unlink ()
 
Heapheap () const
 
bool IsEvacuationCandidate ()
 
bool ShouldSkipEvacuationSlotRecording ()
 
SkipListskip_list ()
 
void set_skip_list (SkipList *skip_list)
 
SlotsBufferslots_buffer ()
 
SlotsBuffer ** slots_buffer_address ()
 
void MarkEvacuationCandidate ()
 
void ClearEvacuationCandidate ()
 
Address area_start ()
 
Address area_end ()
 
int area_size ()
 
bool CommitArea (size_t requested)
 
size_t CommittedPhysicalMemory ()
 

Static Public Member Functions

static MemoryChunkFromAddress (Address a)
 
static const MemoryChunkFromAddress (const byte *a)
 
static MemoryChunkFromAnyPointerAddress (Heap *heap, Address addr)
 
static void IncrementLiveBytesFromGC (Address address, int by)
 
static void IncrementLiveBytesFromMutator (Address address, int by)
 
static uint32_t FastAddressToMarkbitIndex (Address addr)
 
static void UpdateHighWaterMark (Address mark)
 

Static Public Attributes

static const int kWriteBarrierCounterGranularity = 500
 
static const int kPointersToHereAreInterestingMask
 
static const int kPointersFromHereAreInterestingMask
 
static const int kEvacuationCandidateMask = 1 << EVACUATION_CANDIDATE
 
static const int kSkipEvacuationSlotsRecordingMask
 
static const intptr_t kAlignment
 
static const intptr_t kAlignmentMask = kAlignment - 1
 
static const intptr_t kSizeOffset = 0
 
static const intptr_t kLiveBytesOffset
 
static const size_t kSlotsBufferOffset = kLiveBytesOffset + kIntSize
 
static const size_t kWriteBarrierCounterOffset
 
static const size_t kHeaderSize
 
static const int kBodyOffset
 
static const int kObjectStartAlignment = 32 * kPointerSize
 
static const int kObjectStartOffset
 
static const int kFlagsOffset = kPointerSize
 

Static Protected Member Functions

static MemoryChunkInitialize (Heap *heap, Address base, size_t size, Address area_start, Address area_end, Executability executable, Space *owner)
 

Protected Attributes

size_t size_
 
intptr_t flags_
 
Address area_start_
 
Address area_end_
 
base::VirtualMemory reservation_
 
Address owner_
 
Heapheap_
 
int store_buffer_counter_
 
int live_byte_count_
 
SlotsBufferslots_buffer_
 
SkipListskip_list_
 
intptr_t write_barrier_counter_
 
int progress_bar_
 
int high_water_mark_
 
base::AtomicWord parallel_sweeping_
 
intptr_t available_in_small_free_list_
 
intptr_t available_in_medium_free_list_
 
intptr_t available_in_large_free_list_
 
intptr_t available_in_huge_free_list_
 
intptr_t non_available_small_blocks_
 

Private Attributes

base::AtomicWord next_chunk_
 
base::AtomicWord prev_chunk_
 

Friends

class MemoryAllocator
 

Detailed Description

Definition at line 273 of file spaces.h.

Member Enumeration Documentation

◆ MemoryChunkFlags

Enumerator
IS_EXECUTABLE 
ABOUT_TO_BE_FREED 
POINTERS_TO_HERE_ARE_INTERESTING 
POINTERS_FROM_HERE_ARE_INTERESTING 
SCAN_ON_SCAVENGE 
IN_FROM_SPACE 
IN_TO_SPACE 
NEW_SPACE_BELOW_AGE_MARK 
CONTAINS_ONLY_DATA 
EVACUATION_CANDIDATE 
RESCAN_ON_EVACUATION 
WAS_SWEPT 
HAS_PROGRESS_BAR 
NUM_MEMORY_CHUNK_FLAGS 

Definition at line 364 of file spaces.h.

364  {
370  IN_FROM_SPACE, // Mutually exclusive with IN_TO_SPACE.
371  IN_TO_SPACE, // All pages in new space has one of these two set.
376 
377  // WAS_SWEPT indicates that marking bits have been cleared by the sweeper,
378  // otherwise marking bits are still intact.
379  WAS_SWEPT,
380 
381  // Large objects can have a progress bar in their page header. These object
382  // are scanned in increments and will be kept black while being scanned.
383  // Even if the mutator writes to them they will be kept black and a white
384  // to grey transition is performed in the value.
386 
387  // Last flag, keep at bottom.
389  };

◆ ParallelSweepingState

Enumerator
SWEEPING_DONE 
SWEEPING_FINALIZE 
SWEEPING_IN_PROGRESS 
SWEEPING_PENDING 

Definition at line 438 of file spaces.h.

Member Function Documentation

◆ address()

Address v8::internal::MemoryChunk::address ( )
inline

◆ AddressToMarkbitIndex()

uint32_t v8::internal::MemoryChunk::AddressToMarkbitIndex ( Address  addr)
inline

Definition at line 586 of file spaces.h.

586  {
587  return static_cast<uint32_t>(addr - this->address()) >> kPointerSizeLog2;
588  }
const int kPointerSizeLog2
Definition: globals.h:147

References address(), and v8::internal::kPointerSizeLog2.

+ Here is the call graph for this function:

◆ area_end()

◆ area_size()

int v8::internal::MemoryChunk::area_size ( )
inline

Definition at line 633 of file spaces.h.

633 { return static_cast<int>(area_end() - area_start()); }

References area_end(), and area_start().

Referenced by v8::internal::LargeObjectSpace::AllocateRaw(), v8::internal::MarkCompactCollector::CollectEvacuationCandidates(), v8::internal::PagedSpace::DecreaseUnsweptFreeBytes(), v8::internal::PagedSpace::FreeEmergencyMemory(), v8::internal::PagedSpace::IncreaseUnsweptFreeBytes(), v8::internal::Page::Initialize(), v8::internal::MarkCompactCollector::ReleaseEvacuationCandidates(), and v8::internal::PagedSpace::ReleasePage().

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

◆ area_start()

◆ ClearEvacuationCandidate()

void v8::internal::MemoryChunk::ClearEvacuationCandidate ( )
inline

Definition at line 626 of file spaces.h.

626  {
629  }
SlotsBuffer * slots_buffer_
Definition: spaces.h:661
void ClearFlag(int flag)
Definition: spaces.h:407
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
#define DCHECK(condition)
Definition: logging.h:205

References ClearFlag(), DCHECK, EVACUATION_CANDIDATE, NULL, and slots_buffer_.

Referenced by v8::internal::MarkCompactCollector::AbortCompaction(), v8::internal::MarkCompactCollector::CollectEvacuationCandidates(), v8::internal::MarkCompactCollector::EvacuatePages(), and v8::internal::MarkCompactCollector::INLINE().

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

◆ ClearFlag()

◆ CommitArea()

bool v8::internal::MemoryChunk::CommitArea ( size_t  requested)

Definition at line 476 of file spaces.cc.

476  {
477  size_t guard_size =
479  size_t header_size = area_start() - address() - guard_size;
480  size_t commit_size =
481  RoundUp(header_size + requested, base::OS::CommitPageSize());
482  size_t committed_size = RoundUp(header_size + (area_end() - area_start()),
484 
485  if (commit_size > committed_size) {
486  // Commit size should be less or equal than the reserved size.
487  DCHECK(commit_size <= size() - 2 * guard_size);
488  // Append the committed area.
489  Address start = address() + committed_size + guard_size;
490  size_t length = commit_size - committed_size;
491  if (reservation_.IsReserved()) {
494  if (!heap()->isolate()->memory_allocator()->CommitMemory(start, length,
495  executable)) {
496  return false;
497  }
498  } else {
499  CodeRange* code_range = heap_->isolate()->code_range();
500  DCHECK(code_range != NULL && code_range->valid() &&
502  if (!code_range->CommitRawMemory(start, length)) return false;
503  }
504 
505  if (Heap::ShouldZapGarbage()) {
506  heap_->isolate()->memory_allocator()->ZapBlock(start, length);
507  }
508  } else if (commit_size < committed_size) {
509  DCHECK(commit_size > 0);
510  // Shrink the committed area.
511  size_t length = committed_size - commit_size;
512  Address start = address() + committed_size + guard_size - length;
513  if (reservation_.IsReserved()) {
514  if (!reservation_.Uncommit(start, length)) return false;
515  } else {
516  CodeRange* code_range = heap_->isolate()->code_range();
517  DCHECK(code_range != NULL && code_range->valid() &&
519  if (!code_range->UncommitRawMemory(start, length)) return false;
520  }
521  }
522 
523  area_end_ = area_start_ + requested;
524  return true;
525 }
static intptr_t CommitPageSize()
bool Uncommit(void *address, size_t size)
Isolate * isolate()
Definition: heap-inl.h:589
static bool ShouldZapGarbage()
Definition: heap.h:926
CodeRange * code_range()
Definition: isolate.h:863
MemoryAllocator * memory_allocator()
Definition: isolate.h:883
static int CodePageGuardSize()
Definition: spaces.cc:815
void ZapBlock(Address start, size_t size)
Definition: spaces.cc:743
bool IsFlagSet(int flag)
Definition: spaces.h:417
Executability executable()
Definition: spaces.h:563
Heap * heap() const
Definition: spaces.h:603
base::VirtualMemory reservation_
Definition: spaces.h:650
size_t size() const
Definition: spaces.h:554
@ NOT_EXECUTABLE
Definition: globals.h:391
static void RoundUp(Vector< char > buffer, int *length, int *decimal_point)
Definition: fixed-dtoa.cc:171

References address(), area_end(), area_end_, area_start(), area_start_, v8::internal::Isolate::code_range(), v8::internal::MemoryAllocator::CodePageGuardSize(), v8::base::OS::CommitPageSize(), v8::internal::CodeRange::CommitRawMemory(), DCHECK, v8::internal::EXECUTABLE, executable(), heap(), heap_, IS_EXECUTABLE, IsFlagSet(), v8::internal::Heap::isolate(), v8::base::VirtualMemory::IsReserved(), v8::internal::Isolate::memory_allocator(), v8::internal::NOT_EXECUTABLE, NULL, reservation_, v8::internal::RoundUp(), v8::internal::Heap::ShouldZapGarbage(), size(), v8::base::VirtualMemory::Uncommit(), v8::internal::CodeRange::UncommitRawMemory(), v8::internal::CodeRange::valid(), and v8::internal::MemoryAllocator::ZapBlock().

Referenced by v8::internal::Deoptimizer::EnsureCodeForDeoptimizationEntry().

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

◆ CommittedPhysicalMemory()

size_t v8::internal::MemoryChunk::CommittedPhysicalMemory ( )
inline

Definition at line 637 of file spaces.h.

637 { return high_water_mark_; }

References high_water_mark_.

Referenced by v8::internal::LargeObjectSpace::CommittedPhysicalMemory().

+ Here is the caller graph for this function:

◆ Contains()

bool v8::internal::MemoryChunk::Contains ( Address  addr)
inline

Definition at line 348 of file spaces.h.

348  {
349  return addr >= area_start() && addr < area_end();
350  }

References area_end(), and area_start().

Referenced by v8::internal::Heap::AllocateCode(), v8::internal::StoreBuffer::ExemptPopularPages(), v8::internal::StoreBuffer::Filter(), v8::internal::LargeObjectSpace::FindPage(), and FromAnyPointerAddress().

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

◆ ContainsLimit()

bool v8::internal::MemoryChunk::ContainsLimit ( Address  addr)
inline

Definition at line 355 of file spaces.h.

355  {
356  return addr >= area_start() && addr <= area_end();
357  }

References area_end(), and area_start().

Referenced by v8::internal::NewSpace::limit(), v8::internal::NewSpace::set_top(), v8::internal::Heap::ShouldBePromoted(), and v8::internal::NewSpace::top().

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

◆ ContainsOnlyData()

bool v8::internal::MemoryChunk::ContainsOnlyData ( )
inline

Definition at line 567 of file spaces.h.

567 { return IsFlagSet(CONTAINS_ONLY_DATA); }

References CONTAINS_ONLY_DATA, and IsFlagSet().

+ Here is the call graph for this function:

◆ executable()

Executability v8::internal::MemoryChunk::executable ( )
inline

Definition at line 563 of file spaces.h.

563  {
565  }

References v8::internal::EXECUTABLE, IS_EXECUTABLE, IsFlagSet(), and v8::internal::NOT_EXECUTABLE.

Referenced by CommitArea(), v8::internal::MemoryAllocator::Free(), and Initialize().

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

◆ FastAddressToMarkbitIndex()

static uint32_t v8::internal::MemoryChunk::FastAddressToMarkbitIndex ( Address  addr)
inlinestatic

Definition at line 590 of file spaces.h.

590  {
591  const intptr_t offset = reinterpret_cast<intptr_t>(addr) & kAlignmentMask;
592 
593  return static_cast<uint32_t>(offset) >> kPointerSizeLog2;
594  }
static const intptr_t kAlignmentMask
Definition: spaces.h:526

References kAlignmentMask, and v8::internal::kPointerSizeLog2.

Referenced by v8::internal::IsOnInvalidatedCodeObject(), and v8::internal::SetMarkBitsUnderInvalidatedCode().

+ Here is the caller graph for this function:

◆ FromAddress() [1/2]

static MemoryChunk* v8::internal::MemoryChunk::FromAddress ( Address  a)
inlinestatic

Definition at line 276 of file spaces.h.

276  {
277  return reinterpret_cast<MemoryChunk*>(OffsetFrom(a) & ~kAlignmentMask);
278  }
intptr_t OffsetFrom(T x)
Definition: macros.h:383

References kAlignmentMask, and OffsetFrom().

Referenced by v8::internal::IncrementalMarking::Abort(), v8::internal::HeapObjectIterator::AdvanceToNextPage(), v8::internal::Heap::AllocateCode(), v8::internal::Heap::AllocateFillerObject(), v8::internal::Heap::AllowedToBeMigrated(), v8::internal::Heap::CanMoveObjectStart(), v8::internal::MarkCompactCollector::ClearMarkbits(), v8::internal::PagedSpace::Contains(), v8::internal::LargeObjectSpace::Contains(), v8::internal::FreeListCategory::ContainsPageFreeListItemsInList(), v8::internal::MarkCompactCollector::EvacuateNewSpaceAndCandidates(), v8::internal::FreeListCategory::EvictFreeListItemsInList(), v8::internal::FreeList::FindNodeFor(), v8::internal::PagedSpace::FindObject(), v8::internal::FreeList::Free(), v8::internal::Heap::FreeQueuedChunks(), v8::internal::LargeObjectSpace::FreeUnmarkedObjects(), FromAnyPointerAddress(), v8::internal::InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), v8::internal::HeapObject::GetHeap(), IncrementLiveBytesFromGC(), IncrementLiveBytesFromMutator(), Initialize(), v8::internal::MarkCompactCollector::INLINE(), v8::internal::Page::INLINE(), v8::internal::PromotionQueue::IsBelowPromotionQueue(), v8::internal::IsOnInvalidatedCodeObject(), v8::internal::MarkCompactCollector::MigrateObject(), v8::internal::BASE_EMBEDDED< Visitor >::next(), v8::internal::FreeListCategory::PickNodeFromList(), v8::internal::MarkCompactCollector::RecordCodeEntrySlot(), v8::internal::MarkCompactCollector::RecordRelocSlot(), v8::internal::IncrementalMarking::RecordWriteFromCode(), v8::internal::IncrementalMarking::RecordWrites(), v8::internal::SetMarkBitsUnderInvalidatedCode(), v8::internal::PagedSpace::SetTopAndLimit(), v8::internal::Marking::TransferMark(), v8::internal::SkipList::Update(), v8::internal::Heap::UpdateAllocationsHash(), UpdateHighWaterMark(), v8::internal::IncrementalMarking::UpdateMarkingDequeAfterScavenge(), and v8::internal::IncrementalMarkingMarkingVisitor::VisitFixedArrayIncremental().

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

◆ FromAddress() [2/2]

static const MemoryChunk* v8::internal::MemoryChunk::FromAddress ( const byte a)
inlinestatic

Definition at line 279 of file spaces.h.

279  {
280  return reinterpret_cast<const MemoryChunk*>(OffsetFrom(a) &
281  ~kAlignmentMask);
282  }

References kAlignmentMask, and OffsetFrom().

+ Here is the call graph for this function:

◆ FromAnyPointerAddress()

MemoryChunk * v8::internal::MemoryChunk::FromAnyPointerAddress ( Heap heap,
Address  addr 
)
inlinestatic

Definition at line 169 of file spaces-inl.h.

169  {
170  MemoryChunk* maybe = reinterpret_cast<MemoryChunk*>(
171  OffsetFrom(addr) & ~Page::kPageAlignmentMask);
172  if (maybe->owner() != NULL) return maybe;
173  LargeObjectIterator iterator(heap->lo_space());
174  for (HeapObject* o = iterator.Next(); o != NULL; o = iterator.Next()) {
175  // Fixed arrays are the only pointer-containing objects in large object
176  // space.
177  if (o->IsFixedArray()) {
178  MemoryChunk* chunk = MemoryChunk::FromAddress(o->address());
179  if (chunk->Contains(addr)) {
180  return chunk;
181  }
182  }
183  }
184  UNREACHABLE();
185  return NULL;
186 }
LargeObjectSpace * lo_space()
Definition: heap.h:600
static MemoryChunk * FromAddress(Address a)
Definition: spaces.h:276
#define UNREACHABLE()
Definition: logging.h:30
Maybe< T > maybe(T t)
Definition: v8.h:902

References Contains(), FromAddress(), heap(), v8::internal::Heap::lo_space(), v8::maybe(), v8::internal::LargeObjectIterator::Next(), NULL, OffsetFrom(), and UNREACHABLE.

Referenced by v8::internal::StoreBuffer::EnterDirectlyIntoStoreBuffer(), v8::internal::StoreBuffer::ExemptPopularPages(), and v8::internal::StoreBuffer::Filter().

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

◆ GetFlags()

intptr_t v8::internal::MemoryChunk::GetFlags ( )
inline

Definition at line 429 of file spaces.h.

429 { return flags_; }

References flags_.

Referenced by v8::internal::SemiSpace::GrowTo(), and v8::internal::SemiSpace::Swap().

+ Here is the caller graph for this function:

◆ heap()

Heap* v8::internal::MemoryChunk::heap ( ) const
inline

Definition at line 603 of file spaces.h.

603 { return heap_; }

References heap_.

Referenced by CommitArea(), FromAnyPointerAddress(), v8::internal::HeapObject::GetHeap(), v8::internal::HeapObjectIterator::HeapObjectIterator(), Initialize(), v8::internal::NewSpacePage::Initialize(), v8::internal::LargePage::Initialize(), and v8::internal::Page::Initialize().

+ Here is the caller graph for this function:

◆ IncrementLiveBytes()

void v8::internal::MemoryChunk::IncrementLiveBytes ( int  by)
inline

Definition at line 471 of file spaces.h.

471  {
472  if (FLAG_gc_verbose) {
473  printf("UpdateLiveBytes:%p:%x%c=%x->%x\n", static_cast<void*>(this),
474  live_byte_count_, ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by),
475  live_byte_count_ + by);
476  }
477  live_byte_count_ += by;
478  DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_);
479  }
#define DCHECK_LE(v1, v2)
Definition: logging.h:210

References DCHECK_LE, live_byte_count_, and size_.

Referenced by IncrementLiveBytesFromGC(), and IncrementLiveBytesFromMutator().

+ Here is the caller graph for this function:

◆ IncrementLiveBytesFromGC()

static void v8::internal::MemoryChunk::IncrementLiveBytesFromGC ( Address  address,
int  by 
)
inlinestatic

Definition at line 517 of file spaces.h.

517  {
519  }
void IncrementLiveBytes(int by)
Definition: spaces.h:471

References address(), FromAddress(), and IncrementLiveBytes().

Referenced by v8::internal::Heap::AdjustLiveBytes(), v8::internal::IncrementalMarking::BlackToGreyAndUnshift(), v8::internal::DiscoverGreyObjectsOnPage(), v8::internal::DiscoverGreyObjectsWithIterator(), v8::internal::IncrementalMarking::Hurry(), v8::internal::IncrementalMarkingMarkingVisitor::INLINE(), v8::internal::ScavengingVisitor< marks_handling, logging_and_profiling_mode >::INLINE(), v8::internal::MarkingDeque::INLINE(), v8::internal::MarkBlackOrKeepBlack(), v8::internal::MarkBlackOrKeepGrey(), and v8::internal::MarkObjectGreyDoNotEnqueue().

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

◆ IncrementLiveBytesFromMutator()

void v8::internal::MemoryChunk::IncrementLiveBytesFromMutator ( Address  address,
int  by 
)
static

Definition at line 868 of file spaces.cc.

868  {
869  MemoryChunk* chunk = MemoryChunk::FromAddress(address);
870  if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->WasSwept()) {
871  static_cast<PagedSpace*>(chunk->owner())->IncrementUnsweptFreeBytes(-by);
872  }
873  chunk->IncrementLiveBytes(by);
874 }

References address(), FromAddress(), IncrementLiveBytes(), InNewSpace(), owner(), and v8::internal::Page::WasSwept().

Referenced by v8::internal::Heap::AdjustLiveBytes().

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

◆ InFromSpace()

bool v8::internal::MemoryChunk::InFromSpace ( )
inline

Definition at line 575 of file spaces.h.

575 { return IsFlagSet(IN_FROM_SPACE); }

References IN_FROM_SPACE, and IsFlagSet().

+ Here is the call graph for this function:

◆ Initialize()

MemoryChunk * v8::internal::MemoryChunk::Initialize ( Heap heap,
Address  base,
size_t  size,
Address  area_start,
Address  area_end,
Executability  executable,
Space owner 
)
staticprotected

Definition at line 430 of file spaces.cc.

432  {
433  MemoryChunk* chunk = FromAddress(base);
434 
435  DCHECK(base == chunk->address());
436 
437  chunk->heap_ = heap;
438  chunk->size_ = size;
439  chunk->area_start_ = area_start;
440  chunk->area_end_ = area_end;
441  chunk->flags_ = 0;
442  chunk->set_owner(owner);
443  chunk->InitializeReservedMemory();
444  chunk->slots_buffer_ = NULL;
445  chunk->skip_list_ = NULL;
446  chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity;
447  chunk->progress_bar_ = 0;
448  chunk->high_water_mark_ = static_cast<int>(area_start - base);
449  chunk->set_parallel_sweeping(SWEEPING_DONE);
450  chunk->available_in_small_free_list_ = 0;
451  chunk->available_in_medium_free_list_ = 0;
452  chunk->available_in_large_free_list_ = 0;
453  chunk->available_in_huge_free_list_ = 0;
454  chunk->non_available_small_blocks_ = 0;
455  chunk->ResetLiveBytes();
456  Bitmap::Clear(chunk);
457  chunk->initialize_scan_on_scavenge(false);
458  chunk->SetFlag(WAS_SWEPT);
459 
460  DCHECK(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset);
462 
463  if (executable == EXECUTABLE) {
464  chunk->SetFlag(IS_EXECUTABLE);
465  }
466 
467  if (owner == heap->old_data_space()) {
468  chunk->SetFlag(CONTAINS_ONLY_DATA);
469  }
470 
471  return chunk;
472 }
static void Clear(MemoryChunk *chunk)
Definition: spaces-inl.h:21
OldSpace * old_data_space()
Definition: heap.h:595
static const int kFlagsOffset
Definition: spaces.h:605
Space * owner() const
Definition: spaces.h:307
static const int kWriteBarrierCounterGranularity
Definition: spaces.h:362
static const intptr_t kLiveBytesOffset
Definition: spaces.h:530
#define OFFSET_OF(type, field)
Definition: macros.h:22

References address(), area_end(), area_end_, area_start(), area_start_, available_in_huge_free_list_, available_in_large_free_list_, available_in_medium_free_list_, available_in_small_free_list_, v8::internal::Bitmap::Clear(), CONTAINS_ONLY_DATA, DCHECK, v8::internal::EXECUTABLE, executable(), flags_, FromAddress(), heap(), heap_, high_water_mark_, initialize_scan_on_scavenge(), InitializeReservedMemory(), IS_EXECUTABLE, kFlagsOffset, kLiveBytesOffset, kWriteBarrierCounterGranularity, live_byte_count_, non_available_small_blocks_, NULL, OFFSET_OF, v8::internal::Heap::old_data_space(), owner(), progress_bar_, ResetLiveBytes(), set_owner(), set_parallel_sweeping(), SetFlag(), size(), size_, skip_list_, slots_buffer_, SWEEPING_DONE, WAS_SWEPT, and write_barrier_counter_.

Referenced by v8::internal::MemoryAllocator::AllocateChunk(), and v8::internal::NewSpacePage::Initialize().

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

◆ initialize_scan_on_scavenge()

void v8::internal::MemoryChunk::initialize_scan_on_scavenge ( bool  scan)
inline

Definition at line 334 of file spaces.h.

334  {
335  if (scan) {
337  } else {
339  }
340  }
void SetFlag(int flag)
Definition: spaces.h:405

References ClearFlag(), SCAN_ON_SCAVENGE, and SetFlag().

Referenced by Initialize(), and v8::internal::NewSpacePage::Initialize().

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

◆ InitializeReservedMemory()

void v8::internal::MemoryChunk::InitializeReservedMemory ( )
inline

Definition at line 326 of file spaces.h.

References reservation_, and v8::base::VirtualMemory::Reset().

Referenced by Initialize().

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

◆ InNewSpace()

bool v8::internal::MemoryChunk::InNewSpace ( )
inline

Definition at line 569 of file spaces.h.

569  {
570  return (flags_ & ((1 << IN_FROM_SPACE) | (1 << IN_TO_SPACE))) != 0;
571  }

References flags_, IN_FROM_SPACE, and IN_TO_SPACE.

Referenced by IncrementLiveBytesFromMutator(), and v8::internal::NewSpacePage::is_anchor().

+ Here is the caller graph for this function:

◆ InsertAfter()

void v8::internal::MemoryChunk::InsertAfter ( MemoryChunk other)

Definition at line 528 of file spaces.cc.

528  {
529  MemoryChunk* other_next = other->next_chunk();
530 
531  set_next_chunk(other_next);
532  set_prev_chunk(other);
533  other_next->set_prev_chunk(this);
534  other->set_next_chunk(this);
535 }
void set_next_chunk(MemoryChunk *next)
Definition: spaces.h:299
void set_prev_chunk(MemoryChunk *prev)
Definition: spaces.h:303

References next_chunk(), set_next_chunk(), and set_prev_chunk().

Referenced by v8::internal::SemiSpace::Commit(), v8::internal::PagedSpace::Expand(), v8::internal::SemiSpace::GrowTo(), v8::internal::MarkCompactCollector::MoveEvacuationCandidatesToEndOfPagesList(), and v8::internal::PagedSpace::UseEmergencyMemory().

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

◆ InToSpace()

bool v8::internal::MemoryChunk::InToSpace ( )
inline

Definition at line 573 of file spaces.h.

573 { return IsFlagSet(IN_TO_SPACE); }

References IN_TO_SPACE, and IsFlagSet().

+ Here is the call graph for this function:

◆ is_valid()

bool v8::internal::MemoryChunk::is_valid ( )
inline

Definition at line 289 of file spaces.h.

289 { return address() != NULL; }

References address(), and NULL.

Referenced by v8::internal::IncrementalMarking::ActivateIncrementalWriteBarrier(), v8::internal::PagedSpace::Contains(), v8::internal::IncrementalMarking::DeactivateIncrementalWriteBarrier(), and v8::internal::LargeObjectSpace::FindPage().

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

◆ IsEvacuationCandidate()

◆ IsFlagSet()

◆ IsLeftOfProgressBar()

bool v8::internal::MemoryChunk::IsLeftOfProgressBar ( Object **  slot)
inline

Definition at line 510 of file spaces.h.

510  {
511  Address slot_address = reinterpret_cast<Address>(slot);
512  DCHECK(slot_address > this->address());
513  return (slot_address - (this->address() + kObjectStartOffset)) <
514  progress_bar();
515  }
static const int kObjectStartOffset
Definition: spaces.h:550

References address(), DCHECK, kObjectStartOffset, and progress_bar().

+ Here is the call graph for this function:

◆ LiveBytes()

int v8::internal::MemoryChunk::LiveBytes ( )
inline

Definition at line 480 of file spaces.h.

480  {
481  DCHECK(static_cast<unsigned>(live_byte_count_) <= size_);
482  return live_byte_count_;
483  }

References DCHECK, live_byte_count_, and size_.

Referenced by v8::internal::MarkCompactCollector::CollectEvacuationCandidates(), v8::internal::PagedSpace::DecreaseUnsweptFreeBytes(), v8::internal::PagedSpace::FreeEmergencyMemory(), v8::internal::FreeListFragmentation(), v8::internal::PagedSpace::IncreaseUnsweptFreeBytes(), v8::internal::PagedSpace::ReleasePage(), and v8::internal::MarkCompactCollector::SweepSpace().

+ Here is the caller graph for this function:

◆ MarkbitIndexToAddress()

Address v8::internal::MemoryChunk::MarkbitIndexToAddress ( uint32_t  index)
inline

Definition at line 596 of file spaces.h.

596  {
597  return this->address() + (index << kPointerSizeLog2);
598  }

References address(), and v8::internal::kPointerSizeLog2.

+ Here is the call graph for this function:

◆ markbits()

Bitmap* v8::internal::MemoryChunk::markbits ( )
inline

Definition at line 580 of file spaces.h.

580  {
581  return Bitmap::FromAddress(address() + kHeaderSize);
582  }
static const size_t kHeaderSize
Definition: spaces.h:539

References address(), and kHeaderSize.

Referenced by v8::internal::Bitmap::Clear(), v8::internal::MarkCompactCollector::DiscoverAndEvacuateBlackObjectsOnPage(), v8::internal::IsOnInvalidatedCodeObject(), PrintMarkbits(), and v8::internal::SetMarkBitsUnderInvalidatedCode().

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

◆ MarkEvacuationCandidate()

void v8::internal::MemoryChunk::MarkEvacuationCandidate ( )
inline

Definition at line 621 of file spaces.h.

621  {
624  }

References DCHECK, EVACUATION_CANDIDATE, NULL, SetFlag(), and slots_buffer_.

Referenced by v8::internal::MarkCompactCollector::AddEvacuationCandidate().

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

◆ next_chunk()

MemoryChunk* v8::internal::MemoryChunk::next_chunk ( ) const
inline

Definition at line 291 of file spaces.h.

291  {
292  return reinterpret_cast<MemoryChunk*>(base::Acquire_Load(&next_chunk_));
293  }
base::AtomicWord next_chunk_
Definition: spaces.h:686
Atomic32 Acquire_Load(volatile const Atomic32 *ptr)

References v8::base::Acquire_Load(), and next_chunk_.

Referenced by v8::internal::Heap::FreeQueuedChunks(), InsertAfter(), v8::internal::Page::next_page(), v8::internal::LargePage::next_page(), v8::internal::NewSpacePage::next_page(), and Unlink().

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

◆ owner()

Space* v8::internal::MemoryChunk::owner ( ) const
inline

Definition at line 307 of file spaces.h.

307  {
308  if ((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) ==
309  kPageHeaderTag) {
310  return reinterpret_cast<Space*>(reinterpret_cast<intptr_t>(owner_) -
312  } else {
313  return NULL;
314  }
315  }
const intptr_t kPageHeaderTagMask
Definition: globals.h:251
const int kPageHeaderTag
Definition: globals.h:249

References v8::internal::kPageHeaderTag, v8::internal::kPageHeaderTagMask, NULL, and owner_.

Referenced by v8::internal::Heap::AllocateCode(), v8::internal::Heap::AllocateFillerObject(), v8::internal::Heap::AllowedToBeMigrated(), v8::internal::PagedSpace::Contains(), v8::internal::LargeObjectSpace::Contains(), v8::internal::MarkCompactCollector::EvacuateLiveObjectsFromPage(), v8::internal::MarkCompactCollector::EvacuateNewSpaceAndCandidates(), v8::internal::MarkCompactCollector::EvacuatePages(), v8::internal::MemoryAllocator::Free(), v8::internal::Heap::FreeQueuedChunks(), v8::internal::HeapObjectIterator::HeapObjectIterator(), IncrementLiveBytesFromMutator(), Initialize(), v8::internal::Page::Initialize(), v8::internal::Page::InitializeAsAnchor(), v8::internal::MarkCompactCollector::INLINE(), v8::internal::IsOnInvalidatedCodeObject(), v8::internal::StoreBuffer::IteratePointersToNewSpace(), v8::internal::MarkCompactCollector::MoveEvacuationCandidatesToEndOfPagesList(), v8::internal::NewSpacePage::NewSpacePage(), v8::internal::Page::next_page(), v8::internal::Page::prev_page(), v8::internal::MarkCompactCollector::ReleaseEvacuationCandidates(), v8::internal::NewSpacePage::semi_space(), v8::internal::Page::set_next_page(), v8::internal::Page::set_prev_page(), v8::internal::IncrementalMarking::SetOldSpacePageFlags(), v8::internal::Heap::UpdateAllocationsHash(), and v8::internal::IncrementalMarkingMarkingVisitor::VisitFixedArrayIncremental().

+ Here is the caller graph for this function:

◆ parallel_sweeping()

ParallelSweepingState v8::internal::MemoryChunk::parallel_sweeping ( )
inline

Definition at line 445 of file spaces.h.

445  {
446  return static_cast<ParallelSweepingState>(
448  }
base::AtomicWord parallel_sweeping_
Definition: spaces.h:671

References v8::base::Acquire_Load(), and parallel_sweeping_.

Referenced by v8::internal::MarkCompactCollector::EvacuatePages(), v8::internal::MarkCompactCollector::ParallelSweepSpaceComplete(), SweepingCompleted(), and v8::internal::MarkCompactCollector::SweepSpace().

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

◆ prev_chunk()

MemoryChunk* v8::internal::MemoryChunk::prev_chunk ( ) const
inline

Definition at line 295 of file spaces.h.

295  {
296  return reinterpret_cast<MemoryChunk*>(base::Acquire_Load(&prev_chunk_));
297  }
base::AtomicWord prev_chunk_
Definition: spaces.h:688

References v8::base::Acquire_Load(), and prev_chunk_.

Referenced by v8::internal::Page::prev_page(), v8::internal::NewSpacePage::prev_page(), and Unlink().

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

◆ PrintMarkbits()

void v8::internal::MemoryChunk::PrintMarkbits ( )
inline

Definition at line 584 of file spaces.h.

584 { markbits()->Print(); }

References markbits(), and v8::internal::Bitmap::Print().

+ Here is the call graph for this function:

◆ progress_bar()

int v8::internal::MemoryChunk::progress_bar ( )
inline

Definition at line 493 of file spaces.h.

493  {
495  return progress_bar_;
496  }

References DCHECK, HAS_PROGRESS_BAR, IsFlagSet(), and progress_bar_.

Referenced by IsLeftOfProgressBar(), set_progress_bar(), and v8::internal::IncrementalMarkingMarkingVisitor::VisitFixedArrayIncremental().

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

◆ reserved_memory()

base::VirtualMemory* v8::internal::MemoryChunk::reserved_memory ( )
inline

Definition at line 324 of file spaces.h.

324 { return &reservation_; }

References reservation_.

Referenced by v8::internal::MemoryAllocator::Free().

+ Here is the caller graph for this function:

◆ ResetLiveBytes()

void v8::internal::MemoryChunk::ResetLiveBytes ( )
inline

Definition at line 464 of file spaces.h.

464  {
465  if (FLAG_gc_verbose) {
466  PrintF("ResetLiveBytes:%p:%x->0\n", static_cast<void*>(this),
468  }
469  live_byte_count_ = 0;
470  }
void PrintF(const char *format,...)
Definition: utils.cc:80

References live_byte_count_, and v8::internal::PrintF().

Referenced by v8::internal::Bitmap::Clear(), v8::internal::MarkCompactCollector::ClearMarkbits(), v8::internal::MarkCompactCollector::EvacuateLiveObjectsFromPage(), v8::internal::SemiSpace::FlipPages(), v8::internal::LargeObjectSpace::FreeUnmarkedObjects(), Initialize(), v8::internal::MarkCompactCollector::ReleaseEvacuationCandidates(), and v8::internal::Sweep().

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

◆ ResetProgressBar()

void v8::internal::MemoryChunk::ResetProgressBar ( )
inline

Definition at line 503 of file spaces.h.

503  {
505  set_progress_bar(0);
507  }
508  }
void set_progress_bar(int progress_bar)
Definition: spaces.h:498

References ClearFlag(), HAS_PROGRESS_BAR, IsFlagSet(), and set_progress_bar().

Referenced by v8::internal::MarkCompactCollector::ClearMarkbits(), and v8::internal::LargeObjectSpace::FreeUnmarkedObjects().

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

◆ scan_on_scavenge()

bool v8::internal::MemoryChunk::scan_on_scavenge ( )
inline

Definition at line 333 of file spaces.h.

333 { return IsFlagSet(SCAN_ON_SCAVENGE); }

References IsFlagSet(), and SCAN_ON_SCAVENGE.

Referenced by v8::internal::StoreBufferRebuilder::Callback(), v8::internal::StoreBuffer::EnsureSpace(), v8::internal::StoreBuffer::IteratePointersToNewSpace(), v8::internal::StoreBuffer::PrepareForIteration(), set_scan_on_scavenge(), and v8::internal::IncrementalMarking::SetOldSpacePageFlags().

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

◆ set_next_chunk()

void v8::internal::MemoryChunk::set_next_chunk ( MemoryChunk next)
inline

Definition at line 299 of file spaces.h.

299  {
300  base::Release_Store(&next_chunk_, reinterpret_cast<base::AtomicWord>(next));
301  }
intptr_t AtomicWord
Definition: atomicops.h:57
void Release_Store(volatile Atomic32 *ptr, Atomic32 value)

References next_chunk_, and v8::base::Release_Store().

Referenced by v8::internal::NewSpacePage::Initialize(), v8::internal::NewSpacePage::InitializeAsAnchor(), InsertAfter(), v8::internal::Heap::QueueMemoryChunkForFree(), v8::internal::LargePage::set_next_page(), v8::internal::NewSpacePage::set_next_page(), v8::internal::Page::set_next_page(), and Unlink().

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

◆ set_owner()

void v8::internal::MemoryChunk::set_owner ( Space space)
inline

Definition at line 317 of file spaces.h.

317  {
318  DCHECK((reinterpret_cast<intptr_t>(space) & kPageHeaderTagMask) == 0);
319  owner_ = reinterpret_cast<Address>(space) + kPageHeaderTag;
320  DCHECK((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) ==
322  }
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi space(in MBytes)

References DCHECK, v8::internal::kPageHeaderTag, v8::internal::kPageHeaderTagMask, owner_, and space().

Referenced by v8::internal::SemiSpace::FlipPages(), v8::internal::Heap::FreeQueuedChunks(), Initialize(), v8::internal::Page::InitializeAsAnchor(), and v8::internal::NewSpacePage::InitializeAsAnchor().

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

◆ set_parallel_sweeping()

void v8::internal::MemoryChunk::set_parallel_sweeping ( ParallelSweepingState  state)
inline

Definition at line 450 of file spaces.h.

450  {
452  }

References parallel_sweeping_, and v8::base::Release_Store().

Referenced by Initialize(), v8::internal::MarkCompactCollector::ParallelSweepSpaceComplete(), v8::internal::Sweep(), and v8::internal::MarkCompactCollector::SweepSpace().

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

◆ set_prev_chunk()

void v8::internal::MemoryChunk::set_prev_chunk ( MemoryChunk prev)
inline

Definition at line 303 of file spaces.h.

303  {
304  base::Release_Store(&prev_chunk_, reinterpret_cast<base::AtomicWord>(prev));
305  }

References prev_chunk_, and v8::base::Release_Store().

Referenced by v8::internal::NewSpacePage::Initialize(), v8::internal::NewSpacePage::InitializeAsAnchor(), InsertAfter(), v8::internal::NewSpacePage::set_prev_page(), v8::internal::Page::set_prev_page(), and Unlink().

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

◆ set_progress_bar()

void v8::internal::MemoryChunk::set_progress_bar ( int  progress_bar)
inline

Definition at line 498 of file spaces.h.

498  {
501  }

References DCHECK, HAS_PROGRESS_BAR, IsFlagSet(), progress_bar(), and progress_bar_.

Referenced by v8::internal::IncrementalMarking::RecordWrites(), ResetProgressBar(), and v8::internal::IncrementalMarkingMarkingVisitor::VisitFixedArrayIncremental().

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

◆ set_reserved_memory()

void v8::internal::MemoryChunk::set_reserved_memory ( base::VirtualMemory reservation)
inline

Definition at line 328 of file spaces.h.

328  {
329  DCHECK_NOT_NULL(reservation);
330  reservation_.TakeControl(reservation);
331  }
void TakeControl(VirtualMemory *from)
Definition: platform.h:377
#define DCHECK_NOT_NULL(p)
Definition: logging.h:213

References DCHECK_NOT_NULL, reservation_, and v8::base::VirtualMemory::TakeControl().

Referenced by v8::internal::MemoryAllocator::AllocateChunk().

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

◆ set_scan_on_scavenge()

void v8::internal::MemoryChunk::set_scan_on_scavenge ( bool  scan)
inline

Definition at line 157 of file spaces-inl.h.

157  {
158  if (scan) {
161  } else {
164  }
166 }
void increment_scan_on_scavenge_pages()
Definition: heap.h:739
IncrementalMarking * incremental_marking()
Definition: heap.h:1205
void decrement_scan_on_scavenge_pages()
Definition: heap.h:746
void SetOldSpacePageFlags(MemoryChunk *chunk)

References ClearFlag(), v8::internal::Heap::decrement_scan_on_scavenge_pages(), heap_, v8::internal::Heap::increment_scan_on_scavenge_pages(), v8::internal::Heap::incremental_marking(), scan_on_scavenge(), SCAN_ON_SCAVENGE, SetFlag(), and v8::internal::IncrementalMarking::SetOldSpacePageFlags().

Referenced by v8::internal::StoreBufferRebuilder::Callback(), v8::internal::StoreBuffer::ExemptPopularPages(), v8::internal::StoreBuffer::IteratePointersToNewSpace(), and v8::internal::MarkCompactCollector::ReleaseEvacuationCandidates().

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

◆ set_size()

void v8::internal::MemoryChunk::set_size ( size_t  size)
inline

Definition at line 556 of file spaces.h.

556 { size_ = size; }

References size(), and size_.

Referenced by v8::internal::Heap::FreeQueuedChunks().

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

◆ set_skip_list()

void v8::internal::MemoryChunk::set_skip_list ( SkipList skip_list)
inline

Definition at line 615 of file spaces.h.

615 { skip_list_ = skip_list; }
SkipList * skip_list()
Definition: spaces.h:613
SkipList * skip_list_
Definition: spaces.h:662

References skip_list(), and skip_list_.

Referenced by v8::internal::SkipList::Update().

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

◆ set_store_buffer_counter()

void v8::internal::MemoryChunk::set_store_buffer_counter ( int  counter)
inline

Definition at line 344 of file spaces.h.

344  {
345  store_buffer_counter_ = counter;
346  }

References store_buffer_counter_.

Referenced by v8::internal::StoreBuffer::ExemptPopularPages().

+ Here is the caller graph for this function:

◆ set_write_barrier_counter()

void v8::internal::MemoryChunk::set_write_barrier_counter ( int  counter)
inline

Definition at line 489 of file spaces.h.

489  {
490  write_barrier_counter_ = counter;
491  }
intptr_t write_barrier_counter_
Definition: spaces.h:663

References write_barrier_counter_.

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

+ Here is the caller graph for this function:

◆ SetArea()

void v8::internal::MemoryChunk::SetArea ( Address  area_start,
Address  area_end 
)
inline

Definition at line 558 of file spaces.h.

558  {
561  }

References area_end(), area_end_, area_start(), and area_start_.

Referenced by v8::internal::Heap::FreeQueuedChunks().

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

◆ SetFlag()

◆ SetFlags()

void v8::internal::MemoryChunk::SetFlags ( intptr_t  flags,
intptr_t  mask 
)
inline

Definition at line 424 of file spaces.h.

424  {
425  flags_ = (flags_ & ~mask) | (flags & mask);
426  }

References v8::internal::anonymous_namespace{flags.cc}::flags, and flags_.

Referenced by v8::internal::SemiSpace::FlipPages(), v8::internal::SemiSpace::GrowTo(), and v8::internal::NewSpacePage::InitializeAsAnchor().

+ Here is the caller graph for this function:

◆ SetFlagTo()

void v8::internal::MemoryChunk::SetFlagTo ( int  flag,
bool  value 
)
inline

Definition at line 409 of file spaces.h.

409  {
410  if (value) {
411  SetFlag(flag);
412  } else {
413  ClearFlag(flag);
414  }
415  }

References ClearFlag(), v8::internal::flag, and SetFlag().

+ Here is the call graph for this function:

◆ ShouldSkipEvacuationSlotRecording()

bool v8::internal::MemoryChunk::ShouldSkipEvacuationSlotRecording ( )
inline

Definition at line 609 of file spaces.h.

609  {
611  }
static const int kSkipEvacuationSlotsRecordingMask
Definition: spaces.h:400

References flags_, and kSkipEvacuationSlotsRecordingMask.

Referenced by v8::internal::MarkCompactCollector::INLINE().

+ Here is the caller graph for this function:

◆ size()

size_t v8::internal::MemoryChunk::size ( ) const
inline

Definition at line 554 of file spaces.h.

554 { return size_; }

References size_.

Referenced by v8::internal::LargeObjectSpace::AllocateRaw(), CommitArea(), v8::internal::MemoryAllocator::Free(), v8::internal::Heap::FreeQueuedChunks(), v8::internal::LargeObjectSpace::FreeUnmarkedObjects(), Initialize(), set_size(), v8::internal::IncrementalMarking::SetOldSpacePageFlags(), and v8::internal::LargeObjectSpace::TearDown().

+ Here is the caller graph for this function:

◆ skip_list()

SkipList* v8::internal::MemoryChunk::skip_list ( )
inline

Definition at line 613 of file spaces.h.

613 { return skip_list_; }

References skip_list_.

Referenced by v8::internal::MarkCompactCollector::EvacuateNewSpaceAndCandidates(), v8::internal::MemoryAllocator::Free(), v8::internal::InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), set_skip_list(), v8::internal::Sweep(), and v8::internal::SkipList::Update().

+ Here is the caller graph for this function:

◆ slots_buffer()

SlotsBuffer* v8::internal::MemoryChunk::slots_buffer ( )
inline

Definition at line 617 of file spaces.h.

617 { return slots_buffer_; }

References slots_buffer_.

Referenced by v8::internal::MarkCompactCollector::EvacuateNewSpaceAndCandidates(), and v8::internal::MemoryAllocator::Free().

+ Here is the caller graph for this function:

◆ slots_buffer_address()

SlotsBuffer** v8::internal::MemoryChunk::slots_buffer_address ( )
inline

Definition at line 619 of file spaces.h.

619 { return &slots_buffer_; }

References slots_buffer_.

Referenced by v8::internal::MarkCompactCollector::AbortCompaction(), v8::internal::MarkCompactCollector::EvacuatePages(), v8::internal::MarkCompactCollector::RecordCodeEntrySlot(), v8::internal::MarkCompactCollector::RecordRelocSlot(), and v8::internal::MarkCompactCollector::ReleaseEvacuationCandidates().

+ Here is the caller graph for this function:

◆ store_buffer_counter()

int v8::internal::MemoryChunk::store_buffer_counter ( )
inline

Definition at line 343 of file spaces.h.

343 { return store_buffer_counter_; }

References store_buffer_counter_.

Referenced by v8::internal::StoreBuffer::ExemptPopularPages().

+ Here is the caller graph for this function:

◆ SweepingCompleted()

bool v8::internal::MemoryChunk::SweepingCompleted ( )
inline

Definition at line 460 of file spaces.h.

460 { return parallel_sweeping() <= SWEEPING_FINALIZE; }
ParallelSweepingState parallel_sweeping()
Definition: spaces.h:445

References parallel_sweeping(), and SWEEPING_FINALIZE.

Referenced by v8::internal::HeapObjectIterator::AdvanceToNextPage(), v8::internal::Heap::CanMoveObjectStart(), v8::internal::HeapObjectIterator::HeapObjectIterator(), and v8::internal::StoreBuffer::IteratePointersToNewSpace().

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

◆ TryParallelSweeping()

bool v8::internal::MemoryChunk::TryParallelSweeping ( )
inline

Definition at line 454 of file spaces.h.

454  {
458  }
Atomic32 Acquire_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)

References v8::base::Acquire_CompareAndSwap(), parallel_sweeping_, SWEEPING_IN_PROGRESS, and SWEEPING_PENDING.

Referenced by v8::internal::MarkCompactCollector::SweepInParallel().

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

◆ Unlink()

void v8::internal::MemoryChunk::Unlink ( )

Definition at line 538 of file spaces.cc.

538  {
539  MemoryChunk* next_element = next_chunk();
540  MemoryChunk* prev_element = prev_chunk();
541  next_element->set_prev_chunk(prev_element);
542  prev_element->set_next_chunk(next_element);
545 }
MemoryChunk * prev_chunk() const
Definition: spaces.h:295
MemoryChunk * next_chunk() const
Definition: spaces.h:291

References next_chunk(), NULL, prev_chunk(), set_next_chunk(), and set_prev_chunk().

Referenced by v8::internal::MarkCompactCollector::MoveEvacuationCandidatesToEndOfPagesList(), and v8::internal::PagedSpace::ReleasePage().

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

◆ UpdateHighWaterMark()

void v8::internal::MemoryChunk::UpdateHighWaterMark ( Address  mark)
inlinestatic

Definition at line 189 of file spaces-inl.h.

189  {
190  if (mark == NULL) return;
191  // Need to subtract one from the mark because when a chunk is full the
192  // top points to the next address after the chunk, which effectively belongs
193  // to another chunk. See the comment to Page::FromAllocationTop.
194  MemoryChunk* chunk = MemoryChunk::FromAddress(mark - 1);
195  int new_mark = static_cast<int>(mark - chunk->address());
196  if (new_mark > chunk->high_water_mark_) {
197  chunk->high_water_mark_ = new_mark;
198  }
199 }

References address(), FromAddress(), high_water_mark_, and NULL.

Referenced by v8::internal::PagedSpace::CommittedPhysicalMemory(), v8::internal::NewSpace::CommittedPhysicalMemory(), v8::internal::PagedSpace::SetTopAndLimit(), and v8::internal::NewSpace::UpdateAllocationInfo().

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

◆ write_barrier_counter()

int v8::internal::MemoryChunk::write_barrier_counter ( )
inline

Definition at line 485 of file spaces.h.

485  {
486  return static_cast<int>(write_barrier_counter_);
487  }

References write_barrier_counter_.

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

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ MemoryAllocator

friend class MemoryAllocator
friend

Definition at line 690 of file spaces.h.

Member Data Documentation

◆ area_end_

Address v8::internal::MemoryChunk::area_end_
protected

Definition at line 647 of file spaces.h.

Referenced by area_end(), CommitArea(), Initialize(), and SetArea().

◆ area_start_

Address v8::internal::MemoryChunk::area_start_
protected

Definition at line 646 of file spaces.h.

Referenced by area_start(), CommitArea(), Initialize(), and SetArea().

◆ available_in_huge_free_list_

intptr_t v8::internal::MemoryChunk::available_in_huge_free_list_
protected

Definition at line 677 of file spaces.h.

Referenced by Initialize(), and v8::internal::Page::ResetFreeListStatistics().

◆ available_in_large_free_list_

intptr_t v8::internal::MemoryChunk::available_in_large_free_list_
protected

Definition at line 676 of file spaces.h.

Referenced by Initialize(), and v8::internal::Page::ResetFreeListStatistics().

◆ available_in_medium_free_list_

intptr_t v8::internal::MemoryChunk::available_in_medium_free_list_
protected

Definition at line 675 of file spaces.h.

Referenced by Initialize(), and v8::internal::Page::ResetFreeListStatistics().

◆ available_in_small_free_list_

intptr_t v8::internal::MemoryChunk::available_in_small_free_list_
protected

Definition at line 674 of file spaces.h.

Referenced by Initialize(), and v8::internal::Page::ResetFreeListStatistics().

◆ flags_

intptr_t v8::internal::MemoryChunk::flags_
protected

◆ heap_

Heap* v8::internal::MemoryChunk::heap_
protected

Definition at line 655 of file spaces.h.

Referenced by CommitArea(), heap(), Initialize(), and set_scan_on_scavenge().

◆ high_water_mark_

int v8::internal::MemoryChunk::high_water_mark_
protected

Definition at line 669 of file spaces.h.

Referenced by CommittedPhysicalMemory(), Initialize(), and UpdateHighWaterMark().

◆ kAlignment

◆ kAlignmentMask

const intptr_t v8::internal::MemoryChunk::kAlignmentMask = kAlignment - 1
static

◆ kBodyOffset

const int v8::internal::MemoryChunk::kBodyOffset
static
Initial value:
=
static const size_t kSize
Definition: spaces.h:154
#define CODE_POINTER_ALIGN(value)
Definition: globals.h:586

Definition at line 543 of file spaces.h.

Referenced by v8::internal::PromotionQueue::Initialize().

◆ kEvacuationCandidateMask

const int v8::internal::MemoryChunk::kEvacuationCandidateMask = 1 << EVACUATION_CANDIDATE
static

Definition at line 398 of file spaces.h.

◆ kFlagsOffset

const int v8::internal::MemoryChunk::kFlagsOffset = kPointerSize
static

Definition at line 605 of file spaces.h.

Referenced by Initialize().

◆ kHeaderSize

const size_t v8::internal::MemoryChunk::kHeaderSize
static
Initial value:

Definition at line 539 of file spaces.h.

Referenced by markbits().

◆ kLiveBytesOffset

const intptr_t v8::internal::MemoryChunk::kLiveBytesOffset
static
Initial value:

Definition at line 530 of file spaces.h.

Referenced by Initialize().

◆ kObjectStartAlignment

const int v8::internal::MemoryChunk::kObjectStartAlignment = 32 * kPointerSize
static

Definition at line 549 of file spaces.h.

◆ kObjectStartOffset

◆ kPointersFromHereAreInterestingMask

const int v8::internal::MemoryChunk::kPointersFromHereAreInterestingMask
static
Initial value:

Definition at line 395 of file spaces.h.

◆ kPointersToHereAreInterestingMask

const int v8::internal::MemoryChunk::kPointersToHereAreInterestingMask
static
Initial value:

Definition at line 392 of file spaces.h.

◆ kSizeOffset

const intptr_t v8::internal::MemoryChunk::kSizeOffset = 0
static

Definition at line 528 of file spaces.h.

◆ kSkipEvacuationSlotsRecordingMask

const int v8::internal::MemoryChunk::kSkipEvacuationSlotsRecordingMask
static
Initial value:

Definition at line 400 of file spaces.h.

Referenced by ShouldSkipEvacuationSlotRecording().

◆ kSlotsBufferOffset

const size_t v8::internal::MemoryChunk::kSlotsBufferOffset = kLiveBytesOffset + kIntSize
static

Definition at line 534 of file spaces.h.

◆ kWriteBarrierCounterGranularity

const int v8::internal::MemoryChunk::kWriteBarrierCounterGranularity = 500
static

Definition at line 362 of file spaces.h.

Referenced by Initialize(), and v8::internal::IncrementalMarking::RecordWriteFromCode().

◆ kWriteBarrierCounterOffset

const size_t v8::internal::MemoryChunk::kWriteBarrierCounterOffset
static
Initial value:

Definition at line 536 of file spaces.h.

◆ live_byte_count_

int v8::internal::MemoryChunk::live_byte_count_
protected

Definition at line 660 of file spaces.h.

Referenced by IncrementLiveBytes(), Initialize(), LiveBytes(), and ResetLiveBytes().

◆ next_chunk_

base::AtomicWord v8::internal::MemoryChunk::next_chunk_
private

Definition at line 686 of file spaces.h.

Referenced by next_chunk(), and set_next_chunk().

◆ non_available_small_blocks_

intptr_t v8::internal::MemoryChunk::non_available_small_blocks_
protected

Definition at line 678 of file spaces.h.

Referenced by Initialize(), and v8::internal::Page::ResetFreeListStatistics().

◆ owner_

Address v8::internal::MemoryChunk::owner_
protected

Definition at line 654 of file spaces.h.

Referenced by owner(), and set_owner().

◆ parallel_sweeping_

base::AtomicWord v8::internal::MemoryChunk::parallel_sweeping_
protected

Definition at line 671 of file spaces.h.

Referenced by parallel_sweeping(), set_parallel_sweeping(), and TryParallelSweeping().

◆ prev_chunk_

base::AtomicWord v8::internal::MemoryChunk::prev_chunk_
private

Definition at line 688 of file spaces.h.

Referenced by prev_chunk(), and set_prev_chunk().

◆ progress_bar_

int v8::internal::MemoryChunk::progress_bar_
protected

Definition at line 666 of file spaces.h.

Referenced by Initialize(), progress_bar(), and set_progress_bar().

◆ reservation_

base::VirtualMemory v8::internal::MemoryChunk::reservation_
protected

◆ size_

size_t v8::internal::MemoryChunk::size_
protected

Definition at line 642 of file spaces.h.

Referenced by IncrementLiveBytes(), Initialize(), LiveBytes(), set_size(), and size().

◆ skip_list_

SkipList* v8::internal::MemoryChunk::skip_list_
protected

Definition at line 662 of file spaces.h.

Referenced by Initialize(), set_skip_list(), and skip_list().

◆ slots_buffer_

SlotsBuffer* v8::internal::MemoryChunk::slots_buffer_
protected

◆ store_buffer_counter_

int v8::internal::MemoryChunk::store_buffer_counter_
protected

Definition at line 658 of file spaces.h.

Referenced by set_store_buffer_counter(), and store_buffer_counter().

◆ write_barrier_counter_

intptr_t v8::internal::MemoryChunk::write_barrier_counter_
protected

Definition at line 663 of file spaces.h.

Referenced by Initialize(), set_write_barrier_counter(), and write_barrier_counter().


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