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
MarkCompactCollector Class Reference

#include <mark-compact.h>

Public Types

enum  CompactionMode { INCREMENTAL_COMPACTION, NON_INCREMENTAL_COMPACTION }
 
enum  SweeperType { CONSERVATIVE, LAZY_CONSERVATIVE, PRECISE }
 
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 CollectEvacuationCandidates (PagedSpace *space)
 
void AddEvacuationCandidate (Page *p)
 
void Prepare (GCTracer *tracer)
 
void CollectGarbage ()
 
bool StartCompaction (CompactionMode mode)
 
void AbortCompaction ()
 
GCTracer * tracer ()
 
Heapheap () 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))
 
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))
 
void MigrateObject (Address dst, Address src, int size, AllocationSpace to_old_space)
 
bool TryPromoteObject (HeapObject *object, int object_size)
 
Objectencountered_weak_maps ()
 
void set_encountered_weak_maps (Object *weak_map)
 
void InvalidateCode (Code *code)
 
void ClearMarkbits ()
 
bool is_compacting () const
 

Static Public Member Functions

static void Initialize ()
 
static void ReportDeleteIfNeeded (HeapObject *obj, Isolate *isolate)
 
static bool IsMarked (Object *obj)
 
static intptr_t SweepConservatively (PagedSpace *space, 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 486 of file mark-compact.h.

Member Typedef Documentation

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

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

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

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

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

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

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

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

Member Enumeration Documentation

Enumerator
INCREMENTAL_COMPACTION 
NON_INCREMENTAL_COMPACTION 

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

Enumerator
CONSERVATIVE 
LAZY_CONSERVATIVE 
PRECISE 

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

Member Function Documentation

void AddEvacuationCandidate ( Page p)
void CollectGarbage ( )
void EnableCodeFlushing ( bool  enable)

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

References MarkCompactCollector::heap(), and v8::internal::NULL.

Object* encountered_weak_maps ( )
inline

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

Referenced by MarkCompactMarkingVisitor::VisitJSWeakMap().

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

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

References MemoryChunk::FromAddress().

INLINE ( static bool   ShouldSkipEvacuationSlotRecordingObject *host)
inline

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

References MemoryChunk::FromAddress().

INLINE ( static bool   IsOnEvacuationCandidateObject *obj)
inline

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

References MemoryChunk::FromAddress().

INLINE ( void   RecordSlotObject **anchor_slot, Object **slot, Object *object)
bool is_code_flushing_enabled ( ) const
inline
bool is_compacting ( ) const
inline
bool IsMarked ( Object obj)
inlinestatic
void ReportDeleteIfNeeded ( HeapObject obj,
Isolate isolate 
)
static

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

References HeapObject::address(), and PROFILE.

Referenced by LargeObjectSpace::FreeUnmarkedObjects().

void set_encountered_weak_maps ( Object weak_map)
inline

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

Referenced by MarkCompactMarkingVisitor::VisitJSWeakMap().

GCTracer* tracer ( )
inline

Friends And Related Function Documentation

friend class CodeMarkingVisitor
friend

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

friend class Heap
friend

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

friend class MarkCompactMarkingVisitor
friend

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

friend class MarkingVisitor
friend

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

friend class RootMarkingVisitor
friend

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

friend class SharedFunctionInfoMarkingVisitor
friend

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

Field Documentation

const uint32_t kMultiFreeEncoding = 1
static

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

const uint32_t kSingleFreeEncoding = 0
static

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


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