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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 kVisitDataObject, | 227 kVisitDataObject, |
228 kVisitDataObjectGeneric>(); | 228 kVisitDataObjectGeneric>(); |
229 | 229 |
230 table_.template RegisterSpecializations<JSObjectVisitor, | 230 table_.template RegisterSpecializations<JSObjectVisitor, |
231 kVisitJSObject, | 231 kVisitJSObject, |
232 kVisitJSObjectGeneric>(); | 232 kVisitJSObjectGeneric>(); |
233 | 233 |
234 table_.template RegisterSpecializations<StructObjectVisitor, | 234 table_.template RegisterSpecializations<StructObjectVisitor, |
235 kVisitStruct, | 235 kVisitStruct, |
236 kVisitStructGeneric>(); | 236 kVisitStructGeneric>(); |
237 | |
238 table_.Register(kVisitAllocationSite, &VisitAllocationSite); | |
Michael Starzinger
2013/07/16 18:14:46
nit: Move the registration of this visitor up to a
mvstanton
2013/07/16 19:34:57
Done.
| |
237 } | 239 } |
238 | 240 |
239 | 241 |
240 template<typename StaticVisitor> | 242 template<typename StaticVisitor> |
241 void StaticMarkingVisitor<StaticVisitor>::VisitCodeEntry( | 243 void StaticMarkingVisitor<StaticVisitor>::VisitCodeEntry( |
242 Heap* heap, Address entry_address) { | 244 Heap* heap, Address entry_address) { |
243 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); | 245 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); |
244 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code); | 246 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code); |
245 StaticVisitor::MarkObject(heap, code); | 247 StaticVisitor::MarkObject(heap, code); |
246 } | 248 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
326 idx < Context::NATIVE_CONTEXT_SLOTS; | 328 idx < Context::NATIVE_CONTEXT_SLOTS; |
327 ++idx) { | 329 ++idx) { |
328 Object** slot = | 330 Object** slot = |
329 HeapObject::RawField(object, FixedArray::OffsetOfElementAt(idx)); | 331 HeapObject::RawField(object, FixedArray::OffsetOfElementAt(idx)); |
330 collector->RecordSlot(slot, slot, *slot); | 332 collector->RecordSlot(slot, slot, *slot); |
331 } | 333 } |
332 } | 334 } |
333 | 335 |
334 | 336 |
335 template<typename StaticVisitor> | 337 template<typename StaticVisitor> |
338 void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite( | |
Michael Starzinger
2013/07/16 18:14:46
Having this separate visitor function is obsolete,
mvstanton
2013/07/16 19:34:57
Done.
| |
339 Map* map, HeapObject* object) { | |
340 FixedBodyVisitor<StaticVisitor, | |
341 AllocationSite::BodyDescriptor, | |
342 void>::Visit(map, object); | |
343 } | |
344 | |
345 | |
346 template<typename StaticVisitor> | |
336 void StaticMarkingVisitor<StaticVisitor>::VisitMap( | 347 void StaticMarkingVisitor<StaticVisitor>::VisitMap( |
337 Map* map, HeapObject* object) { | 348 Map* map, HeapObject* object) { |
338 Heap* heap = map->GetHeap(); | 349 Heap* heap = map->GetHeap(); |
339 Map* map_object = Map::cast(object); | 350 Map* map_object = Map::cast(object); |
340 | 351 |
341 // Clears the cache of ICs related to this map. | 352 // Clears the cache of ICs related to this map. |
342 if (FLAG_cleanup_code_caches_at_gc) { | 353 if (FLAG_cleanup_code_caches_at_gc) { |
343 map_object->ClearCodeCache(heap); | 354 map_object->ClearCodeCache(heap); |
344 } | 355 } |
345 | 356 |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
873 RelocIterator it(this, mode_mask); | 884 RelocIterator it(this, mode_mask); |
874 for (; !it.done(); it.next()) { | 885 for (; !it.done(); it.next()) { |
875 it.rinfo()->template Visit<StaticVisitor>(heap); | 886 it.rinfo()->template Visit<StaticVisitor>(heap); |
876 } | 887 } |
877 } | 888 } |
878 | 889 |
879 | 890 |
880 } } // namespace v8::internal | 891 } } // namespace v8::internal |
881 | 892 |
882 #endif // V8_OBJECTS_VISITING_INL_H_ | 893 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |