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

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

Issue 1040233003: Fix logic for doing incremental marking steps on tenured allocation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't do huge steps in response to large object allocation 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
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/spaces.h » ('j') | 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/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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 was_activated_ = false; 814 was_activated_ = false;
815 weak_closure_was_overapproximated_ = false; 815 weak_closure_was_overapproximated_ = false;
816 weak_closure_approximation_rounds_ = 0; 816 weak_closure_approximation_rounds_ = 0;
817 } 817 }
818 818
819 819
820 void IncrementalMarking::OldSpaceStep(intptr_t allocated) { 820 void IncrementalMarking::OldSpaceStep(intptr_t allocated) {
821 if (IsStopped() && ShouldActivate()) { 821 if (IsStopped() && ShouldActivate()) {
822 Start(); 822 Start();
823 } else { 823 } else {
824 Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD); 824 Step(allocated * kOldSpaceAllocationMarkingFactor, GC_VIA_STACK_GUARD);
825 } 825 }
826 } 826 }
827 827
828 828
829 void IncrementalMarking::SpeedUp() { 829 void IncrementalMarking::SpeedUp() {
830 bool speed_up = false; 830 bool speed_up = false;
831 831
832 if ((steps_count_ % kMarkingSpeedAccellerationInterval) == 0) { 832 if ((steps_count_ % kMarkingSpeedAccellerationInterval) == 0) {
833 if (FLAG_trace_gc) { 833 if (FLAG_trace_gc) {
834 PrintPID("Speed up marking after %d steps\n", 834 PrintPID("Speed up marking after %d steps\n",
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 } 890 }
891 } 891 }
892 } 892 }
893 893
894 894
895 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, 895 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
896 CompletionAction action, 896 CompletionAction action,
897 ForceMarkingAction marking, 897 ForceMarkingAction marking,
898 ForceCompletionAction completion) { 898 ForceCompletionAction completion) {
899 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || 899 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking ||
900 !FLAG_incremental_marking_steps || 900 !CanDoSteps()) {
901 (state_ != SWEEPING && state_ != MARKING)) {
902 return 0; 901 return 0;
903 } 902 }
904 903
905 allocated_ += allocated_bytes; 904 allocated_ += allocated_bytes;
906 905
907 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && 906 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold &&
908 write_barriers_invoked_since_last_step_ < 907 write_barriers_invoked_since_last_step_ <
909 kWriteBarriersInvokedThreshold) { 908 kWriteBarriersInvokedThreshold) {
910 return 0; 909 return 0;
911 } 910 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1009 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1011 idle_marking_delay_counter_++; 1010 idle_marking_delay_counter_++;
1012 } 1011 }
1013 1012
1014 1013
1015 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1014 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1016 idle_marking_delay_counter_ = 0; 1015 idle_marking_delay_counter_ = 0;
1017 } 1016 }
1018 } 1017 }
1019 } // namespace v8::internal 1018 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698