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()); |
237 if (object->IsConsString() && ConsString::cast(object)->IsFlat()) { | |
Michael Starzinger
2013/06/20 10:04:13
I don't think this is the correct place to do the
| |
238 // Short-circuit flattened cons-strings. | |
239 object = ConsString::cast(object)->first(); | |
240 rinfo->set_target_object(object); | |
241 } | |
238 if (!FLAG_weak_embedded_maps_in_optimized_code || !FLAG_collect_maps || | 242 if (!FLAG_weak_embedded_maps_in_optimized_code || !FLAG_collect_maps || |
239 rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION || | 243 rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION || |
240 !object->IsMap() || !Map::cast(object)->CanTransition()) { | 244 !object->IsMap() || !Map::cast(object)->CanTransition()) { |
241 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 245 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
242 StaticVisitor::MarkObject(heap, object); | 246 StaticVisitor::MarkObject(heap, object); |
243 } | 247 } |
244 } | 248 } |
245 | 249 |
246 | 250 |
247 template<typename StaticVisitor> | 251 template<typename StaticVisitor> |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
817 RelocIterator it(this, mode_mask); | 821 RelocIterator it(this, mode_mask); |
818 for (; !it.done(); it.next()) { | 822 for (; !it.done(); it.next()) { |
819 it.rinfo()->template Visit<StaticVisitor>(heap); | 823 it.rinfo()->template Visit<StaticVisitor>(heap); |
820 } | 824 } |
821 } | 825 } |
822 | 826 |
823 | 827 |
824 } } // namespace v8::internal | 828 } } // namespace v8::internal |
825 | 829 |
826 #endif // V8_OBJECTS_VISITING_INL_H_ | 830 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |