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 && | |
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)) { |
| 190 DCHECK(!FLAG_use_marking_progress_bar || |
| 191 chunk->owner()->identity() == LO_SPACE); |
196 Heap* heap = map->GetHeap(); | 192 Heap* heap = map->GetHeap(); |
197 // When using a progress bar for large fixed arrays, scan only a chunk of | 193 // 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 | 194 // 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 | 195 // fully scanned. Fall back to scanning it through to the end in case this |
200 // fails because of a full deque. | 196 // fails because of a full deque. |
201 int object_size = FixedArray::BodyDescriptor::SizeOf(map, object); | 197 int object_size = FixedArray::BodyDescriptor::SizeOf(map, object); |
202 int start_offset = | 198 int start_offset = |
203 Max(FixedArray::BodyDescriptor::kStartOffset, chunk->progress_bar()); | 199 Max(FixedArray::BodyDescriptor::kStartOffset, chunk->progress_bar()); |
204 int end_offset = | 200 int end_offset = |
205 Min(object_size, start_offset + kProgressBarScanningChunk); | 201 Min(object_size, start_offset + kProgressBarScanningChunk); |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 idle_marking_delay_counter_++; | 1197 idle_marking_delay_counter_++; |
1202 } | 1198 } |
1203 | 1199 |
1204 | 1200 |
1205 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1201 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1206 idle_marking_delay_counter_ = 0; | 1202 idle_marking_delay_counter_ = 0; |
1207 } | 1203 } |
1208 | 1204 |
1209 } // namespace internal | 1205 } // namespace internal |
1210 } // namespace v8 | 1206 } // namespace v8 |
OLD | NEW |