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

#include <mark-compact.h>

Data Structures

class  SweeperTask
 

Public Types

enum  CompactionMode { INCREMENTAL_COMPACTION, NON_INCREMENTAL_COMPACTION }
 
enum  SweeperType {
  CONSERVATIVE, LAZY_CONSERVATIVE, PARALLEL_CONSERVATIVE, CONCURRENT_CONSERVATIVE,
  PRECISE
}
 
enum  SweepingParallelism { SWEEP_SEQUENTIALLY, SWEEP_IN_PARALLEL }
 
typedef MaybeObject *(* AllocationFunction )(Heap *heap, HeapObject *object, int object_size)
 
typedef void(* EncodingFunction )(Heap *heap, HeapObject *old_object, int object_size, Object *new_object, int *offset)
 
typedef void(* ProcessNonLiveFunction )(HeapObject *object, Isolate *isolate)
 
typedef int(MarkCompactCollector::* LiveObjectCallback )(HeapObject *obj)
 

Public Member Functions

void SetFlags (int flags)
 
void SetUp ()
 
void TearDown ()
 
void CollectEvacuationCandidates (PagedSpace *space)
 
void AddEvacuationCandidate (Page *p)
 
void Prepare (GCTracer *tracer)
 
void CollectGarbage ()
 
bool StartCompaction (CompactionMode mode)
 
void AbortCompaction ()
 
GCTracer * tracer ()
 
Heapheap () const
 
Isolateisolate () const
 
CodeFlushercode_flusher ()
 
bool is_code_flushing_enabled () const
 
void EnableCodeFlushing (bool enable)
 
 INLINE (static bool ShouldSkipEvacuationSlotRecording(Object **anchor))
 
 INLINE (static bool ShouldSkipEvacuationSlotRecording(Object *host))
 
 INLINE (static bool IsOnEvacuationCandidate(Object *obj))
 
 INLINE (void EvictEvacuationCandidate(Page *page))
 
void RecordRelocSlot (RelocInfo *rinfo, Object *target)
 
void RecordCodeEntrySlot (Address slot, Code *target)
 
void RecordCodeTargetPatch (Address pc, Code *target)
 
 INLINE (void RecordSlot(Object **anchor_slot, Object **slot, Object *object, SlotsBuffer::AdditionMode mode=SlotsBuffer::FAIL_ON_OVERFLOW))
 
void MigrateObject (HeapObject *dst, HeapObject *src, int size, AllocationSpace to_old_space)
 
bool TryPromoteObject (HeapObject *object, int object_size)
 
Objectencountered_weak_collections ()
 
void set_encountered_weak_collections (Object *weak_collection)
 
void InvalidateCode (Code *code)
 
void ClearMarkbits ()
 
bool abort_incremental_marking () const
 
bool is_compacting () const
 
MarkingParity marking_parity ()
 
void SweepInParallel (PagedSpace *space)
 
void WaitUntilSweepingCompleted ()
 
intptr_t RefillFreeLists (PagedSpace *space)
 
bool AreSweeperThreadsActivated ()
 
bool IsConcurrentSweepingInProgress ()
 
void set_sequential_sweeping (bool sequential_sweeping)
 
bool sequential_sweeping () const
 
void MarkWeakObjectToCodeTable ()
 
void MarkAllocationSite (AllocationSite *site)
 

Static Public Member Functions

static void Initialize ()
 
static void ReportDeleteIfNeeded (HeapObject *obj, Isolate *isolate)
 
static bool IsMarked (Object *obj)
 
template<SweepingParallelism type>
static intptr_t SweepConservatively (PagedSpace *space, FreeList *free_list, Page *p)
 

Static Public Attributes

static const uint32_t kSingleFreeEncoding = 0
 
static const uint32_t kMultiFreeEncoding = 1
 

Friends

class RootMarkingVisitor
 
class MarkingVisitor
 
class MarkCompactMarkingVisitor
 
class CodeMarkingVisitor
 
class SharedFunctionInfoMarkingVisitor
 
class Heap
 

Detailed Description

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

Member Typedef Documentation

typedef MaybeObject*(* AllocationFunction)(Heap *heap, HeapObject *object, int object_size)

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

typedef void(* EncodingFunction)(Heap *heap, HeapObject *old_object, int object_size, Object *new_object, int *offset)

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

typedef int(MarkCompactCollector::* LiveObjectCallback)(HeapObject *obj)

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

typedef void(* ProcessNonLiveFunction)(HeapObject *object, Isolate *isolate)

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

Member Enumeration Documentation

Enumerator
INCREMENTAL_COMPACTION 
NON_INCREMENTAL_COMPACTION 

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

Enumerator
CONSERVATIVE 
LAZY_CONSERVATIVE 
PARALLEL_CONSERVATIVE 
CONCURRENT_CONSERVATIVE 
PRECISE 

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

Enumerator
SWEEP_SEQUENTIALLY 
SWEEP_IN_PARALLEL 

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

Member Function Documentation

bool abort_incremental_marking ( ) const
inline

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

void AddEvacuationCandidate ( Page p)
bool AreSweeperThreadsActivated ( )
void EnableCodeFlushing ( bool  enable)
Object* encountered_weak_collections ( )
inline

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

Referenced by MarkCompactMarkingVisitor::VisitWeakCollection().

void Initialize ( )
static
INLINE ( static bool   ShouldSkipEvacuationSlotRecordingObject **anchor)
inline

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

References MemoryChunk::FromAddress().

INLINE ( static bool   ShouldSkipEvacuationSlotRecordingObject *host)
inline

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

References MemoryChunk::FromAddress().

INLINE ( static bool   IsOnEvacuationCandidateObject *obj)
inline

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

References MemoryChunk::FromAddress().

INLINE ( void   RecordSlotObject **anchor_slot, Object **slot, Object *object, SlotsBuffer::AdditionMode mode=SlotsBuffer::FAIL_ON_OVERFLOW)
void InvalidateCode ( Code code)
bool is_code_flushing_enabled ( ) const
inline

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

References v8::internal::NULL.

bool is_compacting ( ) const
inline
bool IsConcurrentSweepingInProgress ( )
void MarkAllocationSite ( AllocationSite site)

Definition at line 2156 of file mark-compact.cc.

Referenced by MarkCompactWeakObjectRetainer::RetainAs().

MarkingParity marking_parity ( )
inline

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

void MarkWeakObjectToCodeTable ( )
void ReportDeleteIfNeeded ( HeapObject obj,
Isolate isolate 
)
static

Definition at line 4334 of file mark-compact.cc.

References HeapObject::address(), and PROFILE.

Referenced by LargeObjectSpace::FreeUnmarkedObjects().

bool sequential_sweeping ( ) const
inline
void set_encountered_weak_collections ( Object weak_collection)
inline

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

Referenced by MarkCompactMarkingVisitor::VisitWeakCollection().

void set_sequential_sweeping ( bool  sequential_sweeping)
inline

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

References MarkCompactCollector::sequential_sweeping().

void SetUp ( )

Definition at line 355 of file mark-compact.cc.

References Heap::old_data_space(), and Heap::old_pointer_space().

Referenced by Heap::SetUp().

void TearDown ( )

Definition at line 361 of file mark-compact.cc.

References MarkCompactCollector::AbortCompaction().

Referenced by Heap::TearDown().

GCTracer* tracer ( )
inline

Friends And Related Function Documentation

friend class CodeMarkingVisitor
friend

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

friend class Heap
friend

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

friend class MarkCompactMarkingVisitor
friend

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

friend class MarkingVisitor
friend

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

friend class RootMarkingVisitor
friend

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

friend class SharedFunctionInfoMarkingVisitor
friend

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

Field Documentation

const uint32_t kMultiFreeEncoding = 1
static

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

const uint32_t kSingleFreeEncoding = 0
static

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


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