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