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

#include <incremental-marking.h>

Public Types

enum  State { STOPPED, SWEEPING, MARKING, COMPLETE }
 
enum  CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD }
 

Public Member Functions

 IncrementalMarking (Heap *heap)
 
void TearDown ()
 
State state ()
 
bool should_hurry ()
 
void set_should_hurry (bool val)
 
bool IsStopped ()
 
 INLINE (bool IsMarking())
 
bool IsMarkingIncomplete ()
 
bool IsComplete ()
 
bool WorthActivating ()
 
void Start ()
 
void Stop ()
 
void PrepareForScavenge ()
 
void UpdateMarkingDequeAfterScavenge ()
 
void Hurry ()
 
void Finalize ()
 
void Abort ()
 
void MarkingComplete (CompletionAction action)
 
void OldSpaceStep (intptr_t allocated)
 
void Step (intptr_t allocated, CompletionAction action)
 
void RestartIfNotMarking ()
 
 INLINE (bool BaseRecordWrite(HeapObject *obj, Object **slot, Object *value))
 
 INLINE (void RecordWrite(HeapObject *obj, Object **slot, Object *value))
 
 INLINE (void RecordWriteIntoCode(HeapObject *obj, RelocInfo *rinfo, Object *value))
 
 INLINE (void RecordWriteOfCodeEntry(JSFunction *host, Object **slot, Code *value))
 
void RecordWriteSlow (HeapObject *obj, Object **slot, Object *value)
 
void RecordWriteIntoCodeSlow (HeapObject *obj, RelocInfo *rinfo, Object *value)
 
void RecordWriteOfCodeEntrySlow (JSFunction *host, Object **slot, Code *value)
 
void RecordCodeTargetPatch (Code *host, Address pc, HeapObject *value)
 
void RecordCodeTargetPatch (Address pc, HeapObject *value)
 
void RecordWrites (HeapObject *obj)
 
void BlackToGreyAndUnshift (HeapObject *obj, MarkBit mark_bit)
 
void WhiteToGreyAndPush (HeapObject *obj, MarkBit mark_bit)
 
bool MarkBlackOrKeepGrey (MarkBit mark_bit)
 
 INLINE (bool MarkObjectAndPush(HeapObject *obj))
 
 INLINE (bool MarkObjectWithoutPush(HeapObject *obj))
 
int steps_count ()
 
double steps_took ()
 
double longest_step ()
 
int steps_count_since_last_gc ()
 
double steps_took_since_last_gc ()
 
void SetOldSpacePageFlags (MemoryChunk *chunk)
 
void SetNewSpacePageFlags (NewSpacePage *chunk)
 
MarkingDequemarking_deque ()
 
bool IsCompacting ()
 
void ActivateGeneratedStub (Code *stub)
 
void NotifyOfHighPromotionRate ()
 
void EnterNoMarkingScope ()
 
void LeaveNoMarkingScope ()
 
void UncommitMarkingDeque ()
 

Static Public Member Functions

static void RecordWriteFromCode (HeapObject *obj, Object *value, Isolate *isolate)
 
static void RecordWriteForEvacuationFromCode (HeapObject *obj, Object **slot, Isolate *isolate)
 

Static Public Attributes

static const intptr_t kAllocatedThreshold = 65536
 
static const intptr_t kInitialAllocationMarkingFactor = 1
 
static const intptr_t kFastMarking = 3
 
static const intptr_t kAllocationMarkingFactorSpeedupInterval = 1024
 
static const intptr_t kAllocationMarkingFactorSpeedup = 2
 
static const intptr_t kMaxAllocationMarkingFactor = 1000
 

Detailed Description

Definition at line 40 of file incremental-marking.h.

Member Enumeration Documentation

Enumerator
GC_VIA_STACK_GUARD 
NO_GC_VIA_STACK_GUARD 

Definition at line 49 of file incremental-marking.h.

enum State
Enumerator
STOPPED 
SWEEPING 
MARKING 
COMPLETE 

Definition at line 42 of file incremental-marking.h.

Constructor & Destructor Documentation

IncrementalMarking ( Heap heap)
explicit

Definition at line 40 of file incremental-marking.cc.

Member Function Documentation

void EnterNoMarkingScope ( )
inline
INLINE ( bool   IsMarking())
inline
INLINE ( bool   BaseRecordWriteHeapObject *obj, Object **slot, Object *value)
INLINE ( void   RecordWriteHeapObject *obj, Object **slot, Object *value)
INLINE ( void   RecordWriteIntoCodeHeapObject *obj, RelocInfo *rinfo, Object *value)
INLINE ( void   RecordWriteOfCodeEntryJSFunction *host, Object **slot, Code *value)
INLINE ( bool   MarkObjectAndPushHeapObject *obj)
INLINE ( bool   MarkObjectWithoutPushHeapObject *obj)
bool IsComplete ( )
inline

Definition at line 72 of file incremental-marking.h.

References IncrementalMarking::COMPLETE, and IncrementalMarking::state().

Referenced by TEST().

bool IsMarkingIncomplete ( )
inline
void LeaveNoMarkingScope ( )
inline

Definition at line 230 of file incremental-marking.h.

double longest_step ( )
inline

Definition at line 188 of file incremental-marking.h.

bool MarkBlackOrKeepGrey ( MarkBit  mark_bit)
inline
MarkingDeque* marking_deque ( )
inline

Definition at line 208 of file incremental-marking.h.

void NotifyOfHighPromotionRate ( )
inline
void PrepareForScavenge ( )
void RecordCodeTargetPatch ( Code host,
Address  pc,
HeapObject value 
)
void RecordCodeTargetPatch ( Address  pc,
HeapObject value 
)
void RecordWriteForEvacuationFromCode ( HeapObject obj,
Object **  slot,
Isolate isolate 
)
static

Definition at line 98 of file incremental-marking.cc.

References ASSERT, Isolate::heap(), and Heap::incremental_marking().

void RecordWriteFromCode ( HeapObject obj,
Object value,
Isolate isolate 
)
static
void RecordWriteOfCodeEntrySlow ( JSFunction host,
Object **  slot,
Code value 
)
void RecordWriteSlow ( HeapObject obj,
Object **  slot,
Object value 
)
void set_should_hurry ( bool  val)
inline
void SetNewSpacePageFlags ( NewSpacePage chunk)
inline

Definition at line 204 of file incremental-marking.h.

void SetOldSpacePageFlags ( MemoryChunk chunk)
inline
bool should_hurry ( )
inline

Definition at line 63 of file incremental-marking.h.

void Step ( intptr_t  allocated,
CompletionAction  action 
)

Definition at line 786 of file incremental-marking.cc.

References HeapObject::address(), Heap::AdvanceSweepers(), Context::cast(), Map::cast(), Heap::ClearCacheOnMap(), v8::internal::FIRST_JS_RECEIVER_TYPE, Heap::gc_state(), MemoryChunk::IncrementLiveBytesFromGC(), Map::instance_type(), MarkingDeque::IsEmpty(), Object::IsFiller(), Marking::IsGrey(), Marking::IsWhite(), HeapObject::IterateBody(), v8::internal::JS_FUNCTION_TYPE, IncrementalMarking::kAllocatedThreshold, IncrementalMarking::kAllocationMarkingFactorSpeedup, IncrementalMarking::kAllocationMarkingFactorSpeedupInterval, JSFunction::kCodeEntryOffset, IncrementalMarking::kMaxAllocationMarkingFactor, JSFunction::kNonWeakFieldsEndOffset, Map::kPointerFieldsBeginOffset, Map::kPointerFieldsEndOffset, v8::internal::kPointerSize, JSObject::kPropertiesOffset, v8::internal::LAST_JS_RECEIVER_TYPE, v8::internal::LAST_TYPE, HeapObject::map(), v8::internal::MAP_TYPE, Marking::MarkBitFrom(), Marking::MarkBlack(), IncrementalMarking::MARKING, IncrementalMarking::MarkingComplete(), v8::internal::Max(), Heap::MaxSemiSpaceSize(), v8::internal::MB, v8::internal::Min(), Heap::NOT_IN_GC, MarkingDeque::Pop(), v8::internal::PrintF(), Heap::PromotedTotalSize(), HeapObject::RawField(), HeapObject::SizeFromMap(), SLOW_ASSERT, v8::internal::STATIC_ASSERT(), IncrementalMarking::SWEEPING, OS::TimeCurrentMillis(), IncrementalMarkingMarkingVisitor::VisitCodeEntry(), IncrementalMarkingMarkingVisitor::VisitPointers(), and IncrementalMarking::WhiteToGreyAndPush().

Referenced by Heap::CollectGarbage(), IncrementalMarking::OldSpaceStep(), and TEST().

int steps_count ( )
inline

Definition at line 180 of file incremental-marking.h.

int steps_count_since_last_gc ( )
inline

Definition at line 192 of file incremental-marking.h.

double steps_took ( )
inline

Definition at line 184 of file incremental-marking.h.

double steps_took_since_last_gc ( )
inline

Definition at line 196 of file incremental-marking.h.

void Stop ( )
void TearDown ( )

Definition at line 60 of file incremental-marking.cc.

Referenced by Heap::TearDown().

void WhiteToGreyAndPush ( HeapObject obj,
MarkBit  mark_bit 
)
inline
bool WorthActivating ( )

Field Documentation

const intptr_t kAllocatedThreshold = 65536
static
const intptr_t kAllocationMarkingFactorSpeedup = 2
static

Definition at line 106 of file incremental-marking.h.

Referenced by IncrementalMarking::Step().

const intptr_t kAllocationMarkingFactorSpeedupInterval = 1024
static

Definition at line 104 of file incremental-marking.h.

Referenced by IncrementalMarking::Step().

const intptr_t kFastMarking = 3
static
const intptr_t kInitialAllocationMarkingFactor = 1
static

Definition at line 99 of file incremental-marking.h.

Referenced by IncrementalMarking::OldSpaceStep().

const intptr_t kMaxAllocationMarkingFactor = 1000
static

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