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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 template<typename StaticVisitor> | 211 template<typename StaticVisitor> |
212 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( | 212 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( |
213 Heap* heap, RelocInfo* rinfo) { | 213 Heap* heap, RelocInfo* rinfo) { |
214 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 214 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
215 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 215 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
216 // Monomorphic ICs are preserved when possible, but need to be flushed | 216 // Monomorphic ICs are preserved when possible, but need to be flushed |
217 // when they might be keeping a Context alive, or when the heap is about | 217 // when they might be keeping a Context alive, or when the heap is about |
218 // to be serialized. | 218 // to be serialized. |
219 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() | 219 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
220 && (target->ic_state() == MEGAMORPHIC || Serializer::enabled() || | 220 && (target->ic_state() == MEGAMORPHIC || heap->flush_monomorphic_ics() || |
221 heap->isolate()->context_exit_happened() || | 221 Serializer::enabled() || target->ic_age() != heap->global_ic_age())) { |
222 target->ic_age() != heap->global_ic_age())) { | |
223 IC::Clear(rinfo->pc()); | 222 IC::Clear(rinfo->pc()); |
224 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 223 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
225 } | 224 } |
226 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 225 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
227 StaticVisitor::MarkObject(heap, target); | 226 StaticVisitor::MarkObject(heap, target); |
228 } | 227 } |
229 | 228 |
230 | 229 |
231 template<typename StaticVisitor> | 230 template<typename StaticVisitor> |
232 void StaticMarkingVisitor<StaticVisitor>::VisitGlobalContext( | 231 void StaticMarkingVisitor<StaticVisitor>::VisitGlobalContext( |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 RelocIterator it(this, mode_mask); | 319 RelocIterator it(this, mode_mask); |
321 for (; !it.done(); it.next()) { | 320 for (; !it.done(); it.next()) { |
322 it.rinfo()->template Visit<StaticVisitor>(heap); | 321 it.rinfo()->template Visit<StaticVisitor>(heap); |
323 } | 322 } |
324 } | 323 } |
325 | 324 |
326 | 325 |
327 } } // namespace v8::internal | 326 } } // namespace v8::internal |
328 | 327 |
329 #endif // V8_OBJECTS_VISITING_INL_H_ | 328 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |