v8
3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
|
#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 () |
Heap * | heap () const |
CodeFlusher * | code_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) |
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) |
Object * | encountered_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 | StaticMarkingVisitor |
class | CodeMarkingVisitor |
class | SharedFunctionInfoMarkingVisitor |
class | Marker< IncrementalMarking > |
class | Marker< MarkCompactCollector > |
class | Heap |
Definition at line 420 of file mark-compact.h.
typedef MaybeObject*(* AllocationFunction)(Heap *heap, HeapObject *object, int object_size) |
Definition at line 427 of file mark-compact.h.
typedef void(* EncodingFunction)(Heap *heap, HeapObject *old_object, int object_size, Object *new_object, int *offset) |
Definition at line 439 of file mark-compact.h.
typedef int(MarkCompactCollector::* LiveObjectCallback)(HeapObject *obj) |
Definition at line 449 of file mark-compact.h.
typedef void(* ProcessNonLiveFunction)(HeapObject *object, Isolate *isolate) |
Definition at line 446 of file mark-compact.h.
enum CompactionMode |
Enumerator | |
---|---|
INCREMENTAL_COMPACTION | |
NON_INCREMENTAL_COMPACTION |
Definition at line 467 of file mark-compact.h.
enum SweeperType |
Enumerator | |
---|---|
CONSERVATIVE | |
LAZY_CONSERVATIVE | |
PRECISE |
Definition at line 502 of file mark-compact.h.
void AbortCompaction | ( | ) |
Definition at line 641 of file mark-compact.cc.
References ASSERT_EQ, MemoryChunk::ClearEvacuationCandidate(), MemoryChunk::ClearFlag(), SlotsBufferAllocator::DeallocateChain(), MemoryChunk::RESCAN_ON_EVACUATION, and MemoryChunk::slots_buffer_address().
Referenced by MarkCompactCollector::Prepare().
void AddEvacuationCandidate | ( | Page * | p | ) |
Definition at line 229 of file mark-compact.cc.
References MemoryChunk::MarkEvacuationCandidate().
Referenced by MarkCompactCollector::CollectEvacuationCandidates().
void ClearMarkbits | ( | ) |
Definition at line 362 of file mark-compact.cc.
References Heap::cell_space(), MarkBit::Clear(), Heap::code_space(), MemoryChunk::FromAddress(), Heap::lo_space(), Heap::map_space(), Marking::MarkBitFrom(), Heap::new_space(), MarkBit::Next(), v8::internal::NULL, Heap::old_data_space(), and Heap::old_pointer_space().
Referenced by MarkCompactCollector::Prepare().
|
inline |
Definition at line 498 of file mark-compact.h.
void CollectEvacuationCandidates | ( | PagedSpace * | space | ) |
Definition at line 498 of file mark-compact.cc.
References MarkCompactCollector::AddEvacuationCandidate(), v8::internal::AllocationSpaceName(), MemoryChunk::area_size(), PagedSpace::AreaSize(), ASSERT, MemoryChunk::ClearEvacuationCandidate(), v8::internal::CODE_SPACE, PagedSpace::CountFreeListItems(), PagedSpace::CountTotalPages(), Space::heap(), Space::identity(), v8::internal::kPageSizeBits, MemoryChunk::LiveBytes(), v8::internal::MB, v8::internal::Min(), Heap::ms_count(), v8::internal::NULL, v8::internal::OLD_DATA_SPACE, v8::internal::OLD_POINTER_SPACE, v8::internal::PrintF(), PagedSpace::SizeOfObjects(), and Page::WasSwept().
Referenced by MarkCompactCollector::StartCompaction().
void CollectGarbage | ( | ) |
Definition at line 276 of file mark-compact.cc.
References ASSERT, Smi::FromInt(), Heap::incremental_marking(), IncrementalMarking::IsStopped(), and v8::internal::NULL.
void EnableCodeFlushing | ( | bool | enable | ) |
Definition at line 3959 of file mark-compact.cc.
References MarkCompactCollector::heap(), and v8::internal::NULL.
|
inline |
Definition at line 566 of file mark-compact.h.
|
inline |
Definition at line 533 of file mark-compact.h.
References MemoryChunk::ClearEvacuationCandidate(), Space::identity(), v8::internal::OLD_DATA_SPACE, MemoryChunk::owner(), v8::internal::PrintF(), MemoryChunk::RESCAN_ON_EVACUATION, and MemoryChunk::SetFlag().
Referenced by MarkCompactCollector::RecordCodeEntrySlot(), and MarkCompactCollector::RecordRelocSlot().
|
inline |
Definition at line 496 of file mark-compact.h.
Referenced by MarkCompactCollector::EnableCodeFlushing(), MarkCompactCollector::MigrateObject(), MarkCompactCollector::Prepare(), MarkCompactCollector::StartCompaction(), and MarkCompactCollector::TryPromoteObject().
|
static |
Definition at line 3987 of file mark-compact.cc.
References StaticMarkingVisitor::Initialize().
|
inline |
Definition at line 518 of file mark-compact.h.
References MemoryChunk::FromAddress().
|
inline |
Definition at line 523 of file mark-compact.h.
References MemoryChunk::FromAddress().
|
inline |
Definition at line 528 of file mark-compact.h.
References MemoryChunk::FromAddress().
INLINE | ( | void | RecordSlotObject **anchor_slot, Object **slot, Object *object | ) |
void InvalidateCode | ( | Code * | code | ) |
Definition at line 3194 of file mark-compact.cc.
References ASSERT, Heap::incremental_marking(), IncrementalMarking::IsCompacting(), Marking::IsWhite(), and Marking::MarkBitFrom().
Referenced by Deoptimizer::DeoptimizeFunction().
|
inline |
Definition at line 499 of file mark-compact.h.
References v8::internal::NULL.
|
inline |
Definition at line 575 of file mark-compact.h.
Referenced by Heap::ProcessWeakReferences().
|
inlinestatic |
Definition at line 95 of file mark-compact-inl.h.
References ASSERT, HeapObject::cast(), MarkBit::Get(), and Marking::MarkBitFrom().
void MigrateObject | ( | Address | dst, |
Address | src, | ||
int | size, | ||
AllocationSpace | to_old_space | ||
) |
Definition at line 2624 of file mark-compact.cc.
References Memory::Address_at(), SlotsBuffer::AddTo(), ASSERT, Code::cast(), SlotsBuffer::CODE_ENTRY_SLOT, v8::internal::CODE_SPACE, MemoryChunk::FromAddress(), HeapObject::FromAddress(), MarkCompactCollector::heap(), HEAP_PROFILE, SlotsBuffer::IGNORE_OVERFLOW, Heap::InNewSpace(), v8::internal::IsAligned(), JSFunction::kCodeEntryOffset, v8::internal::kPointerSize, v8::internal::LO_SPACE, StoreBuffer::Mark(), Heap::MoveBlock(), v8::internal::NEW_SPACE, Memory::Object_at(), v8::internal::OLD_DATA_SPACE, v8::internal::OLD_POINTER_SPACE, PROFILE, Code::Relocate(), SlotsBuffer::RELOCATED_CODE_OBJECT, and Heap::store_buffer().
Referenced by MarkCompactCollector::TryPromoteObject().
void Prepare | ( | GCTracer * | tracer | ) |
Definition at line 658 of file mark-compact.cc.
References IncrementalMarking::Abort(), MarkCompactCollector::AbortCompaction(), ASSERT, MarkCompactCollector::ClearMarkbits(), Isolate::context_exit_happened(), Serializer::enabled(), MarkCompactCollector::heap(), Heap::incremental_marking(), Heap::isolate(), MarkCompactCollector::NON_INCREMENTAL_COMPACTION, v8::internal::NULL, MarkCompactCollector::StartCompaction(), and MarkCompactCollector::tracer().
void RecordRelocSlot | ( | RelocInfo * | rinfo, |
Object * | target | ||
) |
Definition at line 4033 of file mark-compact.cc.
References SlotsBuffer::AddTo(), MarkCompactCollector::EvictEvacuationCandidate(), SlotsBuffer::FAIL_ON_OVERFLOW, MemoryChunk::FromAddress(), MemoryChunk::IsEvacuationCandidate(), v8::internal::NULL, and MemoryChunk::slots_buffer_address().
Referenced by IncrementalMarking::RecordWriteIntoCodeSlow(), IncrementalMarkingMarkingVisitor::VisitCodeTarget(), StaticMarkingVisitor::VisitCodeTarget(), IncrementalMarkingMarkingVisitor::VisitDebugTarget(), StaticMarkingVisitor::VisitDebugTarget(), IncrementalMarkingMarkingVisitor::VisitEmbeddedPointer(), and StaticMarkingVisitor::VisitEmbeddedPointer().
|
static |
Definition at line 3974 of file mark-compact.cc.
References HeapObject::address(), and PROFILE.
Referenced by LargeObjectSpace::FreeUnmarkedObjects().
|
inline |
Definition at line 567 of file mark-compact.h.
|
inline |
Definition at line 47 of file mark-compact-inl.h.
References Heap::kAbortIncrementalMarkingMask, Heap::kReduceMemoryFootprintMask, and Heap::kSweepPreciselyMask.
Referenced by Heap::CollectAllAvailableGarbage(), and Heap::CollectAllGarbage().
bool StartCompaction | ( | CompactionMode | mode | ) |
Definition at line 247 of file mark-compact.cc.
References ASSERT, Heap::code_space(), MarkCompactCollector::CollectEvacuationCandidates(), PagedSpace::EvictEvacuationCandidatesFromFreeLists(), MarkCompactCollector::heap(), MarkCompactCollector::NON_INCREMENTAL_COMPACTION, Heap::old_data_space(), and Heap::old_pointer_space().
Referenced by MarkCompactCollector::Prepare().
|
static |
Definition at line 3714 of file mark-compact.cc.
References MemoryChunk::AddressToMarkbitIndex(), MemoryChunk::area_end(), MemoryChunk::area_start(), ASSERT, ASSERT_EQ, PagedSpace::Free(), MemoryChunk::IsEvacuationCandidate(), v8::internal::kPointerSize, MemoryChunk::LiveBytes(), MemoryChunk::markbits(), Page::MarkSweptConservatively(), MemoryChunk::ResetLiveBytes(), and Page::WasSwept().
Referenced by PagedSpace::AdvanceSweeper().
|
inline |
Definition at line 478 of file mark-compact.h.
Referenced by MarkCompactCollector::Prepare(), and MarkCompactCollector::TryPromoteObject().
bool TryPromoteObject | ( | HeapObject * | object, |
int | object_size | ||
) |
Definition at line 2781 of file mark-compact.cc.
References HeapObject::address(), PagedSpace::AllocateRaw(), LargeObjectSpace::AllocateRaw(), ASSERT, HeapObject::cast(), MarkCompactCollector::heap(), Space::identity(), Page::kMaxNonCodeHeapObjectSize, v8::internal::LO_SPACE, Heap::lo_space(), Heap::mark_compact_collector(), MarkCompactCollector::MigrateObject(), v8::internal::NOT_EXECUTABLE, Heap::TargetSpace(), and MarkCompactCollector::tracer().
|
friend |
Definition at line 640 of file mark-compact.h.
|
friend |
Definition at line 787 of file mark-compact.h.
|
friend |
Definition at line 642 of file mark-compact.h.
|
friend |
Definition at line 643 of file mark-compact.h.
|
friend |
Definition at line 638 of file mark-compact.h.
|
friend |
Definition at line 637 of file mark-compact.h.
|
friend |
Definition at line 641 of file mark-compact.h.
|
friend |
Definition at line 639 of file mark-compact.h.
|
static |
Definition at line 492 of file mark-compact.h.
|
static |
Definition at line 491 of file mark-compact.h.