| 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 11 matching lines...) Expand all Loading... |
| 22 class IncrementalMarking { | 22 class IncrementalMarking { |
| 23 public: | 23 public: |
| 24 enum State { STOPPED, SWEEPING, MARKING, COMPLETE }; | 24 enum State { STOPPED, SWEEPING, MARKING, COMPLETE }; |
| 25 | 25 |
| 26 enum CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD }; | 26 enum CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD }; |
| 27 | 27 |
| 28 enum ForceMarkingAction { FORCE_MARKING, DO_NOT_FORCE_MARKING }; | 28 enum ForceMarkingAction { FORCE_MARKING, DO_NOT_FORCE_MARKING }; |
| 29 | 29 |
| 30 enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION }; | 30 enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION }; |
| 31 | 31 |
| 32 enum GCRequestType { COMPLETE_MARKING, FINALIZATION }; | 32 enum GCRequestType { NONE, COMPLETE_MARKING, FINALIZATION }; |
| 33 | 33 |
| 34 struct StepActions { | 34 struct StepActions { |
| 35 StepActions(CompletionAction complete_action_, | 35 StepActions(CompletionAction complete_action_, |
| 36 ForceMarkingAction force_marking_, | 36 ForceMarkingAction force_marking_, |
| 37 ForceCompletionAction force_completion_) | 37 ForceCompletionAction force_completion_) |
| 38 : completion_action(complete_action_), | 38 : completion_action(complete_action_), |
| 39 force_marking(force_marking_), | 39 force_marking(force_marking_), |
| 40 force_completion(force_completion_) {} | 40 force_completion(force_completion_) {} |
| 41 | 41 |
| 42 CompletionAction completion_action; | 42 CompletionAction completion_action; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 73 inline bool IsMarkingIncomplete() { return state() == MARKING; } | 73 inline bool IsMarkingIncomplete() { return state() == MARKING; } |
| 74 | 74 |
| 75 inline bool IsComplete() { return state() == COMPLETE; } | 75 inline bool IsComplete() { return state() == COMPLETE; } |
| 76 | 76 |
| 77 inline bool IsReadyToOverApproximateWeakClosure() const { | 77 inline bool IsReadyToOverApproximateWeakClosure() const { |
| 78 return request_type_ == FINALIZATION && !finalize_marking_completed_; | 78 return request_type_ == FINALIZATION && !finalize_marking_completed_; |
| 79 } | 79 } |
| 80 | 80 |
| 81 GCRequestType request_type() const { return request_type_; } | 81 GCRequestType request_type() const { return request_type_; } |
| 82 | 82 |
| 83 void reset_request_type() { request_type_ = NONE; } |
| 84 |
| 83 bool CanBeActivated(); | 85 bool CanBeActivated(); |
| 84 | 86 |
| 85 bool ShouldActivateEvenWithoutIdleNotification(); | 87 bool ShouldActivateEvenWithoutIdleNotification(); |
| 86 | 88 |
| 87 bool WasActivated(); | 89 bool WasActivated(); |
| 88 | 90 |
| 89 void Start(const char* reason = nullptr); | 91 void Start(const char* reason = nullptr); |
| 90 | 92 |
| 91 void FinalizeIncrementally(); | 93 void FinalizeIncrementally(); |
| 92 | 94 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 GCRequestType request_type_; | 310 GCRequestType request_type_; |
| 309 | 311 |
| 310 IncrementalMarkingJob incremental_marking_job_; | 312 IncrementalMarkingJob incremental_marking_job_; |
| 311 | 313 |
| 312 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 314 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
| 313 }; | 315 }; |
| 314 } // namespace internal | 316 } // namespace internal |
| 315 } // namespace v8 | 317 } // namespace v8 |
| 316 | 318 |
| 317 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 319 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
| OLD | NEW |