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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 | 202 |
203 void ClearIdleMarkingDelayCounter(); | 203 void ClearIdleMarkingDelayCounter(); |
204 | 204 |
205 bool IsIdleMarkingDelayCounterLimitReached(); | 205 bool IsIdleMarkingDelayCounterLimitReached(); |
206 | 206 |
207 static void MarkObject(Heap* heap, HeapObject* object); | 207 static void MarkObject(Heap* heap, HeapObject* object); |
208 | 208 |
209 static void TransferMark(Heap* heap, Address old_start, Address new_start); | 209 static void TransferMark(Heap* heap, Address old_start, Address new_start); |
210 | 210 |
211 // Returns true if the transferred color is black. | 211 // Returns true if the transferred color is black. |
212 INLINE(static bool TransferColor(HeapObject* from, HeapObject* to)) { | 212 INLINE(static void TransferColor(HeapObject* from, HeapObject* to, |
213 if (Page::FromAddress(to->address())->IsFlagSet(Page::BLACK_PAGE)) | 213 int size)) { |
214 return true; | |
215 MarkBit from_mark_bit = ObjectMarking::MarkBitFrom(from); | 214 MarkBit from_mark_bit = ObjectMarking::MarkBitFrom(from); |
216 MarkBit to_mark_bit = ObjectMarking::MarkBitFrom(to); | 215 MarkBit to_mark_bit = ObjectMarking::MarkBitFrom(to); |
216 | |
217 if (Marking::IsBlack(to_mark_bit)) { | |
218 DCHECK(to->GetHeap()->incremental_marking()->black_allocation()); | |
219 return; | |
220 } | |
221 | |
217 DCHECK(Marking::IsWhite(to_mark_bit)); | 222 DCHECK(Marking::IsWhite(to_mark_bit)); |
218 if (from_mark_bit.Get()) { | 223 if (from_mark_bit.Get()) { |
219 to_mark_bit.Set(); | 224 to_mark_bit.Set(); |
220 if (from_mark_bit.Next().Get()) { | 225 if (from_mark_bit.Next().Get()) { |
221 to_mark_bit.Next().Set(); | 226 to_mark_bit.Next().Set(); |
222 return true; | 227 MemoryChunk::IncrementLiveBytesFromGC(to, size); |
ulan
2016/07/19 13:23:32
This side-effect of the function is unexpected. Wh
Hannes Payer (out of office)
2016/07/19 14:42:53
As discussed offline. I will do this change in a s
| |
223 } | 228 } |
224 } | 229 } |
225 return false; | |
226 } | 230 } |
227 | 231 |
228 void IterateBlackObject(HeapObject* object); | 232 void IterateBlackObject(HeapObject* object); |
229 | 233 |
230 Heap* heap() const { return heap_; } | 234 Heap* heap() const { return heap_; } |
231 | 235 |
232 IncrementalMarkingJob* incremental_marking_job() { | 236 IncrementalMarkingJob* incremental_marking_job() { |
233 return &incremental_marking_job_; | 237 return &incremental_marking_job_; |
234 } | 238 } |
235 | 239 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 GCRequestType request_type_; | 327 GCRequestType request_type_; |
324 | 328 |
325 IncrementalMarkingJob incremental_marking_job_; | 329 IncrementalMarkingJob incremental_marking_job_; |
326 | 330 |
327 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 331 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
328 }; | 332 }; |
329 } // namespace internal | 333 } // namespace internal |
330 } // namespace v8 | 334 } // namespace v8 |
331 | 335 |
332 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 336 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
OLD | NEW |