Index: src/objects-visiting-inl.h |
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h |
index f2b0e243e3e52b5be31c61f270abd9300d78c069..3b9dc7d2fc6c84fac148b311d98c7d72ddb62bd6 100644 |
--- a/src/objects-visiting-inl.h |
+++ b/src/objects-visiting-inl.h |
@@ -217,9 +217,8 @@ void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( |
// when they might be keeping a Context alive, or when the heap is about |
// to be serialized. |
if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
- && (target->ic_state() == MEGAMORPHIC || Serializer::enabled() || |
- heap->isolate()->context_exit_happened() || |
- target->ic_age() != heap->global_ic_age())) { |
+ && (target->ic_state() == MEGAMORPHIC || heap->flush_monomorphic_ics() || |
+ Serializer::enabled() || target->ic_age() != heap->global_ic_age())) { |
IC::Clear(rinfo->pc()); |
target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
} |