Index: src/objects-visiting-inl.h |
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h |
index d0a70c3fbf4d921422e9215605511738439e05c1..f83f00fd5d139574a9ccc2a3ab9ae09456794f0d 100644 |
--- a/src/objects-visiting-inl.h |
+++ b/src/objects-visiting-inl.h |
@@ -311,6 +311,12 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( |
if (shared->ic_age() != heap->global_ic_age()) { |
shared->ResetForNewContext(heap->global_ic_age()); |
} |
+ if (FLAG_cache_optimized_code && |
+ FLAG_flush_optimized_code_cache && |
+ !shared->optimized_code_map()->IsSmi()) { |
+ // Always flush the optimized code map if requested by flag. |
+ shared->ClearOptimizedCodeMap(); |
+ } |
MarkCompactCollector* collector = heap->mark_compact_collector(); |
if (collector->is_code_flushing_enabled()) { |
if (FLAG_cache_optimized_code && !shared->optimized_code_map()->IsSmi()) { |