| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 279 |
| 280 | 280 |
| 281 template<typename StaticVisitor> | 281 template<typename StaticVisitor> |
| 282 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( | 282 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( |
| 283 Heap* heap, RelocInfo* rinfo) { | 283 Heap* heap, RelocInfo* rinfo) { |
| 284 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 284 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
| 285 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 285 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 286 // Monomorphic ICs are preserved when possible, but need to be flushed | 286 // Monomorphic ICs are preserved when possible, but need to be flushed |
| 287 // when they might be keeping a Context alive, or when the heap is about | 287 // when they might be keeping a Context alive, or when the heap is about |
| 288 // to be serialized. | 288 // to be serialized. |
| 289 |
| 289 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() | 290 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
| 290 && (target->ic_state() == MEGAMORPHIC || target->ic_state() == GENERIC || | 291 && (target->ic_state() == MEGAMORPHIC || target->ic_state() == GENERIC || |
| 291 target->ic_state() == POLYMORPHIC || heap->flush_monomorphic_ics() || | 292 target->ic_state() == POLYMORPHIC || heap->flush_monomorphic_ics() || |
| 292 Serializer::enabled(heap->isolate()) || | 293 Serializer::enabled(heap->isolate()) || |
| 293 target->ic_age() != heap->global_ic_age() || | 294 target->ic_age() != heap->global_ic_age() || |
| 294 target->is_invalidated_weak_stub())) { | 295 target->is_invalidated_weak_stub())) { |
| 295 IC::Clear(heap->isolate(), rinfo->pc(), rinfo->host()->constant_pool()); | 296 IC::Clear(heap->isolate(), rinfo->pc(), rinfo->host()->constant_pool()); |
| 296 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 297 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 297 } | 298 } |
| 298 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 299 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 RelocIterator it(this, mode_mask); | 932 RelocIterator it(this, mode_mask); |
| 932 for (; !it.done(); it.next()) { | 933 for (; !it.done(); it.next()) { |
| 933 it.rinfo()->template Visit<StaticVisitor>(heap); | 934 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 934 } | 935 } |
| 935 } | 936 } |
| 936 | 937 |
| 937 | 938 |
| 938 } } // namespace v8::internal | 939 } } // namespace v8::internal |
| 939 | 940 |
| 940 #endif // V8_OBJECTS_VISITING_INL_H_ | 941 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |