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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void Finalize(); | 99 void Finalize(); |
100 | 100 |
101 void Stop(); | 101 void Stop(); |
102 | 102 |
103 void FinalizeMarking(CompletionAction action); | 103 void FinalizeMarking(CompletionAction action); |
104 | 104 |
105 void MarkingComplete(CompletionAction action); | 105 void MarkingComplete(CompletionAction action); |
106 | 106 |
107 void Epilogue(); | 107 void Epilogue(); |
108 | 108 |
109 // Performs incremental marking steps of step_size_in_bytes as long as | 109 // Performs incremental marking steps until deadline_in_ms is reached. It |
110 // deadline_in_ms is not reached. step_size_in_bytes can be 0 to compute | 110 // returns the remaining time that cannot be used for incremental marking |
111 // an estimate increment. Returns the remaining time that cannot be used | 111 // anymore because a single step would exceed the deadline. |
112 // for incremental marking anymore because a single step would exceed the | 112 double AdvanceIncrementalMarking(double deadline_in_ms, |
113 // deadline. | |
114 double AdvanceIncrementalMarking(intptr_t step_size_in_bytes, | |
115 double deadline_in_ms, | |
116 StepActions step_actions); | 113 StepActions step_actions); |
117 | 114 |
118 // It's hard to know how much work the incremental marker should do to make | 115 // It's hard to know how much work the incremental marker should do to make |
119 // progress in the face of the mutator creating new work for it. We start | 116 // progress in the face of the mutator creating new work for it. We start |
120 // of at a moderate rate of work and gradually increase the speed of the | 117 // of at a moderate rate of work and gradually increase the speed of the |
121 // incremental marker until it completes. | 118 // incremental marker until it completes. |
122 // Do some marking every time this much memory has been allocated or that many | 119 // Do some marking every time this much memory has been allocated or that many |
123 // heavy (color-checking) write barriers have been invoked. | 120 // heavy (color-checking) write barriers have been invoked. |
124 static const intptr_t kAllocatedThreshold = 65536; | 121 static const intptr_t kAllocatedThreshold = 65536; |
125 static const intptr_t kWriteBarriersInvokedThreshold = 32768; | 122 static const intptr_t kWriteBarriersInvokedThreshold = 32768; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 GCRequestType request_type_; | 297 GCRequestType request_type_; |
301 | 298 |
302 IncrementalMarkingJob incremental_marking_job_; | 299 IncrementalMarkingJob incremental_marking_job_; |
303 | 300 |
304 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 301 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
305 }; | 302 }; |
306 } // namespace internal | 303 } // namespace internal |
307 } // namespace v8 | 304 } // namespace v8 |
308 | 305 |
309 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 306 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
OLD | NEW |