| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/heap/incremental-marking.h" | 7 #include "src/heap/incremental-marking.h" |
| 8 | 8 |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 do { | 191 do { |
| 192 VisitPointers(heap, object, HeapObject::RawField(object, start_offset), | 192 VisitPointers(heap, object, HeapObject::RawField(object, start_offset), |
| 193 HeapObject::RawField(object, end_offset)); | 193 HeapObject::RawField(object, end_offset)); |
| 194 start_offset = end_offset; | 194 start_offset = end_offset; |
| 195 end_offset = Min(object_size, end_offset + kProgressBarScanningChunk); | 195 end_offset = Min(object_size, end_offset + kProgressBarScanningChunk); |
| 196 scan_until_end = | 196 scan_until_end = |
| 197 heap->mark_compact_collector()->marking_deque()->IsFull(); | 197 heap->mark_compact_collector()->marking_deque()->IsFull(); |
| 198 } while (scan_until_end && start_offset < object_size); | 198 } while (scan_until_end && start_offset < object_size); |
| 199 chunk->set_progress_bar(start_offset); | 199 chunk->set_progress_bar(start_offset); |
| 200 if (start_offset < object_size) { | 200 if (start_offset < object_size) { |
| 201 MarkCompactCollector* collector = heap->mark_compact_collector(); |
| 201 if (Marking::IsGrey(Marking::MarkBitFrom(object))) { | 202 if (Marking::IsGrey(Marking::MarkBitFrom(object))) { |
| 202 heap->mark_compact_collector()->marking_deque()->UnshiftGrey(object); | 203 collector->marking_deque()->UnshiftGrey(object); |
| 203 } else { | 204 } else { |
| 204 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object))); | 205 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object))); |
| 205 heap->mark_compact_collector()->marking_deque()->UnshiftBlack(object); | 206 if (!collector->marking_deque()->UnshiftBlack(object)) { |
| 207 MemoryChunk::IncrementLiveBytesFromGC(object, -object->Size()); |
| 208 Marking::BlackToGrey(object); |
| 209 } |
| 206 } | 210 } |
| 207 heap->incremental_marking()->NotifyIncompleteScanOfObject( | 211 heap->incremental_marking()->NotifyIncompleteScanOfObject( |
| 208 object_size - (start_offset - already_scanned_offset)); | 212 object_size - (start_offset - already_scanned_offset)); |
| 209 } | 213 } |
| 210 } else { | 214 } else { |
| 211 FixedArrayVisitor::Visit(map, object); | 215 FixedArrayVisitor::Visit(map, object); |
| 212 } | 216 } |
| 213 } | 217 } |
| 214 | 218 |
| 215 static void VisitNativeContextIncremental(Map* map, HeapObject* object) { | 219 static void VisitNativeContextIncremental(Map* map, HeapObject* object) { |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1027 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
| 1024 idle_marking_delay_counter_++; | 1028 idle_marking_delay_counter_++; |
| 1025 } | 1029 } |
| 1026 | 1030 |
| 1027 | 1031 |
| 1028 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1032 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1029 idle_marking_delay_counter_ = 0; | 1033 idle_marking_delay_counter_ = 0; |
| 1030 } | 1034 } |
| 1031 } // namespace internal | 1035 } // namespace internal |
| 1032 } // namespace v8 | 1036 } // namespace v8 |
| OLD | NEW |