| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 GCRequestType request_type() const { return request_type_; } | 69 GCRequestType request_type() const { return request_type_; } |
| 70 | 70 |
| 71 void reset_request_type() { request_type_ = NONE; } | 71 void reset_request_type() { request_type_ = NONE; } |
| 72 | 72 |
| 73 bool CanBeActivated(); | 73 bool CanBeActivated(); |
| 74 | 74 |
| 75 bool ShouldActivateEvenWithoutIdleNotification(); |
| 76 |
| 75 bool WasActivated(); | 77 bool WasActivated(); |
| 76 | 78 |
| 77 void Start(GarbageCollectionReason gc_reason); | 79 void Start(GarbageCollectionReason gc_reason); |
| 78 | 80 |
| 79 void FinalizeIncrementally(); | 81 void FinalizeIncrementally(); |
| 80 | 82 |
| 81 void UpdateMarkingDequeAfterScavenge(); | 83 void UpdateMarkingDequeAfterScavenge(); |
| 82 | 84 |
| 83 void Hurry(); | 85 void Hurry(); |
| 84 | 86 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 108 // heavy (color-checking) write barriers have been invoked. | 110 // heavy (color-checking) write barriers have been invoked. |
| 109 static const size_t kAllocatedThreshold = 64 * KB; | 111 static const size_t kAllocatedThreshold = 64 * KB; |
| 110 | 112 |
| 111 static const int kStepSizeInMs = 1; | 113 static const int kStepSizeInMs = 1; |
| 112 static const int kMaxStepSizeInMs = 5; | 114 static const int kMaxStepSizeInMs = 5; |
| 113 | 115 |
| 114 // This is the upper bound for how many times we allow finalization of | 116 // This is the upper bound for how many times we allow finalization of |
| 115 // incremental marking to be postponed. | 117 // incremental marking to be postponed. |
| 116 static const int kMaxIdleMarkingDelayCounter = 3; | 118 static const int kMaxIdleMarkingDelayCounter = 3; |
| 117 | 119 |
| 118 #ifndef DEBUG | |
| 119 static const intptr_t kActivationThreshold = 8 * MB; | |
| 120 #else | |
| 121 static const intptr_t kActivationThreshold = 0; | |
| 122 #endif | |
| 123 | |
| 124 void FinalizeSweeping(); | 120 void FinalizeSweeping(); |
| 125 | 121 |
| 126 size_t Step(size_t bytes_to_process, CompletionAction action, | 122 size_t Step(size_t bytes_to_process, CompletionAction action, |
| 127 ForceCompletionAction completion, StepOrigin step_origin); | 123 ForceCompletionAction completion, StepOrigin step_origin); |
| 128 | 124 |
| 129 inline void RestartIfNotMarking(); | 125 inline void RestartIfNotMarking(); |
| 130 | 126 |
| 131 static void RecordWriteFromCode(HeapObject* obj, Object** slot, | 127 static void RecordWriteFromCode(HeapObject* obj, Object** slot, |
| 132 Isolate* isolate); | 128 Isolate* isolate); |
| 133 | 129 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 IncrementalMarkingJob incremental_marking_job_; | 295 IncrementalMarkingJob incremental_marking_job_; |
| 300 Observer new_generation_observer_; | 296 Observer new_generation_observer_; |
| 301 Observer old_generation_observer_; | 297 Observer old_generation_observer_; |
| 302 | 298 |
| 303 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 299 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
| 304 }; | 300 }; |
| 305 } // namespace internal | 301 } // namespace internal |
| 306 } // namespace v8 | 302 } // namespace v8 |
| 307 | 303 |
| 308 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 304 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
| OLD | NEW |