v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MemoryChunk Class Reference

#include <spaces.h>

Inheritance diagram for MemoryChunk:
Collaboration diagram for 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_PRECISELY,
  WAS_SWEPT_CONSERVATIVELY, NUM_MEMORY_CHUNK_FLAGS
}
 

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)
 
VirtualMemoryreserved_memory ()
 
void InitializeReservedMemory ()
 
void set_reserved_memory (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 ()
 
void ResetLiveBytes ()
 
void IncrementLiveBytes (int by)
 
int LiveBytes ()
 
int write_barrier_counter ()
 
void set_write_barrier_counter (int counter)
 
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 ()
 
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 ()
 

Static Public Member Functions

static MemoryChunkFromAddress (Address a)
 
static MemoryChunkFromAnyPointerAddress (Address addr)
 
static void IncrementLiveBytesFromGC (Address address, int by)
 
static void IncrementLiveBytesFromMutator (Address address, int by)
 
static uint32_t FastAddressToMarkbitIndex (Address addr)
 

Static Public Attributes

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

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

MemoryChunknext_chunk_
 
MemoryChunkprev_chunk_
 
size_t size_
 
intptr_t flags_
 
Address area_start_
 
Address area_end_
 
VirtualMemory reservation_
 
Address owner_
 
Heapheap_
 
int store_buffer_counter_
 
int live_byte_count_
 
SlotsBufferslots_buffer_
 
SkipListskip_list_
 
intptr_t write_barrier_counter_
 

Friends

class MemoryAllocator
 

Detailed Description

Definition at line 300 of file spaces.h.

Member Enumeration Documentation

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_PRECISELY 
WAS_SWEPT_CONSERVATIVELY 
NUM_MEMORY_CHUNK_FLAGS 

Definition at line 380 of file spaces.h.

Member Function Documentation

uint32_t AddressToMarkbitIndex ( Address  addr)
inline
bool ContainsLimit ( Address  addr)
inline

Definition at line 371 of file spaces.h.

References MemoryChunk::area_end(), and MemoryChunk::area_start().

Referenced by Heap::ShouldBePromoted(), and NewSpace::top().

bool ContainsOnlyData ( )
inline

Definition at line 534 of file spaces.h.

References MemoryChunk::CONTAINS_ONLY_DATA, and MemoryChunk::IsFlagSet().

Referenced by Marking::MarkBitFrom().

static uint32_t FastAddressToMarkbitIndex ( Address  addr)
inlinestatic

Definition at line 563 of file spaces.h.

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

intptr_t GetFlags ( )
inline

Definition at line 449 of file spaces.h.

References MemoryChunk::flags_.

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

Heap* heap ( )
inline

Definition at line 577 of file spaces.h.

References MemoryChunk::heap_.

Referenced by HeapObject::GetHeap(), and MemoryChunk::Initialize().

void IncrementLiveBytes ( int  by)
inline
void IncrementLiveBytesFromMutator ( Address  address,
int  by 
)
static
bool InFromSpace ( )
inline

Definition at line 546 of file spaces.h.

References MemoryChunk::IN_FROM_SPACE, and MemoryChunk::IsFlagSet().

void initialize_scan_on_scavenge ( bool  scan)
inline
void InitializeReservedMemory ( )
inline

Definition at line 340 of file spaces.h.

References MemoryChunk::reservation_, and VirtualMemory::Reset().

Referenced by MemoryChunk::Initialize().

void InsertAfter ( MemoryChunk other)
bool InToSpace ( )
inline

Definition at line 542 of file spaces.h.

References MemoryChunk::IN_TO_SPACE, and MemoryChunk::IsFlagSet().

Address MarkbitIndexToAddress ( uint32_t  index)
inline

Definition at line 570 of file spaces.h.

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

void MarkEvacuationCandidate ( )
inline
MemoryChunk* prev_chunk ( ) const
inline

Definition at line 315 of file spaces.h.

References MemoryChunk::prev_chunk_.

Referenced by PagedSpace::AllocateRaw(), Page::prev_page(), and NewSpacePage::prev_page().

void PrintMarkbits ( )
inline

Definition at line 557 of file spaces.h.

References MemoryChunk::markbits(), and Bitmap::Print().

VirtualMemory* reserved_memory ( )
inline

Definition at line 336 of file spaces.h.

References MemoryChunk::reservation_.

Referenced by MemoryAllocator::Free().

void ResetLiveBytes ( )
inline
void set_next_chunk ( MemoryChunk next)
inline
void set_owner ( Space space)
inline
void set_prev_chunk ( MemoryChunk prev)
inline

Definition at line 318 of file spaces.h.

References MemoryChunk::prev_chunk_.

Referenced by Page::set_prev_page(), and NewSpacePage::set_prev_page().

void set_reserved_memory ( VirtualMemory reservation)
inline
void set_size ( size_t  size)
inline

Definition at line 521 of file spaces.h.

References MemoryChunk::size(), and MemoryChunk::size_.

Referenced by Heap::FreeQueuedChunks().

void set_skip_list ( SkipList skip_list)
inline

Definition at line 591 of file spaces.h.

References MemoryChunk::skip_list(), and MemoryChunk::skip_list_.

Referenced by SkipList::Update().

void set_store_buffer_counter ( int  counter)
inline

Definition at line 360 of file spaces.h.

References MemoryChunk::store_buffer_counter_.

void set_write_barrier_counter ( int  counter)
inline
void SetArea ( Address  area_start,
Address  area_end 
)
inline
void SetFlags ( intptr_t  flags,
intptr_t  mask 
)
inline

Definition at line 444 of file spaces.h.

References MemoryChunk::flags_.

Referenced by SemiSpace::GrowTo().

void SetFlagTo ( int  flag,
bool  value 
)
inline

Definition at line 429 of file spaces.h.

References MemoryChunk::ClearFlag(), and MemoryChunk::SetFlag().

bool ShouldSkipEvacuationSlotRecording ( )
inline
SlotsBuffer* slots_buffer ( )
inline

Definition at line 595 of file spaces.h.

References MemoryChunk::slots_buffer_.

Referenced by MemoryAllocator::Free().

int store_buffer_counter ( )
inline

Definition at line 359 of file spaces.h.

References MemoryChunk::store_buffer_counter_.

int write_barrier_counter ( )
inline

Friends And Related Function Documentation

friend class MemoryAllocator
friend

Definition at line 653 of file spaces.h.

Field Documentation

Address area_end_
protected

Definition at line 627 of file spaces.h.

Referenced by MemoryChunk::area_end(), MemoryChunk::Initialize(), and MemoryChunk::SetArea().

Address area_start_
protected
const intptr_t kAlignmentMask = kAlignment - 1
static

Definition at line 493 of file spaces.h.

Referenced by MemoryChunk::FastAddressToMarkbitIndex(), and MemoryChunk::FromAddress().

const int kBodyOffset
static
Initial value:

Definition at line 509 of file spaces.h.

Referenced by PromotionQueue::Initialize().

const int kEvacuationCandidateMask
static
Initial value:

Definition at line 411 of file spaces.h.

const int kFlagsOffset = kPointerSize * 3
static

Definition at line 579 of file spaces.h.

Referenced by MemoryChunk::Initialize().

const size_t kHeaderSize = kWriteBarrierCounterOffset + kPointerSize
static

Definition at line 507 of file spaces.h.

Referenced by MemoryChunk::markbits().

const intptr_t kLiveBytesOffset
static
const int kObjectStartAlignment = 32 * kPointerSize
static

Definition at line 515 of file spaces.h.

const int kPointersFromHereAreInterestingMask
static
Initial value:

Definition at line 408 of file spaces.h.

const int kPointersToHereAreInterestingMask
static
Initial value:

Definition at line 405 of file spaces.h.

const intptr_t kSizeOffset = kPointerSize + kPointerSize
static

Definition at line 495 of file spaces.h.

const int kSkipEvacuationSlotsRecordingMask
static
Initial value:

Definition at line 414 of file spaces.h.

Referenced by MemoryChunk::ShouldSkipEvacuationSlotRecording().

const size_t kSlotsBufferOffset = kLiveBytesOffset + kIntSize
static

Definition at line 502 of file spaces.h.

const int kWriteBarrierCounterGranularity = 500
static
const size_t kWriteBarrierCounterOffset
static
Initial value:

Definition at line 504 of file spaces.h.

int live_byte_count_
protected
Address owner_
protected

Definition at line 634 of file spaces.h.

Referenced by MemoryChunk::owner(), and MemoryChunk::set_owner().

SkipList* skip_list_
protected
int store_buffer_counter_
protected
intptr_t write_barrier_counter_
protected

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