OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 HeapObject::RawField(map, Map::kPointerFieldsBeginOffset), | 383 HeapObject::RawField(map, Map::kPointerFieldsBeginOffset), |
384 HeapObject::RawField(map, Map::kPointerFieldsEndOffset)); | 384 HeapObject::RawField(map, Map::kPointerFieldsEndOffset)); |
385 } | 385 } |
386 | 386 |
387 | 387 |
388 template<typename StaticVisitor> | 388 template<typename StaticVisitor> |
389 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( | 389 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( |
390 Heap* heap, TransitionArray* transitions) { | 390 Heap* heap, TransitionArray* transitions) { |
391 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; | 391 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; |
392 | 392 |
393 // Skip recording the descriptors_pointer slot since the cell space | |
394 // is not compacted and descriptors are referenced through a cell. | |
395 Object** descriptors_slot = transitions->GetDescriptorsSlot(); | |
396 HeapObject* descriptors = HeapObject::cast(*descriptors_slot); | |
397 StaticVisitor::MarkObject(heap, descriptors); | |
398 heap->mark_compact_collector()->RecordSlot( | |
399 descriptors_slot, descriptors_slot, descriptors); | |
400 | |
401 // Simple transitions do not have keys nor prototype transitions. | 393 // Simple transitions do not have keys nor prototype transitions. |
402 if (transitions->IsSimpleTransition()) return; | 394 if (transitions->IsSimpleTransition()) return; |
403 | 395 |
404 if (transitions->HasPrototypeTransitions()) { | 396 if (transitions->HasPrototypeTransitions()) { |
405 // Mark prototype transitions array but do not push it onto marking | 397 // Mark prototype transitions array but do not push it onto marking |
406 // stack, this will make references from it weak. We will clean dead | 398 // stack, this will make references from it weak. We will clean dead |
407 // prototype transitions in ClearNonLiveTransitions. | 399 // prototype transitions in ClearNonLiveTransitions. |
408 Object** slot = transitions->GetPrototypeTransitionsSlot(); | 400 Object** slot = transitions->GetPrototypeTransitionsSlot(); |
409 HeapObject* obj = HeapObject::cast(*slot); | 401 HeapObject* obj = HeapObject::cast(*slot); |
410 heap->mark_compact_collector()->RecordSlot(slot, slot, obj); | 402 heap->mark_compact_collector()->RecordSlot(slot, slot, obj); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 RelocIterator it(this, mode_mask); | 654 RelocIterator it(this, mode_mask); |
663 for (; !it.done(); it.next()) { | 655 for (; !it.done(); it.next()) { |
664 it.rinfo()->template Visit<StaticVisitor>(heap); | 656 it.rinfo()->template Visit<StaticVisitor>(heap); |
665 } | 657 } |
666 } | 658 } |
667 | 659 |
668 | 660 |
669 } } // namespace v8::internal | 661 } } // namespace v8::internal |
670 | 662 |
671 #endif // V8_OBJECTS_VISITING_INL_H_ | 663 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |