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

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

Issue 1077153004: Reland: Fix logic for incremental marking steps on tenured allocation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't start incremental marking while the linear allocation area is in an inconsistent state Created 5 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
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/heap/incremental-marking.h" 7 #include "src/heap/incremental-marking.h"
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 was_activated_ = false; 811 was_activated_ = false;
812 weak_closure_was_overapproximated_ = false; 812 weak_closure_was_overapproximated_ = false;
813 weak_closure_approximation_rounds_ = 0; 813 weak_closure_approximation_rounds_ = 0;
814 } 814 }
815 815
816 816
817 void IncrementalMarking::OldSpaceStep(intptr_t allocated) { 817 void IncrementalMarking::OldSpaceStep(intptr_t allocated) {
818 if (IsStopped() && ShouldActivateEvenWithoutIdleNotification()) { 818 if (IsStopped() && ShouldActivateEvenWithoutIdleNotification()) {
819 Start(); 819 Start();
820 } else { 820 } else {
821 Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD); 821 Step(allocated * kOldSpaceAllocationMarkingFactor, GC_VIA_STACK_GUARD);
822 } 822 }
823 } 823 }
824 824
825 825
826 void IncrementalMarking::SpeedUp() { 826 void IncrementalMarking::SpeedUp() {
827 bool speed_up = false; 827 bool speed_up = false;
828 828
829 if ((steps_count_ % kMarkingSpeedAccellerationInterval) == 0) { 829 if ((steps_count_ % kMarkingSpeedAccellerationInterval) == 0) {
830 if (FLAG_trace_gc) { 830 if (FLAG_trace_gc) {
831 PrintPID("Speed up marking after %d steps\n", 831 PrintPID("Speed up marking after %d steps\n",
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 } 887 }
888 } 888 }
889 } 889 }
890 890
891 891
892 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, 892 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
893 CompletionAction action, 893 CompletionAction action,
894 ForceMarkingAction marking, 894 ForceMarkingAction marking,
895 ForceCompletionAction completion) { 895 ForceCompletionAction completion) {
896 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || 896 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking ||
897 !FLAG_incremental_marking_steps || 897 !CanDoSteps()) {
898 (state_ != SWEEPING && state_ != MARKING)) {
899 return 0; 898 return 0;
900 } 899 }
901 900
902 allocated_ += allocated_bytes; 901 allocated_ += allocated_bytes;
903 902
904 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && 903 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold &&
905 write_barriers_invoked_since_last_step_ < 904 write_barriers_invoked_since_last_step_ <
906 kWriteBarriersInvokedThreshold) { 905 kWriteBarriersInvokedThreshold) {
907 return 0; 906 return 0;
908 } 907 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1006 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1008 idle_marking_delay_counter_++; 1007 idle_marking_delay_counter_++;
1009 } 1008 }
1010 1009
1011 1010
1012 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1011 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1013 idle_marking_delay_counter_ = 0; 1012 idle_marking_delay_counter_ = 0;
1014 } 1013 }
1015 } 1014 }
1016 } // namespace v8::internal 1015 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/spaces.h » ('j') | src/heap/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698