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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "incremental-marking.h" | 7 #include "incremental-marking.h" |
8 | 8 |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "compilation-cache.h" | 10 #include "compilation-cache.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 object_size - (start_offset - already_scanned_offset)); | 215 object_size - (start_offset - already_scanned_offset)); |
216 } | 216 } |
217 } else { | 217 } else { |
218 FixedArrayVisitor::Visit(map, object); | 218 FixedArrayVisitor::Visit(map, object); |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 static void VisitNativeContextIncremental(Map* map, HeapObject* object) { | 222 static void VisitNativeContextIncremental(Map* map, HeapObject* object) { |
223 Context* context = Context::cast(object); | 223 Context* context = Context::cast(object); |
224 | 224 |
225 // We will mark cache black with a separate pass | 225 // We will mark cache black with a separate pass when we finish marking. |
226 // when we finish marking. | 226 // Note that GC can happen when the context is not fully initialized, |
227 MarkObjectGreyDoNotEnqueue(context->normalized_map_cache()); | 227 // so the cache can be undefined. |
| 228 Object* cache = context->get(Context::NORMALIZED_MAP_CACHE_INDEX); |
| 229 if (!cache->IsUndefined()) { |
| 230 MarkObjectGreyDoNotEnqueue(cache); |
| 231 } |
228 VisitNativeContext(map, context); | 232 VisitNativeContext(map, context); |
229 } | 233 } |
230 | 234 |
231 static void VisitWeakCollection(Map* map, HeapObject* object) { | 235 static void VisitWeakCollection(Map* map, HeapObject* object) { |
232 Heap* heap = map->GetHeap(); | 236 Heap* heap = map->GetHeap(); |
233 VisitPointers(heap, | 237 VisitPointers(heap, |
234 HeapObject::RawField(object, | 238 HeapObject::RawField(object, |
235 JSWeakCollection::kPropertiesOffset), | 239 JSWeakCollection::kPropertiesOffset), |
236 HeapObject::RawField(object, JSWeakCollection::kSize)); | 240 HeapObject::RawField(object, JSWeakCollection::kSize)); |
237 } | 241 } |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 bytes_scanned_ = 0; | 996 bytes_scanned_ = 0; |
993 write_barriers_invoked_since_last_step_ = 0; | 997 write_barriers_invoked_since_last_step_ = 0; |
994 } | 998 } |
995 | 999 |
996 | 1000 |
997 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 1001 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
998 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 1002 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
999 } | 1003 } |
1000 | 1004 |
1001 } } // namespace v8::internal | 1005 } } // namespace v8::internal |
OLD | NEW |