Index: src/heap/objects-visiting-inl.h |
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h |
index 8a163c8f01f0d3db82be8fe3604130a6cb836fab..a29ba4b08cc9bc9c6d4401a01f7259946beb6f13 100644 |
--- a/src/heap/objects-visiting-inl.h |
+++ b/src/heap/objects-visiting-inl.h |
@@ -446,6 +446,9 @@ |
if (shared->ic_age() != heap->global_ic_age()) { |
shared->ResetForNewContext(heap->global_ic_age()); |
} |
+ if (FLAG_cleanup_code_caches_at_gc) { |
+ shared->ClearTypeFeedbackInfoAtGCTime(); |
+ } |
if (FLAG_flush_optimized_code_cache) { |
if (!shared->OptimizedCodeMapIsCleared()) { |
// Always flush the optimized code map if requested by flag. |
@@ -476,10 +479,6 @@ |
HeapObject* object) { |
Heap* heap = map->GetHeap(); |
JSFunction* function = JSFunction::cast(object); |
- if (FLAG_cleanup_code_caches_at_gc) { |
- function->ClearTypeFeedbackInfoAtGCTime(); |
- } |
- |
MarkCompactCollector* collector = heap->mark_compact_collector(); |
if (collector->is_code_flushing_enabled()) { |
if (IsFlushable(heap, function)) { |