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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); | 226 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); |
227 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code); | 227 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code); |
228 StaticVisitor::MarkObject(heap, code); | 228 StaticVisitor::MarkObject(heap, code); |
229 } | 229 } |
230 | 230 |
231 | 231 |
232 template<typename StaticVisitor> | 232 template<typename StaticVisitor> |
233 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( | 233 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( |
234 Heap* heap, RelocInfo* rinfo) { | 234 Heap* heap, RelocInfo* rinfo) { |
235 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); | 235 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); |
236 ASSERT(!rinfo->target_object()->IsConsString()); | |
237 HeapObject* object = HeapObject::cast(rinfo->target_object()); | 236 HeapObject* object = HeapObject::cast(rinfo->target_object()); |
238 if (!FLAG_weak_embedded_maps_in_optimized_code || !FLAG_collect_maps || | 237 if (!FLAG_weak_embedded_maps_in_optimized_code || !FLAG_collect_maps || |
239 rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION || | 238 rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION || |
240 !object->IsMap() || !Map::cast(object)->CanTransition()) { | 239 !object->IsMap() || !Map::cast(object)->CanTransition()) { |
241 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 240 StaticVisitor::VisitPointer(heap, rinfo->target_object_address()); |
Michael Starzinger
2013/06/20 12:40:34
Yes, this approach will work. But it requires a tr
| |
242 StaticVisitor::MarkObject(heap, object); | |
243 } | 241 } |
244 } | 242 } |
245 | 243 |
246 | 244 |
247 template<typename StaticVisitor> | 245 template<typename StaticVisitor> |
248 void StaticMarkingVisitor<StaticVisitor>::VisitCell( | 246 void StaticMarkingVisitor<StaticVisitor>::VisitCell( |
249 Heap* heap, RelocInfo* rinfo) { | 247 Heap* heap, RelocInfo* rinfo) { |
250 ASSERT(rinfo->rmode() == RelocInfo::CELL); | 248 ASSERT(rinfo->rmode() == RelocInfo::CELL); |
251 Cell* cell = rinfo->target_cell(); | 249 Cell* cell = rinfo->target_cell(); |
252 StaticVisitor::MarkObject(heap, cell); | 250 StaticVisitor::MarkObject(heap, cell); |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
817 RelocIterator it(this, mode_mask); | 815 RelocIterator it(this, mode_mask); |
818 for (; !it.done(); it.next()) { | 816 for (; !it.done(); it.next()) { |
819 it.rinfo()->template Visit<StaticVisitor>(heap); | 817 it.rinfo()->template Visit<StaticVisitor>(heap); |
820 } | 818 } |
821 } | 819 } |
822 | 820 |
823 | 821 |
824 } } // namespace v8::internal | 822 } } // namespace v8::internal |
825 | 823 |
826 #endif // V8_OBJECTS_VISITING_INL_H_ | 824 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |