| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 321 } |
| 322 | 322 |
| 323 | 323 |
| 324 template<typename StaticVisitor> | 324 template<typename StaticVisitor> |
| 325 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( | 325 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( |
| 326 Heap* heap, TransitionArray* transitions) { | 326 Heap* heap, TransitionArray* transitions) { |
| 327 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; | 327 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; |
| 328 | 328 |
| 329 // Skip recording the descriptors_pointer slot since the cell space | 329 // Skip recording the descriptors_pointer slot since the cell space |
| 330 // is not compacted and descriptors are referenced through a cell. | 330 // is not compacted and descriptors are referenced through a cell. |
| 331 StaticVisitor::MarkObject(heap, transitions->descriptors_pointer()); | 331 Object** descriptors_slot = transitions->GetDescriptorsSlot(); |
| 332 HeapObject* descriptors = HeapObject::cast(*descriptors_slot); |
| 333 StaticVisitor::MarkObject(heap, descriptors); |
| 334 heap->mark_compact_collector()->RecordSlot( |
| 335 descriptors_slot, descriptors_slot, descriptors); |
| 332 | 336 |
| 333 // Simple transitions do not have keys nor prototype transitions. | 337 // Simple transitions do not have keys nor prototype transitions. |
| 334 if (transitions->IsSimpleTransition()) return; | 338 if (transitions->IsSimpleTransition()) return; |
| 335 | 339 |
| 336 if (transitions->HasPrototypeTransitions()) { | 340 if (transitions->HasPrototypeTransitions()) { |
| 337 // Mark prototype transitions array but do not push it onto marking | 341 // Mark prototype transitions array but do not push it onto marking |
| 338 // stack, this will make references from it weak. We will clean dead | 342 // stack, this will make references from it weak. We will clean dead |
| 339 // prototype transitions in ClearNonLiveTransitions. | 343 // prototype transitions in ClearNonLiveTransitions. |
| 340 Object** slot = transitions->GetPrototypeTransitionsSlot(); | 344 Object** slot = transitions->GetPrototypeTransitionsSlot(); |
| 341 HeapObject* obj = HeapObject::cast(*slot); | 345 HeapObject* obj = HeapObject::cast(*slot); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 RelocIterator it(this, mode_mask); | 404 RelocIterator it(this, mode_mask); |
| 401 for (; !it.done(); it.next()) { | 405 for (; !it.done(); it.next()) { |
| 402 it.rinfo()->template Visit<StaticVisitor>(heap); | 406 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 403 } | 407 } |
| 404 } | 408 } |
| 405 | 409 |
| 406 | 410 |
| 407 } } // namespace v8::internal | 411 } } // namespace v8::internal |
| 408 | 412 |
| 409 #endif // V8_OBJECTS_VISITING_INL_H_ | 413 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |