| 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 #ifndef V8_HEAP_INCREMENTAL_MARKING_H_ | 5 #ifndef V8_HEAP_INCREMENTAL_MARKING_H_ |
| 6 #define V8_HEAP_INCREMENTAL_MARKING_H_ | 6 #define V8_HEAP_INCREMENTAL_MARKING_H_ |
| 7 | 7 |
| 8 #include "src/cancelable-task.h" | 8 #include "src/cancelable-task.h" |
| 9 #include "src/execution.h" | 9 #include "src/execution.h" |
| 10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool finalize_marking_completed() const { | 61 bool finalize_marking_completed() const { |
| 62 return finalize_marking_completed_; | 62 return finalize_marking_completed_; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void SetWeakClosureWasOverApproximatedForTesting(bool val) { | 65 void SetWeakClosureWasOverApproximatedForTesting(bool val) { |
| 66 finalize_marking_completed_ = val; | 66 finalize_marking_completed_ = val; |
| 67 } | 67 } |
| 68 | 68 |
| 69 inline bool IsStopped() { return state() == STOPPED; } | 69 inline bool IsStopped() { return state() == STOPPED; } |
| 70 | 70 |
| 71 inline bool IsSweeping() { return state() == SWEEPING; } |
| 72 |
| 71 INLINE(bool IsMarking()) { return state() >= MARKING; } | 73 INLINE(bool IsMarking()) { return state() >= MARKING; } |
| 72 | 74 |
| 73 inline bool IsMarkingIncomplete() { return state() == MARKING; } | 75 inline bool IsMarkingIncomplete() { return state() == MARKING; } |
| 74 | 76 |
| 75 inline bool IsComplete() { return state() == COMPLETE; } | 77 inline bool IsComplete() { return state() == COMPLETE; } |
| 76 | 78 |
| 77 inline bool IsReadyToOverApproximateWeakClosure() const { | 79 inline bool IsReadyToOverApproximateWeakClosure() const { |
| 78 return request_type_ == FINALIZATION && !finalize_marking_completed_; | 80 return request_type_ == FINALIZATION && !finalize_marking_completed_; |
| 79 } | 81 } |
| 80 | 82 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // After this many steps we increase the marking/allocating factor. | 130 // After this many steps we increase the marking/allocating factor. |
| 129 static const intptr_t kMarkingSpeedAccellerationInterval = 1024; | 131 static const intptr_t kMarkingSpeedAccellerationInterval = 1024; |
| 130 // This is how much we increase the marking/allocating factor by. | 132 // This is how much we increase the marking/allocating factor by. |
| 131 static const intptr_t kMarkingSpeedAccelleration = 2; | 133 static const intptr_t kMarkingSpeedAccelleration = 2; |
| 132 static const intptr_t kMaxMarkingSpeed = 1000; | 134 static const intptr_t kMaxMarkingSpeed = 1000; |
| 133 | 135 |
| 134 // This is the upper bound for how many times we allow finalization of | 136 // This is the upper bound for how many times we allow finalization of |
| 135 // incremental marking to be postponed. | 137 // incremental marking to be postponed. |
| 136 static const size_t kMaxIdleMarkingDelayCounter = 3; | 138 static const size_t kMaxIdleMarkingDelayCounter = 3; |
| 137 | 139 |
| 140 void FinalizeSweeping(); |
| 141 |
| 138 void OldSpaceStep(intptr_t allocated); | 142 void OldSpaceStep(intptr_t allocated); |
| 139 | 143 |
| 140 intptr_t Step(intptr_t allocated, CompletionAction action, | 144 intptr_t Step(intptr_t allocated, CompletionAction action, |
| 141 ForceMarkingAction marking = DO_NOT_FORCE_MARKING, | 145 ForceMarkingAction marking = DO_NOT_FORCE_MARKING, |
| 142 ForceCompletionAction completion = FORCE_COMPLETION); | 146 ForceCompletionAction completion = FORCE_COMPLETION); |
| 143 | 147 |
| 144 inline void RestartIfNotMarking() { | 148 inline void RestartIfNotMarking() { |
| 145 if (state_ == COMPLETE) { | 149 if (state_ == COMPLETE) { |
| 146 state_ = MARKING; | 150 state_ = MARKING; |
| 147 if (FLAG_trace_incremental_marking) { | 151 if (FLAG_trace_incremental_marking) { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 GCRequestType request_type_; | 301 GCRequestType request_type_; |
| 298 | 302 |
| 299 IncrementalMarkingJob incremental_marking_job_; | 303 IncrementalMarkingJob incremental_marking_job_; |
| 300 | 304 |
| 301 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 305 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
| 302 }; | 306 }; |
| 303 } // namespace internal | 307 } // namespace internal |
| 304 } // namespace v8 | 308 } // namespace v8 |
| 305 | 309 |
| 306 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 310 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
| OLD | NEW |