Chromium Code Reviews| 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/heap/incremental-marking.h" | 5 #include "src/heap/incremental-marking.h" |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
| 9 #include "src/conversions.h" | 9 #include "src/conversions.h" |
| 10 #include "src/heap/gc-idle-time-handler.h" | 10 #include "src/heap/gc-idle-time-handler.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); | 179 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); |
| 180 table_.Register(kVisitFixedArray, &VisitFixedArrayIncremental); | 180 table_.Register(kVisitFixedArray, &VisitFixedArrayIncremental); |
| 181 table_.Register(kVisitNativeContext, &VisitNativeContextIncremental); | 181 table_.Register(kVisitNativeContext, &VisitNativeContextIncremental); |
| 182 table_.Register(kVisitJSRegExp, &VisitJSRegExp); | 182 table_.Register(kVisitJSRegExp, &VisitJSRegExp); |
| 183 } | 183 } |
| 184 | 184 |
| 185 static const int kProgressBarScanningChunk = 32 * 1024; | 185 static const int kProgressBarScanningChunk = 32 * 1024; |
| 186 | 186 |
| 187 static void VisitFixedArrayIncremental(Map* map, HeapObject* object) { | 187 static void VisitFixedArrayIncremental(Map* map, HeapObject* object) { |
| 188 MemoryChunk* chunk = MemoryChunk::FromAddress(object->address()); | 188 MemoryChunk* chunk = MemoryChunk::FromAddress(object->address()); |
| 189 // TODO(mstarzinger): Move setting of the flag to the allocation site of | |
| 190 // the array. The visitor should just check the flag. | |
| 191 if (FLAG_use_marking_progress_bar && | |
|
Hannes Payer (out of office)
2016/09/30 10:32:41
Let's make that a DCHECK.
Michael Lippautz
2016/09/30 10:36:14
Done.
| |
| 192 chunk->owner()->identity() == LO_SPACE) { | |
| 193 chunk->SetFlag(MemoryChunk::HAS_PROGRESS_BAR); | |
| 194 } | |
| 195 if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) { | 189 if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) { |
| 196 Heap* heap = map->GetHeap(); | 190 Heap* heap = map->GetHeap(); |
| 197 // When using a progress bar for large fixed arrays, scan only a chunk of | 191 // When using a progress bar for large fixed arrays, scan only a chunk of |
| 198 // the array and try to push it onto the marking deque again until it is | 192 // the array and try to push it onto the marking deque again until it is |
| 199 // fully scanned. Fall back to scanning it through to the end in case this | 193 // fully scanned. Fall back to scanning it through to the end in case this |
| 200 // fails because of a full deque. | 194 // fails because of a full deque. |
| 201 int object_size = FixedArray::BodyDescriptor::SizeOf(map, object); | 195 int object_size = FixedArray::BodyDescriptor::SizeOf(map, object); |
| 202 int start_offset = | 196 int start_offset = |
| 203 Max(FixedArray::BodyDescriptor::kStartOffset, chunk->progress_bar()); | 197 Max(FixedArray::BodyDescriptor::kStartOffset, chunk->progress_bar()); |
| 204 int end_offset = | 198 int end_offset = |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1201 idle_marking_delay_counter_++; | 1195 idle_marking_delay_counter_++; |
| 1202 } | 1196 } |
| 1203 | 1197 |
| 1204 | 1198 |
| 1205 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1199 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1206 idle_marking_delay_counter_ = 0; | 1200 idle_marking_delay_counter_ = 0; |
| 1207 } | 1201 } |
| 1208 | 1202 |
| 1209 } // namespace internal | 1203 } // namespace internal |
| 1210 } // namespace v8 | 1204 } // namespace v8 |
| OLD | NEW |