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 | 8 |
9 #include "src/execution.h" | 9 #include "src/execution.h" |
10 #include "src/heap/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 void SetWeakClosureWasOverApproximatedForTesting(bool val) { | 45 void SetWeakClosureWasOverApproximatedForTesting(bool val) { |
46 weak_closure_was_overapproximated_ = val; | 46 weak_closure_was_overapproximated_ = val; |
47 } | 47 } |
48 | 48 |
49 inline bool IsStopped() { return state() == STOPPED; } | 49 inline bool IsStopped() { return state() == STOPPED; } |
50 | 50 |
51 INLINE(bool IsMarking()) { return state() >= MARKING; } | 51 INLINE(bool IsMarking()) { return state() >= MARKING; } |
52 | 52 |
53 inline bool IsMarkingIncomplete() { return state() == MARKING; } | 53 inline bool CanDoSteps() { |
| 54 return FLAG_incremental_marking_steps && |
| 55 (state() == MARKING || state() == SWEEPING); |
| 56 } |
54 | 57 |
55 inline bool IsComplete() { return state() == COMPLETE; } | 58 inline bool IsComplete() { return state() == COMPLETE; } |
56 | 59 |
57 inline bool IsReadyToOverApproximateWeakClosure() const { | 60 inline bool IsReadyToOverApproximateWeakClosure() const { |
58 return request_type_ == OVERAPPROXIMATION && | 61 return request_type_ == OVERAPPROXIMATION && |
59 !weak_closure_was_overapproximated_; | 62 !weak_closure_was_overapproximated_; |
60 } | 63 } |
61 | 64 |
62 GCRequestType request_type() const { return request_type_; } | 65 GCRequestType request_type() const { return request_type_; } |
63 | 66 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // incremental marker until it completes. | 100 // incremental marker until it completes. |
98 // Do some marking every time this much memory has been allocated or that many | 101 // Do some marking every time this much memory has been allocated or that many |
99 // heavy (color-checking) write barriers have been invoked. | 102 // heavy (color-checking) write barriers have been invoked. |
100 static const intptr_t kAllocatedThreshold = 65536; | 103 static const intptr_t kAllocatedThreshold = 65536; |
101 static const intptr_t kWriteBarriersInvokedThreshold = 32768; | 104 static const intptr_t kWriteBarriersInvokedThreshold = 32768; |
102 // Start off by marking this many times more memory than has been allocated. | 105 // Start off by marking this many times more memory than has been allocated. |
103 static const intptr_t kInitialMarkingSpeed = 1; | 106 static const intptr_t kInitialMarkingSpeed = 1; |
104 // But if we are promoting a lot of data we need to mark faster to keep up | 107 // But if we are promoting a lot of data we need to mark faster to keep up |
105 // with the data that is entering the old space through promotion. | 108 // with the data that is entering the old space through promotion. |
106 static const intptr_t kFastMarking = 3; | 109 static const intptr_t kFastMarking = 3; |
| 110 static const intptr_t kOldSpaceAllocationMarkingFactor = |
| 111 kFastMarking / kInitialMarkingSpeed; |
107 // After this many steps we increase the marking/allocating factor. | 112 // After this many steps we increase the marking/allocating factor. |
108 static const intptr_t kMarkingSpeedAccellerationInterval = 1024; | 113 static const intptr_t kMarkingSpeedAccellerationInterval = 1024; |
109 // This is how much we increase the marking/allocating factor by. | 114 // This is how much we increase the marking/allocating factor by. |
110 static const intptr_t kMarkingSpeedAccelleration = 2; | 115 static const intptr_t kMarkingSpeedAccelleration = 2; |
111 static const intptr_t kMaxMarkingSpeed = 1000; | 116 static const intptr_t kMaxMarkingSpeed = 1000; |
112 | 117 |
113 // This is the upper bound for how many times we allow finalization of | 118 // This is the upper bound for how many times we allow finalization of |
114 // incremental marking to be postponed. | 119 // incremental marking to be postponed. |
115 static const size_t kMaxIdleMarkingDelayCounter = 3; | 120 static const size_t kMaxIdleMarkingDelayCounter = 3; |
116 | 121 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 int weak_closure_approximation_rounds_; | 263 int weak_closure_approximation_rounds_; |
259 | 264 |
260 GCRequestType request_type_; | 265 GCRequestType request_type_; |
261 | 266 |
262 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 267 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
263 }; | 268 }; |
264 } | 269 } |
265 } // namespace v8::internal | 270 } // namespace v8::internal |
266 | 271 |
267 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 272 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
OLD | NEW |