| 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 || heap->flush_monomorphic_ics() || | 220 && (target->ic_state() == MEGAMORPHIC || Serializer::enabled() || |
| 221 Serializer::enabled() || target->ic_age() != heap->global_ic_age())) { | 221 heap->isolate()->context_exit_happened() || |
| 222 target->ic_age() != heap->global_ic_age())) { |
| 222 IC::Clear(rinfo->pc()); | 223 IC::Clear(rinfo->pc()); |
| 223 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 224 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 224 } | 225 } |
| 225 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 226 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
| 226 StaticVisitor::MarkObject(heap, target); | 227 StaticVisitor::MarkObject(heap, target); |
| 227 } | 228 } |
| 228 | 229 |
| 229 | 230 |
| 230 template<typename StaticVisitor> | 231 template<typename StaticVisitor> |
| 231 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( | 232 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 RelocIterator it(this, mode_mask); | 320 RelocIterator it(this, mode_mask); |
| 320 for (; !it.done(); it.next()) { | 321 for (; !it.done(); it.next()) { |
| 321 it.rinfo()->template Visit<StaticVisitor>(heap); | 322 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 322 } | 323 } |
| 323 } | 324 } |
| 324 | 325 |
| 325 | 326 |
| 326 } } // namespace v8::internal | 327 } } // namespace v8::internal |
| 327 | 328 |
| 328 #endif // V8_OBJECTS_VISITING_INL_H_ | 329 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |