OLD | NEW |
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 Loading... |
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 * kOldSpaceAllocationMarkingFactor, GC_VIA_STACK_GUARD); | 821 Step(allocated * kFastMarking / kInitialMarkingSpeed, 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 Loading... |
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 !CanDoSteps()) { | 897 !FLAG_incremental_marking_steps || |
| 898 (state_ != SWEEPING && state_ != MARKING)) { |
898 return 0; | 899 return 0; |
899 } | 900 } |
900 | 901 |
901 allocated_ += allocated_bytes; | 902 allocated_ += allocated_bytes; |
902 | 903 |
903 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && | 904 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && |
904 write_barriers_invoked_since_last_step_ < | 905 write_barriers_invoked_since_last_step_ < |
905 kWriteBarriersInvokedThreshold) { | 906 kWriteBarriersInvokedThreshold) { |
906 return 0; | 907 return 0; |
907 } | 908 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1007 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1007 idle_marking_delay_counter_++; | 1008 idle_marking_delay_counter_++; |
1008 } | 1009 } |
1009 | 1010 |
1010 | 1011 |
1011 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1012 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1012 idle_marking_delay_counter_ = 0; | 1013 idle_marking_delay_counter_ = 0; |
1013 } | 1014 } |
1014 } | 1015 } |
1015 } // namespace v8::internal | 1016 } // namespace v8::internal |
OLD | NEW |