| 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 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 } | 902 } |
| 903 } | 903 } |
| 904 } | 904 } |
| 905 } | 905 } |
| 906 | 906 |
| 907 | 907 |
| 908 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, | 908 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, |
| 909 CompletionAction action, | 909 CompletionAction action, |
| 910 ForceMarkingAction marking, | 910 ForceMarkingAction marking, |
| 911 ForceCompletionAction completion) { | 911 ForceCompletionAction completion) { |
| 912 DCHECK(allocated_bytes >= 0); |
| 913 |
| 912 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || | 914 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || |
| 913 !FLAG_incremental_marking_steps || | 915 !FLAG_incremental_marking_steps || |
| 914 (state_ != SWEEPING && state_ != MARKING)) { | 916 (state_ != SWEEPING && state_ != MARKING)) { |
| 915 return 0; | 917 return 0; |
| 916 } | 918 } |
| 917 | 919 |
| 918 allocated_ += allocated_bytes; | 920 allocated_ += allocated_bytes; |
| 919 | 921 |
| 920 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && | 922 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && |
| 921 write_barriers_invoked_since_last_step_ < | 923 write_barriers_invoked_since_last_step_ < |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1025 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
| 1024 idle_marking_delay_counter_++; | 1026 idle_marking_delay_counter_++; |
| 1025 } | 1027 } |
| 1026 | 1028 |
| 1027 | 1029 |
| 1028 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1030 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1029 idle_marking_delay_counter_ = 0; | 1031 idle_marking_delay_counter_ = 0; |
| 1030 } | 1032 } |
| 1031 } // namespace internal | 1033 } // namespace internal |
| 1032 } // namespace v8 | 1034 } // namespace v8 |
| OLD | NEW |