| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_VISITING_INL_H_ | 5 #ifndef V8_OBJECTS_VISITING_INL_H_ |
| 6 #define V8_OBJECTS_VISITING_INL_H_ | 6 #define V8_OBJECTS_VISITING_INL_H_ |
| 7 | 7 |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 template <typename StaticVisitor> | 254 template <typename StaticVisitor> |
| 255 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget(Heap* heap, | 255 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget(Heap* heap, |
| 256 RelocInfo* rinfo) { | 256 RelocInfo* rinfo) { |
| 257 DCHECK(RelocInfo::IsCodeTarget(rinfo->rmode())); | 257 DCHECK(RelocInfo::IsCodeTarget(rinfo->rmode())); |
| 258 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 258 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 259 // Monomorphic ICs are preserved when possible, but need to be flushed | 259 // Monomorphic ICs are preserved when possible, but need to be flushed |
| 260 // when they might be keeping a Context alive, or when the heap is about | 260 // when they might be keeping a Context alive, or when the heap is about |
| 261 // to be serialized. | 261 // to be serialized. |
| 262 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() && | 262 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() && |
| 263 (target->ic_state() == MEGAMORPHIC || target->ic_state() == GENERIC || | 263 (target->ic_state() == MEGAMORPHIC || target->ic_state() == GENERIC || |
| 264 target->ic_state() == POLYMORPHIC || | 264 target->ic_state() == POLYMORPHIC || target->is_call_stub() || |
| 265 (heap->flush_monomorphic_ics() && !target->is_weak_stub()) || | 265 (heap->flush_monomorphic_ics() && !target->is_weak_stub()) || |
| 266 heap->isolate()->serializer_enabled() || | 266 heap->isolate()->serializer_enabled() || |
| 267 target->ic_age() != heap->global_ic_age() || | 267 target->ic_age() != heap->global_ic_age() || |
| 268 target->is_invalidated_weak_stub())) { | 268 target->is_invalidated_weak_stub())) { |
| 269 ICUtility::Clear(heap->isolate(), rinfo->pc(), | 269 TypeFeedbackVector* vector = NULL; |
| 270 FeedbackVectorICSlot slot(FeedbackVectorICSlot::Invalid()); |
| 271 if (target->is_call_stub()) { |
| 272 Object* feedback_info = rinfo->host()->type_feedback_info(); |
| 273 vector = feedback_info->IsTypeFeedbackInfo() |
| 274 ? TypeFeedbackInfo::cast(feedback_info)->feedback_vector() |
| 275 : NULL; |
| 276 slot = FeedbackVectorICSlot(static_cast<unsigned>(rinfo->data())); |
| 277 } |
| 278 ICUtility::Clear(heap->isolate(), rinfo->pc(), vector, slot, |
| 270 rinfo->host()->constant_pool()); | 279 rinfo->host()->constant_pool()); |
| 271 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 280 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 272 } | 281 } |
| 273 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 282 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
| 274 StaticVisitor::MarkObject(heap, target); | 283 StaticVisitor::MarkObject(heap, target); |
| 275 } | 284 } |
| 276 | 285 |
| 277 | 286 |
| 278 template <typename StaticVisitor> | 287 template <typename StaticVisitor> |
| 279 void StaticMarkingVisitor<StaticVisitor>::VisitCodeAgeSequence( | 288 void StaticMarkingVisitor<StaticVisitor>::VisitCodeAgeSequence( |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 | 934 |
| 926 RelocIterator it(this, mode_mask); | 935 RelocIterator it(this, mode_mask); |
| 927 for (; !it.done(); it.next()) { | 936 for (; !it.done(); it.next()) { |
| 928 it.rinfo()->template Visit<StaticVisitor>(heap); | 937 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 929 } | 938 } |
| 930 } | 939 } |
| 931 } | 940 } |
| 932 } // namespace v8::internal | 941 } // namespace v8::internal |
| 933 | 942 |
| 934 #endif // V8_OBJECTS_VISITING_INL_H_ | 943 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |