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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( | 305 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( |
306 Heap* heap, RelocInfo* rinfo) { | 306 Heap* heap, RelocInfo* rinfo) { |
307 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 307 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
308 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 308 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
309 // Monomorphic ICs are preserved when possible, but need to be flushed | 309 // Monomorphic ICs are preserved when possible, but need to be flushed |
310 // when they might be keeping a Context alive, or when the heap is about | 310 // when they might be keeping a Context alive, or when the heap is about |
311 // to be serialized. | 311 // to be serialized. |
312 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() | 312 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
313 && (target->ic_state() == MEGAMORPHIC || target->ic_state() == GENERIC || | 313 && (target->ic_state() == MEGAMORPHIC || target->ic_state() == GENERIC || |
314 target->ic_state() == POLYMORPHIC || heap->flush_monomorphic_ics() || | 314 target->ic_state() == POLYMORPHIC || heap->flush_monomorphic_ics() || |
315 Serializer::enabled() || target->ic_age() != heap->global_ic_age())) { | 315 Serializer::enabled() || target->ic_age() != heap->global_ic_age() || |
| 316 target->is_invalidated_weak_stub())) { |
316 IC::Clear(target->GetIsolate(), rinfo->pc(), | 317 IC::Clear(target->GetIsolate(), rinfo->pc(), |
317 rinfo->host()->constant_pool()); | 318 rinfo->host()->constant_pool()); |
318 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 319 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
319 } | 320 } |
320 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 321 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
321 StaticVisitor::MarkObject(heap, target); | 322 StaticVisitor::MarkObject(heap, target); |
322 } | 323 } |
323 | 324 |
324 | 325 |
325 template<typename StaticVisitor> | 326 template<typename StaticVisitor> |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 Object** slot = HeapObject::RawField(map, Map::kDependentCodeOffset); | 650 Object** slot = HeapObject::RawField(map, Map::kDependentCodeOffset); |
650 HeapObject* obj = HeapObject::cast(*slot); | 651 HeapObject* obj = HeapObject::cast(*slot); |
651 heap->mark_compact_collector()->RecordSlot(slot, slot, obj); | 652 heap->mark_compact_collector()->RecordSlot(slot, slot, obj); |
652 StaticVisitor::MarkObjectWithoutPush(heap, obj); | 653 StaticVisitor::MarkObjectWithoutPush(heap, obj); |
653 | 654 |
654 // Mark the pointer fields of the Map. Since the transitions array has | 655 // Mark the pointer fields of the Map. Since the transitions array has |
655 // been marked already, it is fine that one of these fields contains a | 656 // been marked already, it is fine that one of these fields contains a |
656 // pointer to it. | 657 // pointer to it. |
657 StaticVisitor::VisitPointers(heap, | 658 StaticVisitor::VisitPointers(heap, |
658 HeapObject::RawField(map, Map::kPointerFieldsBeginOffset), | 659 HeapObject::RawField(map, Map::kPointerFieldsBeginOffset), |
659 HeapObject::RawField(map, Map::kPointerFieldsEndOffset)); | 660 HeapObject::RawField(map, Map::kFirstWeakFieldOffset)); |
660 } | 661 } |
661 | 662 |
662 | 663 |
663 template<typename StaticVisitor> | 664 template<typename StaticVisitor> |
664 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( | 665 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( |
665 Heap* heap, TransitionArray* transitions) { | 666 Heap* heap, TransitionArray* transitions) { |
666 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; | 667 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; |
667 | 668 |
668 // Simple transitions do not have keys nor prototype transitions. | 669 // Simple transitions do not have keys nor prototype transitions. |
669 if (transitions->IsSimpleTransition()) return; | 670 if (transitions->IsSimpleTransition()) return; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 RelocIterator it(this, mode_mask); | 946 RelocIterator it(this, mode_mask); |
946 for (; !it.done(); it.next()) { | 947 for (; !it.done(); it.next()) { |
947 it.rinfo()->template Visit<StaticVisitor>(heap); | 948 it.rinfo()->template Visit<StaticVisitor>(heap); |
948 } | 949 } |
949 } | 950 } |
950 | 951 |
951 | 952 |
952 } } // namespace v8::internal | 953 } } // namespace v8::internal |
953 | 954 |
954 #endif // V8_OBJECTS_VISITING_INL_H_ | 955 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |