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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
829 was_activated_ = false; | 829 was_activated_ = false; |
830 weak_closure_was_overapproximated_ = false; | 830 weak_closure_was_overapproximated_ = false; |
831 weak_closure_approximation_rounds_ = 0; | 831 weak_closure_approximation_rounds_ = 0; |
832 } | 832 } |
833 | 833 |
834 | 834 |
835 void IncrementalMarking::OldSpaceStep(intptr_t allocated) { | 835 void IncrementalMarking::OldSpaceStep(intptr_t allocated) { |
836 if (IsStopped() && ShouldActivate()) { | 836 if (IsStopped() && ShouldActivate()) { |
837 // TODO(hpayer): Let's play safe for now, but compaction should be | 837 // TODO(hpayer): Let's play safe for now, but compaction should be |
838 // in principle possible. | 838 // in principle possible. |
839 Start(PREVENT_COMPACTION); | 839 Start(PREVENT_COMPACTION); |
Erik Corry Chromium.org
2015/03/31 13:11:32
Time to revisit this TODO if we didn't already tod
Hannes Payer (out of office)
2015/04/02 13:36:39
Done.
| |
840 } else { | 840 } else { |
841 Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD); | 841 Step(allocated * kOldSpaceAllocationMarkingFactor, GC_VIA_STACK_GUARD); |
842 } | 842 } |
843 } | 843 } |
844 | 844 |
845 | 845 |
846 void IncrementalMarking::SpeedUp() { | 846 void IncrementalMarking::SpeedUp() { |
847 bool speed_up = false; | 847 bool speed_up = false; |
848 | 848 |
849 if ((steps_count_ % kMarkingSpeedAccellerationInterval) == 0) { | 849 if ((steps_count_ % kMarkingSpeedAccellerationInterval) == 0) { |
850 if (FLAG_trace_gc) { | 850 if (FLAG_trace_gc) { |
851 PrintPID("Speed up marking after %d steps\n", | 851 PrintPID("Speed up marking after %d steps\n", |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
907 } | 907 } |
908 } | 908 } |
909 } | 909 } |
910 | 910 |
911 | 911 |
912 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, | 912 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, |
913 CompletionAction action, | 913 CompletionAction action, |
914 ForceMarkingAction marking, | 914 ForceMarkingAction marking, |
915 ForceCompletionAction completion) { | 915 ForceCompletionAction completion) { |
916 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || | 916 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || |
917 !FLAG_incremental_marking_steps || | 917 !CanDoSteps()) { |
918 (state_ != SWEEPING && state_ != MARKING)) { | |
919 return 0; | 918 return 0; |
920 } | 919 } |
921 | 920 |
922 allocated_ += allocated_bytes; | 921 allocated_ += allocated_bytes; |
923 | 922 |
924 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && | 923 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && |
925 write_barriers_invoked_since_last_step_ < | 924 write_barriers_invoked_since_last_step_ < |
926 kWriteBarriersInvokedThreshold) { | 925 kWriteBarriersInvokedThreshold) { |
927 return 0; | 926 return 0; |
928 } | 927 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1027 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1026 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1028 idle_marking_delay_counter_++; | 1027 idle_marking_delay_counter_++; |
1029 } | 1028 } |
1030 | 1029 |
1031 | 1030 |
1032 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1031 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1033 idle_marking_delay_counter_ = 0; | 1032 idle_marking_delay_counter_ = 0; |
1034 } | 1033 } |
1035 } | 1034 } |
1036 } // namespace v8::internal | 1035 } // namespace v8::internal |
OLD | NEW |