diff options
Diffstat (limited to 'deps/v8/src/incremental-marking.h')
-rw-r--r-- | deps/v8/src/incremental-marking.h | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/deps/v8/src/incremental-marking.h b/deps/v8/src/incremental-marking.h index 4cb356de8f..fc5a978cc4 100644 --- a/deps/v8/src/incremental-marking.h +++ b/deps/v8/src/incremental-marking.h @@ -95,21 +95,23 @@ class IncrementalMarking { // progress in the face of the mutator creating new work for it. We start // of at a moderate rate of work and gradually increase the speed of the // incremental marker until it completes. - // Do some marking every time this much memory has been allocated. + // Do some marking every time this much memory has been allocated or that many + // heavy (color-checking) write barriers have been invoked. static const intptr_t kAllocatedThreshold = 65536; + static const intptr_t kWriteBarriersInvokedThreshold = 65536; // Start off by marking this many times more memory than has been allocated. - static const intptr_t kInitialAllocationMarkingFactor = 1; + static const intptr_t kInitialMarkingSpeed = 1; // But if we are promoting a lot of data we need to mark faster to keep up // with the data that is entering the old space through promotion. static const intptr_t kFastMarking = 3; // After this many steps we increase the marking/allocating factor. - static const intptr_t kAllocationMarkingFactorSpeedupInterval = 1024; + static const intptr_t kMarkingSpeedAccellerationInterval = 1024; // This is how much we increase the marking/allocating factor by. - static const intptr_t kAllocationMarkingFactorSpeedup = 2; - static const intptr_t kMaxAllocationMarkingFactor = 1000; + static const intptr_t kMarkingSpeedAccelleration = 2; + static const intptr_t kMaxMarkingSpeed = 1000; void OldSpaceStep(intptr_t allocated) { - Step(allocated * kFastMarking / kInitialAllocationMarkingFactor, + Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD); } @@ -125,13 +127,19 @@ class IncrementalMarking { } static void RecordWriteFromCode(HeapObject* obj, - Object* value, + Object** slot, Isolate* isolate); static void RecordWriteForEvacuationFromCode(HeapObject* obj, Object** slot, Isolate* isolate); + // Record a slot for compaction. Returns false for objects that are + // guaranteed to be rescanned or not guaranteed to survive. + // + // No slots in white objects should be recorded, as some slots are typed and + // cannot be interpreted correctly if the underlying object does not survive + // the incremental cycle (stays white). INLINE(bool BaseRecordWrite(HeapObject* obj, Object** slot, Object* value)); INLINE(void RecordWrite(HeapObject* obj, Object** slot, Object* value)); INLINE(void RecordWriteIntoCode(HeapObject* obj, @@ -156,29 +164,6 @@ class IncrementalMarking { inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); - // Does white->black or keeps gray or black color. Returns true if converting - // white to black. - inline bool MarkBlackOrKeepGrey(MarkBit mark_bit) { - ASSERT(!Marking::IsImpossible(mark_bit)); - if (mark_bit.Get()) { - // Grey or black: Keep the color. - return false; - } - mark_bit.Set(); - ASSERT(Marking::IsBlack(mark_bit)); - return true; - } - - // Marks the object grey and pushes it on the marking stack. - // Returns true if object needed marking and false otherwise. - // This is for incremental marking only. - INLINE(bool MarkObjectAndPush(HeapObject* obj)); - - // Marks the object black without pushing it on the marking stack. - // Returns true if object needed marking and false otherwise. - // This is for incremental marking only. - INLINE(bool MarkObjectWithoutPush(HeapObject* obj)); - inline int steps_count() { return steps_count_; } @@ -215,13 +200,13 @@ class IncrementalMarking { void NotifyOfHighPromotionRate() { if (IsMarking()) { - if (allocation_marking_factor_ < kFastMarking) { + if (marking_speed_ < kFastMarking) { if (FLAG_trace_gc) { PrintPID("Increasing marking speed to %d " "due to high promotion rate\n", static_cast<int>(kFastMarking)); } - allocation_marking_factor_ = kFastMarking; + marking_speed_ = kFastMarking; } } } @@ -261,6 +246,12 @@ class IncrementalMarking { void EnsureMarkingDequeIsCommitted(); + INLINE(void ProcessMarkingDeque()); + + INLINE(void ProcessMarkingDeque(intptr_t bytes_to_process)); + + INLINE(void VisitObject(Map* map, HeapObject* obj, int size)); + Heap* heap_; State state_; @@ -269,7 +260,6 @@ class IncrementalMarking { VirtualMemory* marking_deque_memory_; bool marking_deque_memory_committed_; MarkingDeque marking_deque_; - Marker<IncrementalMarking> marker_; int steps_count_; double steps_took_; @@ -280,9 +270,10 @@ class IncrementalMarking { double steps_took_since_last_gc_; int64_t bytes_rescanned_; bool should_hurry_; - int allocation_marking_factor_; + int marking_speed_; intptr_t bytes_scanned_; intptr_t allocated_; + intptr_t write_barriers_invoked_since_last_step_; int no_marking_scope_depth_; |