OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_VISITING_INL_H_ | 5 #ifndef V8_OBJECTS_VISITING_INL_H_ |
6 #define V8_OBJECTS_VISITING_INL_H_ | 6 #define V8_OBJECTS_VISITING_INL_H_ |
7 | 7 |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); | 230 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); |
231 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code); | 231 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code); |
232 StaticVisitor::MarkObject(heap, code); | 232 StaticVisitor::MarkObject(heap, code); |
233 } | 233 } |
234 | 234 |
235 | 235 |
236 template<typename StaticVisitor> | 236 template<typename StaticVisitor> |
237 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( | 237 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( |
238 Heap* heap, RelocInfo* rinfo) { | 238 Heap* heap, RelocInfo* rinfo) { |
239 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); | 239 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); |
240 ASSERT(!rinfo->target_object()->IsConsString()); | |
241 HeapObject* object = HeapObject::cast(rinfo->target_object()); | 240 HeapObject* object = HeapObject::cast(rinfo->target_object()); |
242 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 241 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
243 // TODO(ulan): It could be better to record slots only for strongly embedded | 242 // TODO(ulan): It could be better to record slots only for strongly embedded |
244 // objects here and record slots for weakly embedded object during clearing | 243 // objects here and record slots for weakly embedded object during clearing |
245 // of non-live references in mark-compact. | 244 // of non-live references in mark-compact. |
246 if (!rinfo->host()->IsWeakObject(object)) { | 245 if (!rinfo->host()->IsWeakObject(object)) { |
247 StaticVisitor::MarkObject(heap, object); | 246 StaticVisitor::MarkObject(heap, object); |
248 } | 247 } |
249 } | 248 } |
250 | 249 |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 RelocIterator it(this, mode_mask); | 959 RelocIterator it(this, mode_mask); |
961 for (; !it.done(); it.next()) { | 960 for (; !it.done(); it.next()) { |
962 it.rinfo()->template Visit<StaticVisitor>(heap); | 961 it.rinfo()->template Visit<StaticVisitor>(heap); |
963 } | 962 } |
964 } | 963 } |
965 | 964 |
966 | 965 |
967 } } // namespace v8::internal | 966 } } // namespace v8::internal |
968 | 967 |
969 #endif // V8_OBJECTS_VISITING_INL_H_ | 968 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |