Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Side by Side Diff: src/heap/incremental-marking.cc

Issue 1889853002: [heap] Turn on black allocation during marking finalization to avoid floating garbage. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/incremental-marking.h" 5 #include "src/heap/incremental-marking.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/compilation-cache.h" 8 #include "src/compilation-cache.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/heap/gc-idle-time-handler.h" 10 #include "src/heap/gc-idle-time-handler.h"
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 } 550 }
551 #endif 551 #endif
552 552
553 heap_->CompletelyClearInstanceofCache(); 553 heap_->CompletelyClearInstanceofCache();
554 heap_->isolate()->compilation_cache()->MarkCompactPrologue(); 554 heap_->isolate()->compilation_cache()->MarkCompactPrologue();
555 555
556 // Mark strong roots grey. 556 // Mark strong roots grey.
557 IncrementalMarkingRootMarkingVisitor visitor(this); 557 IncrementalMarkingRootMarkingVisitor visitor(this);
558 heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG); 558 heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG);
559 559
560 if (FLAG_black_allocation && !heap()->ShouldReduceMemory()) {
561 StartBlackAllocation();
562 }
563
564 // Ready to start incremental marking. 560 // Ready to start incremental marking.
565 if (FLAG_trace_incremental_marking) { 561 if (FLAG_trace_incremental_marking) {
566 PrintF("[IncrementalMarking] Running\n"); 562 PrintF("[IncrementalMarking] Running\n");
567 } 563 }
568 } 564 }
569 565
570 void IncrementalMarking::StartBlackAllocation() { 566 void IncrementalMarking::StartBlackAllocation() {
571 DCHECK(FLAG_black_allocation); 567 DCHECK(FLAG_black_allocation);
572 DCHECK(IsMarking()); 568 DCHECK(IsMarking());
573 black_allocation_ = true; 569 black_allocation_ = true;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 static_cast<int>(delta), incremental_marking_finalization_rounds_, 750 static_cast<int>(delta), incremental_marking_finalization_rounds_,
755 marking_progress); 751 marking_progress);
756 } 752 }
757 753
758 ++incremental_marking_finalization_rounds_; 754 ++incremental_marking_finalization_rounds_;
759 if ((incremental_marking_finalization_rounds_ >= 755 if ((incremental_marking_finalization_rounds_ >=
760 FLAG_max_incremental_marking_finalization_rounds) || 756 FLAG_max_incremental_marking_finalization_rounds) ||
761 (marking_progress < 757 (marking_progress <
762 FLAG_min_progress_during_incremental_marking_finalization)) { 758 FLAG_min_progress_during_incremental_marking_finalization)) {
763 finalize_marking_completed_ = true; 759 finalize_marking_completed_ = true;
760 }
764 761
765 // If black allocation was not enabled earlier, start black allocation 762 if (FLAG_black_allocation && !heap()->ShouldReduceMemory() &&
766 // here. 763 !black_allocation_) {
767 if (FLAG_black_allocation && !black_allocation_) { 764 // TODO(hpayer): Move to an earlier point as soon as we make faster marking
768 StartBlackAllocation(); 765 // progress.
769 } 766 StartBlackAllocation();
770 } 767 }
771 } 768 }
772 769
773 770
774 void IncrementalMarking::UpdateMarkingDequeAfterScavenge() { 771 void IncrementalMarking::UpdateMarkingDequeAfterScavenge() {
775 if (!IsMarking()) return; 772 if (!IsMarking()) return;
776 773
777 MarkingDeque* marking_deque = 774 MarkingDeque* marking_deque =
778 heap_->mark_compact_collector()->marking_deque(); 775 heap_->mark_compact_collector()->marking_deque();
779 int current = marking_deque->bottom(); 776 int current = marking_deque->bottom();
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1240 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1244 idle_marking_delay_counter_++; 1241 idle_marking_delay_counter_++;
1245 } 1242 }
1246 1243
1247 1244
1248 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1245 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1249 idle_marking_delay_counter_ = 0; 1246 idle_marking_delay_counter_ = 0;
1250 } 1247 }
1251 } // namespace internal 1248 } // namespace internal
1252 } // namespace v8 1249 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698