| 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/cancelable-task.h" |
| 9 #include "src/execution.h" | 10 #include "src/execution.h" |
| 10 #include "src/heap/mark-compact.h" | 11 #include "src/heap/mark-compact.h" |
| 11 #include "src/objects.h" | 12 #include "src/objects.h" |
| 12 | 13 |
| 13 namespace v8 { | 14 namespace v8 { |
| 14 namespace internal { | 15 namespace internal { |
| 15 | 16 |
| 16 | 17 |
| 17 class IncrementalMarking { | 18 class IncrementalMarking { |
| 18 public: | 19 public: |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void ClearIdleMarkingDelayCounter(); | 198 void ClearIdleMarkingDelayCounter(); |
| 198 | 199 |
| 199 bool IsIdleMarkingDelayCounterLimitReached(); | 200 bool IsIdleMarkingDelayCounterLimitReached(); |
| 200 | 201 |
| 201 INLINE(static void MarkObject(Heap* heap, HeapObject* object)); | 202 INLINE(static void MarkObject(Heap* heap, HeapObject* object)); |
| 202 | 203 |
| 203 Heap* heap() const { return heap_; } | 204 Heap* heap() const { return heap_; } |
| 204 | 205 |
| 205 GCCallbackFlags CallbackFlags() const { return gc_callback_flags_; } | 206 GCCallbackFlags CallbackFlags() const { return gc_callback_flags_; } |
| 206 | 207 |
| 208 void ScheduleIncrementalMarkingTask(); |
| 209 void NotifyIncrementalMarkingTaskRunning(); |
| 210 bool IsIncrementalMarkingTaskPending() { |
| 211 return pending_incremental_marking_task_; |
| 212 } |
| 213 |
| 207 private: | 214 private: |
| 208 int64_t SpaceLeftInOldSpace(); | 215 int64_t SpaceLeftInOldSpace(); |
| 209 | 216 |
| 210 void SpeedUp(); | 217 void SpeedUp(); |
| 211 | 218 |
| 212 void ResetStepCounters(); | 219 void ResetStepCounters(); |
| 213 | 220 |
| 214 void StartMarking(); | 221 void StartMarking(); |
| 215 | 222 |
| 216 void ActivateIncrementalWriteBarrier(PagedSpace* space); | 223 void ActivateIncrementalWriteBarrier(PagedSpace* space); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 bool was_activated_; | 264 bool was_activated_; |
| 258 | 265 |
| 259 bool weak_closure_was_overapproximated_; | 266 bool weak_closure_was_overapproximated_; |
| 260 | 267 |
| 261 int weak_closure_approximation_rounds_; | 268 int weak_closure_approximation_rounds_; |
| 262 | 269 |
| 263 GCRequestType request_type_; | 270 GCRequestType request_type_; |
| 264 | 271 |
| 265 GCCallbackFlags gc_callback_flags_; | 272 GCCallbackFlags gc_callback_flags_; |
| 266 | 273 |
| 274 bool pending_incremental_marking_task_; |
| 275 |
| 267 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 276 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
| 268 }; | 277 }; |
| 278 |
| 279 |
| 280 class IncrementalMarkingTask : public CancelableIdleTask { |
| 281 public: |
| 282 explicit IncrementalMarkingTask(Isolate* isolate) |
| 283 : CancelableIdleTask(isolate) {} |
| 284 // CancelableIdleTask overrides. |
| 285 void RunInternal(double deadline_in_seconds) override; |
| 286 enum Progress { kDone, kMoreWork }; |
| 287 static Progress Step(Heap* heap, double deadline_in_ms); |
| 288 }; |
| 269 } | 289 } |
| 270 } // namespace v8::internal | 290 } // namespace v8::internal |
| 271 | 291 |
| 272 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 292 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
| OLD | NEW |