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/incremental-marking-job.h" | 10 #include "src/heap/incremental-marking-job.h" |
11 #include "src/heap/mark-compact.h" | |
12 #include "src/objects.h" | 11 #include "src/objects.h" |
13 | 12 |
14 namespace v8 { | 13 namespace v8 { |
15 namespace internal { | 14 namespace internal { |
16 | 15 |
| 16 // Forward declarations. |
| 17 class MarkBit; |
| 18 class PagedSpace; |
| 19 |
17 class IncrementalMarking { | 20 class IncrementalMarking { |
18 public: | 21 public: |
19 enum State { STOPPED, SWEEPING, MARKING, COMPLETE }; | 22 enum State { STOPPED, SWEEPING, MARKING, COMPLETE }; |
20 | 23 |
21 enum CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD }; | 24 enum CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD }; |
22 | 25 |
23 enum ForceMarkingAction { FORCE_MARKING, DO_NOT_FORCE_MARKING }; | 26 enum ForceMarkingAction { FORCE_MARKING, DO_NOT_FORCE_MARKING }; |
24 | 27 |
25 enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION }; | 28 enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION }; |
26 | 29 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 inline void RecordWrites(HeapObject* obj); | 168 inline void RecordWrites(HeapObject* obj); |
166 | 169 |
167 inline void BlackToGreyAndUnshift(HeapObject* obj, MarkBit mark_bit); | 170 inline void BlackToGreyAndUnshift(HeapObject* obj, MarkBit mark_bit); |
168 | 171 |
169 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); | 172 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); |
170 | 173 |
171 inline void SetOldSpacePageFlags(MemoryChunk* chunk) { | 174 inline void SetOldSpacePageFlags(MemoryChunk* chunk) { |
172 SetOldSpacePageFlags(chunk, IsMarking(), IsCompacting()); | 175 SetOldSpacePageFlags(chunk, IsMarking(), IsCompacting()); |
173 } | 176 } |
174 | 177 |
175 inline void SetNewSpacePageFlags(NewSpacePage* chunk) { | 178 inline void SetNewSpacePageFlags(MemoryChunk* chunk) { |
176 SetNewSpacePageFlags(chunk, IsMarking()); | 179 SetNewSpacePageFlags(chunk, IsMarking()); |
177 } | 180 } |
178 | 181 |
179 bool IsCompacting() { return IsMarking() && is_compacting_; } | 182 bool IsCompacting() { return IsMarking() && is_compacting_; } |
180 | 183 |
181 void ActivateGeneratedStub(Code* stub); | 184 void ActivateGeneratedStub(Code* stub); |
182 | 185 |
183 void NotifyOfHighPromotionRate(); | 186 void NotifyOfHighPromotionRate(); |
184 | 187 |
185 void EnterNoMarkingScope() { no_marking_scope_depth_++; } | 188 void EnterNoMarkingScope() { no_marking_scope_depth_++; } |
(...skipping 29 matching lines...) Expand all Loading... |
215 static void ActivateIncrementalWriteBarrier(NewSpace* space); | 218 static void ActivateIncrementalWriteBarrier(NewSpace* space); |
216 void ActivateIncrementalWriteBarrier(); | 219 void ActivateIncrementalWriteBarrier(); |
217 | 220 |
218 static void DeactivateIncrementalWriteBarrierForSpace(PagedSpace* space); | 221 static void DeactivateIncrementalWriteBarrierForSpace(PagedSpace* space); |
219 static void DeactivateIncrementalWriteBarrierForSpace(NewSpace* space); | 222 static void DeactivateIncrementalWriteBarrierForSpace(NewSpace* space); |
220 void DeactivateIncrementalWriteBarrier(); | 223 void DeactivateIncrementalWriteBarrier(); |
221 | 224 |
222 static void SetOldSpacePageFlags(MemoryChunk* chunk, bool is_marking, | 225 static void SetOldSpacePageFlags(MemoryChunk* chunk, bool is_marking, |
223 bool is_compacting); | 226 bool is_compacting); |
224 | 227 |
225 static void SetNewSpacePageFlags(NewSpacePage* chunk, bool is_marking); | 228 static void SetNewSpacePageFlags(MemoryChunk* chunk, bool is_marking); |
226 | 229 |
227 INLINE(void ProcessMarkingDeque()); | 230 INLINE(void ProcessMarkingDeque()); |
228 | 231 |
229 INLINE(intptr_t ProcessMarkingDeque(intptr_t bytes_to_process)); | 232 INLINE(intptr_t ProcessMarkingDeque(intptr_t bytes_to_process)); |
230 | 233 |
231 INLINE(void VisitObject(Map* map, HeapObject* obj, int size)); | 234 INLINE(void VisitObject(Map* map, HeapObject* obj, int size)); |
232 | 235 |
233 void IncrementIdleMarkingDelayCounter(); | 236 void IncrementIdleMarkingDelayCounter(); |
234 | 237 |
235 Heap* heap_; | 238 Heap* heap_; |
(...skipping 25 matching lines...) Expand all Loading... |
261 GCRequestType request_type_; | 264 GCRequestType request_type_; |
262 | 265 |
263 IncrementalMarkingJob incremental_marking_job_; | 266 IncrementalMarkingJob incremental_marking_job_; |
264 | 267 |
265 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 268 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
266 }; | 269 }; |
267 } | 270 } |
268 } // namespace v8::internal | 271 } // namespace v8::internal |
269 | 272 |
270 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 273 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
OLD | NEW |