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" |
11 #include "src/heap/incremental-marking-job.h" | 11 #include "src/heap/incremental-marking-job.h" |
| 12 #include "src/heap/mark-compact.h" |
12 #include "src/heap/spaces.h" | 13 #include "src/heap/spaces.h" |
13 #include "src/objects.h" | 14 #include "src/objects.h" |
14 | 15 |
15 namespace v8 { | 16 namespace v8 { |
16 namespace internal { | 17 namespace internal { |
17 | 18 |
18 // Forward declarations. | 19 // Forward declarations. |
19 class MarkBit; | 20 class MarkBit; |
20 class PagedSpace; | 21 class PagedSpace; |
21 | 22 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 void NotifyIncompleteScanOfObject(int unscanned_bytes) { | 199 void NotifyIncompleteScanOfObject(int unscanned_bytes) { |
199 unscanned_bytes_of_large_object_ = unscanned_bytes; | 200 unscanned_bytes_of_large_object_ = unscanned_bytes; |
200 } | 201 } |
201 | 202 |
202 void ClearIdleMarkingDelayCounter(); | 203 void ClearIdleMarkingDelayCounter(); |
203 | 204 |
204 bool IsIdleMarkingDelayCounterLimitReached(); | 205 bool IsIdleMarkingDelayCounterLimitReached(); |
205 | 206 |
206 static void MarkObject(Heap* heap, HeapObject* object); | 207 static void MarkObject(Heap* heap, HeapObject* object); |
207 | 208 |
| 209 static void TransferMark(Heap* heap, Address old_start, Address new_start); |
| 210 |
| 211 // Returns true if the transferred color is black. |
| 212 INLINE(static bool TransferColor(HeapObject* from, HeapObject* to)) { |
| 213 if (Page::FromAddress(to->address())->IsFlagSet(Page::BLACK_PAGE)) |
| 214 return true; |
| 215 MarkBit from_mark_bit = ObjectMarking::MarkBitFrom(from); |
| 216 MarkBit to_mark_bit = ObjectMarking::MarkBitFrom(to); |
| 217 DCHECK(Marking::IsWhite(to_mark_bit)); |
| 218 if (from_mark_bit.Get()) { |
| 219 to_mark_bit.Set(); |
| 220 if (from_mark_bit.Next().Get()) { |
| 221 to_mark_bit.Next().Set(); |
| 222 return true; |
| 223 } |
| 224 } |
| 225 return false; |
| 226 } |
| 227 |
208 void IterateBlackObject(HeapObject* object); | 228 void IterateBlackObject(HeapObject* object); |
209 | 229 |
210 Heap* heap() const { return heap_; } | 230 Heap* heap() const { return heap_; } |
211 | 231 |
212 IncrementalMarkingJob* incremental_marking_job() { | 232 IncrementalMarkingJob* incremental_marking_job() { |
213 return &incremental_marking_job_; | 233 return &incremental_marking_job_; |
214 } | 234 } |
215 | 235 |
216 bool black_allocation() { return black_allocation_; } | 236 bool black_allocation() { return black_allocation_; } |
217 | 237 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 GCRequestType request_type_; | 323 GCRequestType request_type_; |
304 | 324 |
305 IncrementalMarkingJob incremental_marking_job_; | 325 IncrementalMarkingJob incremental_marking_job_; |
306 | 326 |
307 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 327 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
308 }; | 328 }; |
309 } // namespace internal | 329 } // namespace internal |
310 } // namespace v8 | 330 } // namespace v8 |
311 | 331 |
312 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 332 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
OLD | NEW |