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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 INLINE(bool IsMarking()) { return state() >= MARKING; } | 59 INLINE(bool IsMarking()) { return state() >= MARKING; } |
60 | 60 |
61 inline bool IsMarkingIncomplete() { return state() == MARKING; } | 61 inline bool IsMarkingIncomplete() { return state() == MARKING; } |
62 | 62 |
63 inline bool IsComplete() { return state() == COMPLETE; } | 63 inline bool IsComplete() { return state() == COMPLETE; } |
64 | 64 |
65 inline bool IsReadyToOverApproximateWeakClosure() const { | 65 inline bool IsReadyToOverApproximateWeakClosure() const { |
66 return request_type_ == FINALIZATION && !finalize_marking_completed_; | 66 return request_type_ == FINALIZATION && !finalize_marking_completed_; |
67 } | 67 } |
68 | 68 |
| 69 inline bool NeedsFinalization() { |
| 70 return IsMarking() && |
| 71 (request_type_ == FINALIZATION || request_type_ == COMPLETE_MARKING); |
| 72 } |
| 73 |
69 GCRequestType request_type() const { return request_type_; } | 74 GCRequestType request_type() const { return request_type_; } |
70 | 75 |
71 void reset_request_type() { request_type_ = NONE; } | 76 void reset_request_type() { request_type_ = NONE; } |
72 | 77 |
73 bool CanBeActivated(); | 78 bool CanBeActivated(); |
74 | 79 |
75 bool WasActivated(); | 80 bool WasActivated(); |
76 | 81 |
77 void Start(GarbageCollectionReason gc_reason); | 82 void Start(GarbageCollectionReason gc_reason); |
78 | 83 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 IncrementalMarkingJob incremental_marking_job_; | 304 IncrementalMarkingJob incremental_marking_job_; |
300 Observer new_generation_observer_; | 305 Observer new_generation_observer_; |
301 Observer old_generation_observer_; | 306 Observer old_generation_observer_; |
302 | 307 |
303 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 308 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
304 }; | 309 }; |
305 } // namespace internal | 310 } // namespace internal |
306 } // namespace v8 | 311 } // namespace v8 |
307 | 312 |
308 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 313 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
OLD | NEW |