Chromium Code Reviews| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 | 214 |
| 215 table_.Register(kVisitJSDataView, &VisitJSDataView); | 215 table_.Register(kVisitJSDataView, &VisitJSDataView); |
| 216 | 216 |
| 217 // Registration for kVisitJSRegExp is done by StaticVisitor. | 217 // Registration for kVisitJSRegExp is done by StaticVisitor. |
| 218 | 218 |
| 219 table_.Register(kVisitCell, | 219 table_.Register(kVisitCell, |
| 220 &FixedBodyVisitor<StaticVisitor, | 220 &FixedBodyVisitor<StaticVisitor, |
| 221 Cell::BodyDescriptor, | 221 Cell::BodyDescriptor, |
| 222 void>::Visit); | 222 void>::Visit); |
| 223 | 223 |
| 224 table_.Register(kVisitPropertyCell, | 224 table_.Register(kVisitPropertyCell, &VisitPropertyCell); |
| 225 &FixedBodyVisitor<StaticVisitor, | |
| 226 PropertyCell::BodyDescriptor, | |
| 227 void>::Visit); | |
| 228 | 225 |
| 229 table_.template RegisterSpecializations<DataObjectVisitor, | 226 table_.template RegisterSpecializations<DataObjectVisitor, |
| 230 kVisitDataObject, | 227 kVisitDataObject, |
| 231 kVisitDataObjectGeneric>(); | 228 kVisitDataObjectGeneric>(); |
| 232 | 229 |
| 233 table_.template RegisterSpecializations<JSObjectVisitor, | 230 table_.template RegisterSpecializations<JSObjectVisitor, |
| 234 kVisitJSObject, | 231 kVisitJSObject, |
| 235 kVisitJSObjectGeneric>(); | 232 kVisitJSObjectGeneric>(); |
| 236 | 233 |
| 237 table_.template RegisterSpecializations<StructObjectVisitor, | 234 table_.template RegisterSpecializations<StructObjectVisitor, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 MarkMapContents(heap, map_object); | 349 MarkMapContents(heap, map_object); |
| 353 } else { | 350 } else { |
| 354 StaticVisitor::VisitPointers(heap, | 351 StaticVisitor::VisitPointers(heap, |
| 355 HeapObject::RawField(object, Map::kPointerFieldsBeginOffset), | 352 HeapObject::RawField(object, Map::kPointerFieldsBeginOffset), |
| 356 HeapObject::RawField(object, Map::kPointerFieldsEndOffset)); | 353 HeapObject::RawField(object, Map::kPointerFieldsEndOffset)); |
| 357 } | 354 } |
| 358 } | 355 } |
| 359 | 356 |
| 360 | 357 |
| 361 template<typename StaticVisitor> | 358 template<typename StaticVisitor> |
| 359 void StaticMarkingVisitor<StaticVisitor>::VisitPropertyCell( | |
| 360 Map* map, HeapObject* object) { | |
| 361 Heap* heap = map->GetHeap(); | |
| 362 | |
| 363 // Mark property cell dependent codes array but do not push it onto marking | |
| 364 // stack, this will make references from it weak. We will clean dead | |
| 365 // codes when we iterate over property cells in | |
| 366 // ClearNonLivePropertyCellCodeDependencies. | |
|
Michael Starzinger
2013/06/26 15:23:31
nit: Comment is outdated, the function is called C
Michael Starzinger
2013/06/26 15:32:04
Also the cleanup pass is only done with FLAG_colle
danno
2013/06/26 15:42:40
Done.
danno
2013/06/26 15:42:40
Done.
| |
| 367 Object** slot = | |
| 368 HeapObject::RawField(object, PropertyCell::kDependentCodeOffset); | |
| 369 HeapObject* obj = HeapObject::cast(*slot); | |
| 370 heap->mark_compact_collector()->RecordSlot(slot, slot, obj); | |
| 371 StaticVisitor::MarkObjectWithoutPush(heap, obj); | |
| 372 | |
| 373 StaticVisitor::VisitPointers(heap, | |
| 374 HeapObject::RawField(object, PropertyCell::kPointerFieldsBeginOffset), | |
| 375 HeapObject::RawField(object, PropertyCell::kPointerFieldsEndOffset)); | |
| 376 } | |
| 377 | |
| 378 | |
| 379 template<typename StaticVisitor> | |
| 362 void StaticMarkingVisitor<StaticVisitor>::VisitCode( | 380 void StaticMarkingVisitor<StaticVisitor>::VisitCode( |
| 363 Map* map, HeapObject* object) { | 381 Map* map, HeapObject* object) { |
| 364 Heap* heap = map->GetHeap(); | 382 Heap* heap = map->GetHeap(); |
| 365 Code* code = Code::cast(object); | 383 Code* code = Code::cast(object); |
| 366 if (FLAG_cleanup_code_caches_at_gc) { | 384 if (FLAG_cleanup_code_caches_at_gc) { |
| 367 code->ClearTypeFeedbackCells(heap); | 385 code->ClearTypeFeedbackCells(heap); |
| 368 } | 386 } |
| 369 if (FLAG_age_code && !Serializer::enabled()) { | 387 if (FLAG_age_code && !Serializer::enabled()) { |
| 370 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); | 388 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); |
| 371 } | 389 } |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 RelocIterator it(this, mode_mask); | 870 RelocIterator it(this, mode_mask); |
| 853 for (; !it.done(); it.next()) { | 871 for (; !it.done(); it.next()) { |
| 854 it.rinfo()->template Visit<StaticVisitor>(heap); | 872 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 855 } | 873 } |
| 856 } | 874 } |
| 857 | 875 |
| 858 | 876 |
| 859 } } // namespace v8::internal | 877 } } // namespace v8::internal |
| 860 | 878 |
| 861 #endif // V8_OBJECTS_VISITING_INL_H_ | 879 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |