| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 VisitPointers(heap, | 233 VisitPointers(heap, |
| 234 HeapObject::RawField(object, | 234 HeapObject::RawField(object, |
| 235 JSWeakCollection::kPropertiesOffset), | 235 JSWeakCollection::kPropertiesOffset), |
| 236 HeapObject::RawField(object, JSWeakCollection::kSize)); | 236 HeapObject::RawField(object, JSWeakCollection::kSize)); |
| 237 } | 237 } |
| 238 | 238 |
| 239 static void BeforeVisitingSharedFunctionInfo(HeapObject* object) {} | 239 static void BeforeVisitingSharedFunctionInfo(HeapObject* object) {} |
| 240 | 240 |
| 241 INLINE(static void VisitPointer(Heap* heap, Object** p)) { | 241 INLINE(static void VisitPointer(Heap* heap, Object** p)) { |
| 242 Object* obj = *p; | 242 Object* obj = *p; |
| 243 if (obj->NonFailureIsHeapObject()) { | 243 if (obj->IsHeapObject()) { |
| 244 heap->mark_compact_collector()->RecordSlot(p, p, obj); | 244 heap->mark_compact_collector()->RecordSlot(p, p, obj); |
| 245 MarkObject(heap, obj); | 245 MarkObject(heap, obj); |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 INLINE(static void VisitPointers(Heap* heap, Object** start, Object** end)) { | 249 INLINE(static void VisitPointers(Heap* heap, Object** start, Object** end)) { |
| 250 for (Object** p = start; p < end; p++) { | 250 for (Object** p = start; p < end; p++) { |
| 251 Object* obj = *p; | 251 Object* obj = *p; |
| 252 if (obj->NonFailureIsHeapObject()) { | 252 if (obj->IsHeapObject()) { |
| 253 heap->mark_compact_collector()->RecordSlot(start, p, obj); | 253 heap->mark_compact_collector()->RecordSlot(start, p, obj); |
| 254 MarkObject(heap, obj); | 254 MarkObject(heap, obj); |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 | 258 |
| 259 INLINE(static void VisitPointersWithAnchor(Heap* heap, | 259 INLINE(static void VisitPointersWithAnchor(Heap* heap, |
| 260 Object** anchor, | 260 Object** anchor, |
| 261 Object** start, | 261 Object** start, |
| 262 Object** end)) { | 262 Object** end)) { |
| 263 for (Object** p = start; p < end; p++) { | 263 for (Object** p = start; p < end; p++) { |
| 264 Object* obj = *p; | 264 Object* obj = *p; |
| 265 if (obj->NonFailureIsHeapObject()) { | 265 if (obj->IsHeapObject()) { |
| 266 heap->mark_compact_collector()->RecordSlot(anchor, p, obj); | 266 heap->mark_compact_collector()->RecordSlot(anchor, p, obj); |
| 267 MarkObject(heap, obj); | 267 MarkObject(heap, obj); |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 } | 270 } |
| 271 | 271 |
| 272 // Marks the object grey and pushes it on the marking stack. | 272 // Marks the object grey and pushes it on the marking stack. |
| 273 INLINE(static void MarkObject(Heap* heap, Object* obj)) { | 273 INLINE(static void MarkObject(Heap* heap, Object* obj)) { |
| 274 HeapObject* heap_object = HeapObject::cast(obj); | 274 HeapObject* heap_object = HeapObject::cast(obj); |
| 275 MarkBit mark_bit = Marking::MarkBitFrom(heap_object); | 275 MarkBit mark_bit = Marking::MarkBitFrom(heap_object); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 bytes_scanned_ = 0; | 992 bytes_scanned_ = 0; |
| 993 write_barriers_invoked_since_last_step_ = 0; | 993 write_barriers_invoked_since_last_step_ = 0; |
| 994 } | 994 } |
| 995 | 995 |
| 996 | 996 |
| 997 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 997 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
| 998 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 998 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 } } // namespace v8::internal | 1001 } } // namespace v8::internal |
| OLD | NEW |