| 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/execution.h" | 9 #include "src/execution.h" |
| 10 #include "src/heap/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 INLINE(bool IsMarking()) { return state() >= MARKING; } | 41 INLINE(bool IsMarking()) { return state() >= MARKING; } |
| 42 | 42 |
| 43 inline bool IsMarkingIncomplete() { return state() == MARKING; } | 43 inline bool IsMarkingIncomplete() { return state() == MARKING; } |
| 44 | 44 |
| 45 inline bool IsComplete() { return state() == COMPLETE; } | 45 inline bool IsComplete() { return state() == COMPLETE; } |
| 46 | 46 |
| 47 bool WorthActivating(); | 47 bool WorthActivating(); |
| 48 | 48 |
| 49 bool ShouldActivate(); | 49 bool ShouldActivate(); |
| 50 | 50 |
| 51 bool WasActivated(); |
| 52 |
| 51 enum CompactionFlag { ALLOW_COMPACTION, PREVENT_COMPACTION }; | 53 enum CompactionFlag { ALLOW_COMPACTION, PREVENT_COMPACTION }; |
| 52 | 54 |
| 53 void Start(CompactionFlag flag = ALLOW_COMPACTION); | 55 void Start(CompactionFlag flag = ALLOW_COMPACTION); |
| 54 | 56 |
| 55 void Stop(); | 57 void Stop(); |
| 56 | 58 |
| 57 void PrepareForScavenge(); | 59 void PrepareForScavenge(); |
| 58 | 60 |
| 59 void UpdateMarkingDequeAfterScavenge(); | 61 void UpdateMarkingDequeAfterScavenge(); |
| 60 | 62 |
| 61 void Hurry(); | 63 void Hurry(); |
| 62 | 64 |
| 63 void Finalize(); | 65 void Finalize(); |
| 64 | 66 |
| 65 void Abort(); | 67 void Abort(); |
| 66 | 68 |
| 67 void MarkingComplete(CompletionAction action); | 69 void MarkingComplete(CompletionAction action); |
| 68 | 70 |
| 71 void Epilogue(); |
| 72 |
| 69 // It's hard to know how much work the incremental marker should do to make | 73 // It's hard to know how much work the incremental marker should do to make |
| 70 // progress in the face of the mutator creating new work for it. We start | 74 // progress in the face of the mutator creating new work for it. We start |
| 71 // of at a moderate rate of work and gradually increase the speed of the | 75 // of at a moderate rate of work and gradually increase the speed of the |
| 72 // incremental marker until it completes. | 76 // incremental marker until it completes. |
| 73 // Do some marking every time this much memory has been allocated or that many | 77 // Do some marking every time this much memory has been allocated or that many |
| 74 // heavy (color-checking) write barriers have been invoked. | 78 // heavy (color-checking) write barriers have been invoked. |
| 75 static const intptr_t kAllocatedThreshold = 65536; | 79 static const intptr_t kAllocatedThreshold = 65536; |
| 76 static const intptr_t kWriteBarriersInvokedThreshold = 32768; | 80 static const intptr_t kWriteBarriersInvokedThreshold = 32768; |
| 77 // Start off by marking this many times more memory than has been allocated. | 81 // Start off by marking this many times more memory than has been allocated. |
| 78 static const intptr_t kInitialMarkingSpeed = 1; | 82 static const intptr_t kInitialMarkingSpeed = 1; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 int marking_speed_; | 219 int marking_speed_; |
| 216 intptr_t bytes_scanned_; | 220 intptr_t bytes_scanned_; |
| 217 intptr_t allocated_; | 221 intptr_t allocated_; |
| 218 intptr_t write_barriers_invoked_since_last_step_; | 222 intptr_t write_barriers_invoked_since_last_step_; |
| 219 size_t idle_marking_delay_counter_; | 223 size_t idle_marking_delay_counter_; |
| 220 | 224 |
| 221 int no_marking_scope_depth_; | 225 int no_marking_scope_depth_; |
| 222 | 226 |
| 223 int unscanned_bytes_of_large_object_; | 227 int unscanned_bytes_of_large_object_; |
| 224 | 228 |
| 229 bool was_activated_; |
| 230 |
| 225 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 231 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
| 226 }; | 232 }; |
| 227 } | 233 } |
| 228 } // namespace v8::internal | 234 } // namespace v8::internal |
| 229 | 235 |
| 230 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 236 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
| OLD | NEW |