v8
3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
|
#include <incremental-marking.h>
Public Types | |
enum | State { STOPPED, SWEEPING, MARKING, COMPLETE } |
enum | CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD } |
enum | CompactionFlag { ALLOW_COMPACTION, PREVENT_COMPACTION } |
Static Public Member Functions | |
static void | Initialize () |
static void | RecordWriteFromCode (HeapObject *obj, Object **slot, Isolate *isolate) |
Static Public Attributes | |
static const intptr_t | kAllocatedThreshold = 65536 |
static const intptr_t | kWriteBarriersInvokedThreshold = 32768 |
static const intptr_t | kInitialMarkingSpeed = 1 |
static const intptr_t | kFastMarking = 3 |
static const intptr_t | kMarkingSpeedAccellerationInterval = 1024 |
static const intptr_t | kMarkingSpeedAccelleration = 2 |
static const intptr_t | kMaxMarkingSpeed = 1000 |
Definition at line 40 of file incremental-marking.h.
enum CompactionFlag |
Enumerator | |
---|---|
ALLOW_COMPACTION | |
PREVENT_COMPACTION |
Definition at line 78 of file incremental-marking.h.
enum CompletionAction |
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.
|
explicit |
Definition at line 42 of file incremental-marking.cc.
void Abort | ( | ) |
Definition at line 800 of file incremental-marking.cc.
References MemoryChunk::ClearFlag(), StackGuard::Continue(), MemoryChunk::FromAddress(), v8::internal::GC_REQUEST, MemoryChunk::IsFlagSet(), Heap::isolate(), IncrementalMarking::IsStopped(), Heap::lo_space(), NewSpace::LowerInlineAllocationLimit(), Heap::new_space(), v8::internal::NULL, v8::internal::PrintF(), MemoryChunk::RESCAN_ON_EVACUATION, IncrementalMarking::set_should_hurry(), Isolate::stack_guard(), IncrementalMarking::STOPPED, and RecordWriteStub::STORE_BUFFER_ONLY.
Referenced by MarkCompactCollector::Prepare(), and TEST().
void ActivateGeneratedStub | ( | Code * | stub | ) |
Definition at line 491 of file incremental-marking.cc.
References ASSERT, RecordWriteStub::GetMode(), RecordWriteStub::INCREMENTAL, RecordWriteStub::INCREMENTAL_COMPACTION, IncrementalMarking::IsCompacting(), RecordWriteStub::Patch(), and RecordWriteStub::STORE_BUFFER_ONLY.
|
inline |
Definition at line 108 of file incremental-marking-inl.h.
References HeapObject::address(), ASSERT, MemoryChunk::IncrementLiveBytesFromGC(), IncrementalMarking::kMaxMarkingSpeed, v8::internal::kPointerSize, v8::internal::PrintPID(), Heap::PromotedSpaceSizeOfObjects(), and HeapObject::Size().
Referenced by IncrementalMarking::RecordWriteIntoCodeSlow(), and IncrementalMarking::RecordWrites().
|
inline |
Definition at line 209 of file incremental-marking.h.
Referenced by DescriptorArray::WhitenessWitness::WhitenessWitness().
void Finalize | ( | ) |
Definition at line 829 of file incremental-marking.cc.
References ASSERT, StackGuard::Continue(), v8::internal::GC_REQUEST, IncrementalMarking::Hurry(), MarkingDeque::IsEmpty(), Heap::isolate(), NewSpace::LowerInlineAllocationLimit(), Heap::new_space(), IncrementalMarking::set_should_hurry(), Isolate::stack_guard(), IncrementalMarking::STOPPED, and RecordWriteStub::STORE_BUFFER_ONLY.
void Hurry | ( | ) |
Definition at line 751 of file incremental-marking.cc.
References Heap::AddMarkingTime(), HeapObject::address(), Context::cast(), HeapObject::cast(), IncrementalMarking::COMPLETE, FixedArray::get(), MemoryChunk::IncrementLiveBytesFromGC(), PolymorphicCodeCache::kSize, IncrementalMarking::MARKING, Heap::native_contexts_list(), Context::NEXT_CONTEXT_LINK, Context::NORMALIZED_MAP_CACHE_INDEX, v8::internal::PrintF(), HeapObject::Size(), IncrementalMarking::state(), and OS::TimeCurrentMillis().
Referenced by IncrementalMarking::Finalize().
|
static |
Definition at line 357 of file incremental-marking.cc.
References IncrementalMarkingMarkingVisitor::Initialize().
Referenced by MarkCompactCollector::Initialize().
|
inline |
Definition at line 70 of file incremental-marking.h.
References IncrementalMarking::MARKING, and IncrementalMarking::state().
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 |
Definition at line 192 of file incremental-marking.h.
Referenced by IncrementalMarking::ActivateGeneratedStub(), MarkCompactCollector::InvalidateCode(), and IncrementalMarking::SetOldSpacePageFlags().
|
inline |
Definition at line 74 of file incremental-marking.h.
References IncrementalMarking::COMPLETE, and IncrementalMarking::state().
Referenced by TEST().
|
inline |
Definition at line 72 of file incremental-marking.h.
References IncrementalMarking::MARKING, and IncrementalMarking::state().
Referenced by FreeList::Allocate().
|
inline |
Definition at line 68 of file incremental-marking.h.
References IncrementalMarking::state(), and IncrementalMarking::STOPPED.
Referenced by IncrementalMarking::Abort(), MarkCompactCollector::CollectGarbage(), IncrementalMarking::OldSpaceStep(), and TEST().
|
inline |
Definition at line 213 of file incremental-marking.h.
|
inline |
Definition at line 170 of file incremental-marking.h.
|
inline |
Definition at line 190 of file incremental-marking.h.
Referenced by IncrementalMarkingMarkingVisitor::VisitFixedArrayIncremental().
void MarkingComplete | ( | CompletionAction | action | ) |
Definition at line 844 of file incremental-marking.cc.
References IncrementalMarking::COMPLETE, IncrementalMarking::GC_VIA_STACK_GUARD, Heap::isolate(), v8::internal::PrintF(), StackGuard::RequestGC(), IncrementalMarking::set_should_hurry(), and Isolate::stack_guard().
Referenced by IncrementalMarking::Step().
|
inline |
Definition at line 219 of file incremental-marking.h.
Referenced by IncrementalMarkingMarkingVisitor::VisitFixedArrayIncremental().
|
inline |
Definition at line 196 of file incremental-marking.h.
References IncrementalMarking::kFastMarking, and v8::internal::PrintPID().
void OldSpaceStep | ( | intptr_t | allocated | ) |
Definition at line 861 of file incremental-marking.cc.
References IncrementalMarking::GC_VIA_STACK_GUARD, IncrementalMarking::IsStopped(), IncrementalMarking::kFastMarking, IncrementalMarking::kInitialMarkingSpeed, Heap::NextGCIsLikelyToBeFull(), IncrementalMarking::PREVENT_COMPACTION, IncrementalMarking::Start(), IncrementalMarking::Step(), and IncrementalMarking::WorthActivating().
Referenced by FreeList::Allocate(), and LargeObjectSpace::AllocateRaw().
void PrepareForScavenge | ( | ) |
Definition at line 636 of file incremental-marking.cc.
References Bitmap::Clear(), NewSpace::FromSpaceEnd(), NewSpace::FromSpaceStart(), and Heap::new_space().
void RecordCodeTargetPatch | ( | Code * | host, |
Address | pc, | ||
HeapObject * | value | ||
) |
Definition at line 101 of file incremental-marking.cc.
void RecordCodeTargetPatch | ( | Address | pc, |
HeapObject * | value | ||
) |
Definition at line 111 of file incremental-marking.cc.
References Isolate::inner_pointer_to_code_cache(), and Heap::isolate().
|
static |
Definition at line 81 of file incremental-marking.cc.
References HeapObject::address(), ASSERT, MemoryChunk::FromAddress(), Isolate::heap(), Heap::incremental_marking(), MemoryChunk::kWriteBarrierCounterGranularity, MemoryChunk::set_write_barrier_counter(), and MemoryChunk::write_barrier_counter().
void RecordWriteIntoCodeSlow | ( | HeapObject * | obj, |
RelocInfo * | rinfo, | ||
Object * | value | ||
) |
Definition at line 132 of file incremental-marking.cc.
References IncrementalMarking::BlackToGreyAndUnshift(), HeapObject::cast(), Code::cast(), Heap::mark_compact_collector(), MarkCompactCollector::RecordRelocSlot(), and IncrementalMarking::RestartIfNotMarking().
void RecordWriteOfCodeEntrySlow | ( | JSFunction * | host, |
Object ** | slot, | ||
Code * | value | ||
) |
Definition at line 121 of file incremental-marking.cc.
References ASSERT, Heap::mark_compact_collector(), and v8::internal::NULL.
|
inline |
Definition at line 93 of file incremental-marking-inl.h.
References HeapObject::address(), IncrementalMarking::BlackToGreyAndUnshift(), MemoryChunk::FromAddress(), MemoryChunk::HAS_PROGRESS_BAR, MemoryChunk::IsFlagSet(), IncrementalMarking::RestartIfNotMarking(), and MemoryChunk::set_progress_bar().
Referenced by Map::DeprecateTarget(), CodeFlusher::EvictCandidate(), CodeFlusher::EvictOptimizedCodeMap(), Heap::MoveElements(), and Map::ShareDescriptor().
void RecordWriteSlow | ( | HeapObject * | obj, |
Object ** | slot, | ||
Object * | value | ||
) |
Definition at line 67 of file incremental-marking.cc.
References Heap::mark_compact_collector(), v8::internal::NULL, and HeapObject::RawField().
|
inline |
Definition at line 119 of file incremental-marking.h.
References IncrementalMarking::COMPLETE, IncrementalMarking::MARKING, and v8::internal::PrintF().
Referenced by IncrementalMarking::RecordWriteIntoCodeSlow(), IncrementalMarking::RecordWrites(), and Marking::TransferMark().
|
inline |
Definition at line 66 of file incremental-marking.h.
Referenced by IncrementalMarking::Abort(), IncrementalMarking::Finalize(), IncrementalMarking::MarkingComplete(), and TEST().
|
inline |
Definition at line 186 of file incremental-marking.h.
|
inline |
Definition at line 182 of file incremental-marking.h.
References IncrementalMarking::IsCompacting().
Referenced by Page::Initialize(), and MemoryChunk::set_scan_on_scavenge().
|
inline |
Definition at line 65 of file incremental-marking.h.
void Start | ( | CompactionFlag | flag = ALLOW_COMPACTION | ) |
Definition at line 555 of file incremental-marking.cc.
References ASSERT, Serializer::enabled(), Heap::gc_state(), Isolate::IsInitialized(), Heap::isolate(), Heap::IsSweepingComplete(), IncrementalMarking::kAllocatedThreshold, NewSpace::LowerInlineAllocationLimit(), Heap::new_space(), Heap::NOT_IN_GC, v8::internal::PrintF(), IncrementalMarking::STOPPED, and IncrementalMarking::SWEEPING.
Referenced by Heap::IdleNotification(), IncrementalMarking::OldSpaceStep(), and TEST().
|
inline |
Definition at line 60 of file incremental-marking.h.
References ASSERT, and IncrementalMarking::STOPPED.
Referenced by IncrementalMarking::Hurry(), IncrementalMarking::INLINE(), IncrementalMarking::IsComplete(), IncrementalMarking::IsMarkingIncomplete(), and IncrementalMarking::IsStopped().
void Step | ( | intptr_t | allocated, |
CompletionAction | action | ||
) |
Definition at line 872 of file incremental-marking.cc.
References Heap::AddMarkingTime(), Heap::EnsureSweepersProgressed(), Heap::gc_state(), MarkingDeque::IsEmpty(), IncrementalMarking::kAllocatedThreshold, IncrementalMarking::kMarkingSpeedAccelleration, IncrementalMarking::kMarkingSpeedAccellerationInterval, IncrementalMarking::kMaxMarkingSpeed, IncrementalMarking::kWriteBarriersInvokedThreshold, IncrementalMarking::MARKING, IncrementalMarking::MarkingComplete(), v8::internal::Max(), Heap::MaxSemiSpaceSize(), v8::internal::MB, v8::internal::Min(), Heap::NOT_IN_GC, IncrementalMarking::PREVENT_COMPACTION, v8::internal::PrintPID(), Heap::PromotedTotalSize(), IncrementalMarking::SWEEPING, and OS::TimeCurrentMillis().
Referenced by IncrementalMarking::OldSpaceStep(), and TEST().
|
inline |
Definition at line 162 of file incremental-marking.h.
|
inline |
Definition at line 174 of file incremental-marking.h.
|
inline |
Definition at line 166 of file incremental-marking.h.
|
inline |
Definition at line 178 of file incremental-marking.h.
void Stop | ( | ) |
void TearDown | ( | ) |
Definition at line 62 of file incremental-marking.cc.
Referenced by Heap::TearDown().
void UncommitMarkingDeque | ( | ) |
Definition at line 544 of file incremental-marking.cc.
References VirtualMemory::address(), CHECK, VirtualMemory::size(), IncrementalMarking::STOPPED, and VirtualMemory::Uncommit().
Referenced by Heap::CollectAllAvailableGarbage().
void UpdateMarkingDequeAfterScavenge | ( | ) |
Definition at line 646 of file incremental-marking.cc.
References HeapObject::address(), MarkingDeque::array(), ASSERT, MarkingDeque::bottom(), MemoryChunk::FromAddress(), MemoryChunk::HAS_PROGRESS_BAR, Heap::InNewSpace(), Object::IsFiller(), MemoryChunk::IsFlagSet(), HeapObject::map(), HeapObject::map_word(), MarkingDeque::mask(), obj, MarkingDeque::set_top(), and MarkingDeque::top().
|
inline |
Definition at line 137 of file incremental-marking-inl.h.
Referenced by IncrementalMarkingMarkingVisitor::INLINE(), and Marking::TransferMark().
bool WorthActivating | ( | ) |
Definition at line 471 of file incremental-marking.cc.
References Serializer::enabled(), Heap::gc_state(), Isolate::IsInitialized(), Heap::isolate(), v8::internal::MB, Heap::NOT_IN_GC, and Heap::PromotedSpaceSizeOfObjects().
Referenced by IncrementalMarking::OldSpaceStep().
|
static |
Definition at line 102 of file incremental-marking.h.
Referenced by FreeList::Allocate(), Heap::IdleNotification(), IncrementalMarking::Start(), and IncrementalMarking::Step().
|
static |
Definition at line 108 of file incremental-marking.h.
Referenced by IncrementalMarking::NotifyOfHighPromotionRate(), and IncrementalMarking::OldSpaceStep().
|
static |
Definition at line 105 of file incremental-marking.h.
Referenced by IncrementalMarking::OldSpaceStep().
|
static |
Definition at line 112 of file incremental-marking.h.
Referenced by IncrementalMarking::Step().
|
static |
Definition at line 110 of file incremental-marking.h.
Referenced by IncrementalMarking::Step().
|
static |
Definition at line 113 of file incremental-marking.h.
Referenced by IncrementalMarking::BlackToGreyAndUnshift(), and IncrementalMarking::Step().
|
static |
Definition at line 103 of file incremental-marking.h.
Referenced by IncrementalMarking::Step().