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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 template<typename StaticVisitor> | 263 template<typename StaticVisitor> |
264 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( | 264 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( |
265 Heap* heap, RelocInfo* rinfo) { | 265 Heap* heap, RelocInfo* rinfo) { |
266 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); | 266 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); |
267 ASSERT(!rinfo->target_object()->IsConsString()); | 267 ASSERT(!rinfo->target_object()->IsConsString()); |
268 HeapObject* object = HeapObject::cast(rinfo->target_object()); | 268 HeapObject* object = HeapObject::cast(rinfo->target_object()); |
269 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 269 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
270 // TODO(ulan): It could be better to record slots only for strongly embedded | 270 // TODO(ulan): It could be better to record slots only for strongly embedded |
271 // objects here and record slots for weakly embedded object during clearing | 271 // objects here and record slots for weakly embedded object during clearing |
272 // of non-live references in mark-compact. | 272 // of non-live references in mark-compact. |
273 if (!Code::IsWeakEmbeddedObject(rinfo->host()->kind(), object)) { | 273 if (!rinfo->host()->IsWeakObject(object)) { |
274 StaticVisitor::MarkObject(heap, object); | 274 StaticVisitor::MarkObject(heap, object); |
275 } | 275 } |
276 } | 276 } |
277 | 277 |
278 | 278 |
279 template<typename StaticVisitor> | 279 template<typename StaticVisitor> |
280 void StaticMarkingVisitor<StaticVisitor>::VisitCell( | 280 void StaticMarkingVisitor<StaticVisitor>::VisitCell( |
281 Heap* heap, RelocInfo* rinfo) { | 281 Heap* heap, RelocInfo* rinfo) { |
282 ASSERT(rinfo->rmode() == RelocInfo::CELL); | 282 ASSERT(rinfo->rmode() == RelocInfo::CELL); |
283 Cell* cell = rinfo->target_cell(); | 283 Cell* cell = rinfo->target_cell(); |
284 // No need to record slots because the cell space is not compacted during GC. | 284 // No need to record slots because the cell space is not compacted during GC. |
285 if (!Code::IsWeakEmbeddedObject(rinfo->host()->kind(), cell)) { | 285 if (!rinfo->host()->IsWeakObject(cell)) { |
286 StaticVisitor::MarkObject(heap, cell); | 286 StaticVisitor::MarkObject(heap, cell); |
287 } | 287 } |
288 } | 288 } |
289 | 289 |
290 | 290 |
291 template<typename StaticVisitor> | 291 template<typename StaticVisitor> |
292 void StaticMarkingVisitor<StaticVisitor>::VisitDebugTarget( | 292 void StaticMarkingVisitor<StaticVisitor>::VisitDebugTarget( |
293 Heap* heap, RelocInfo* rinfo) { | 293 Heap* heap, RelocInfo* rinfo) { |
294 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 294 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
295 rinfo->IsPatchedReturnSequence()) || | 295 rinfo->IsPatchedReturnSequence()) || |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 RelocIterator it(this, mode_mask); | 940 RelocIterator it(this, mode_mask); |
941 for (; !it.done(); it.next()) { | 941 for (; !it.done(); it.next()) { |
942 it.rinfo()->template Visit<StaticVisitor>(heap); | 942 it.rinfo()->template Visit<StaticVisitor>(heap); |
943 } | 943 } |
944 } | 944 } |
945 | 945 |
946 | 946 |
947 } } // namespace v8::internal | 947 } } // namespace v8::internal |
948 | 948 |
949 #endif // V8_OBJECTS_VISITING_INL_H_ | 949 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |