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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( | 324 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( |
325 Map* map, HeapObject* object) { | 325 Map* map, HeapObject* object) { |
326 FixedBodyVisitor<StaticVisitor, | 326 FixedBodyVisitor<StaticVisitor, |
327 Context::MarkCompactBodyDescriptor, | 327 Context::MarkCompactBodyDescriptor, |
328 void>::Visit(map, object); | 328 void>::Visit(map, object); |
329 | 329 |
330 MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector(); | 330 MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector(); |
331 for (int idx = Context::FIRST_WEAK_SLOT; | 331 for (int idx = Context::FIRST_WEAK_SLOT; |
332 idx < Context::NATIVE_CONTEXT_SLOTS; | 332 idx < Context::NATIVE_CONTEXT_SLOTS; |
333 ++idx) { | 333 ++idx) { |
334 Object** slot = | 334 Object** slot = Context::cast(object)->RawFieldOfElementAt(idx); |
335 HeapObject::RawField(object, FixedArray::OffsetOfElementAt(idx)); | |
336 collector->RecordSlot(slot, slot, *slot); | 335 collector->RecordSlot(slot, slot, *slot); |
337 } | 336 } |
338 } | 337 } |
339 | 338 |
340 | 339 |
341 template<typename StaticVisitor> | 340 template<typename StaticVisitor> |
342 void StaticMarkingVisitor<StaticVisitor>::VisitMap( | 341 void StaticMarkingVisitor<StaticVisitor>::VisitMap( |
343 Map* map, HeapObject* object) { | 342 Map* map, HeapObject* object) { |
344 Heap* heap = map->GetHeap(); | 343 Heap* heap = map->GetHeap(); |
345 Map* map_object = Map::cast(object); | 344 Map* map_object = Map::cast(object); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 RelocIterator it(this, mode_mask); | 920 RelocIterator it(this, mode_mask); |
922 for (; !it.done(); it.next()) { | 921 for (; !it.done(); it.next()) { |
923 it.rinfo()->template Visit<StaticVisitor>(heap); | 922 it.rinfo()->template Visit<StaticVisitor>(heap); |
924 } | 923 } |
925 } | 924 } |
926 | 925 |
927 | 926 |
928 } } // namespace v8::internal | 927 } } // namespace v8::internal |
929 | 928 |
930 #endif // V8_OBJECTS_VISITING_INL_H_ | 929 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |