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 243 matching lines...) Loading... |
254 StaticVisitor::MarkObject(heap, code); | 254 StaticVisitor::MarkObject(heap, code); |
255 } | 255 } |
256 | 256 |
257 | 257 |
258 template<typename StaticVisitor> | 258 template<typename StaticVisitor> |
259 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( | 259 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( |
260 Heap* heap, RelocInfo* rinfo) { | 260 Heap* heap, RelocInfo* rinfo) { |
261 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); | 261 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); |
262 ASSERT(!rinfo->target_object()->IsConsString()); | 262 ASSERT(!rinfo->target_object()->IsConsString()); |
263 HeapObject* object = HeapObject::cast(rinfo->target_object()); | 263 HeapObject* object = HeapObject::cast(rinfo->target_object()); |
264 if (!FLAG_weak_embedded_maps_in_optimized_code || !FLAG_collect_maps || | 264 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
265 rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION || | 265 if (!Code::IsWeakEmbeddedObject(rinfo->host()->kind(), object)) { |
266 !object->IsMap() || !Map::cast(object)->CanTransition()) { | |
267 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | |
268 StaticVisitor::MarkObject(heap, object); | 266 StaticVisitor::MarkObject(heap, object); |
269 } | 267 } |
270 } | 268 } |
271 | 269 |
272 | 270 |
273 template<typename StaticVisitor> | 271 template<typename StaticVisitor> |
274 void StaticMarkingVisitor<StaticVisitor>::VisitCell( | 272 void StaticMarkingVisitor<StaticVisitor>::VisitCell( |
275 Heap* heap, RelocInfo* rinfo) { | 273 Heap* heap, RelocInfo* rinfo) { |
276 ASSERT(rinfo->rmode() == RelocInfo::CELL); | 274 ASSERT(rinfo->rmode() == RelocInfo::CELL); |
277 Cell* cell = rinfo->target_cell(); | 275 Cell* cell = rinfo->target_cell(); |
(...skipping 605 matching lines...) Loading... |
883 RelocIterator it(this, mode_mask); | 881 RelocIterator it(this, mode_mask); |
884 for (; !it.done(); it.next()) { | 882 for (; !it.done(); it.next()) { |
885 it.rinfo()->template Visit<StaticVisitor>(heap); | 883 it.rinfo()->template Visit<StaticVisitor>(heap); |
886 } | 884 } |
887 } | 885 } |
888 | 886 |
889 | 887 |
890 } } // namespace v8::internal | 888 } } // namespace v8::internal |
891 | 889 |
892 #endif // V8_OBJECTS_VISITING_INL_H_ | 890 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |