Index: src/heap/objects-visiting-inl.h |
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h |
index 4b8e27d450e6a8d76b4216d882590ef0879aa867..86f6d01940a0c7b9126e439a8b1392ca71ae51da 100644 |
--- a/src/heap/objects-visiting-inl.h |
+++ b/src/heap/objects-visiting-inl.h |
@@ -443,23 +443,23 @@ |
if (FLAG_cleanup_code_caches_at_gc) { |
shared->ClearTypeFeedbackInfoAtGCTime(); |
} |
- if (FLAG_flush_optimized_code_cache || |
- heap->isolate()->serializer_enabled()) { |
+ if ((FLAG_flush_optimized_code_cache || |
+ heap->isolate()->serializer_enabled()) && |
+ !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 (!shared->optimized_code_map()->IsSmi()) { |
- // Always flush the optimized code map if requested by flag. |
- shared->ClearOptimizedCodeMap(); |
- } |
- } else { |
- if (!shared->optimized_code_map()->IsSmi()) { |
+ // Add the shared function info holding an optimized code map to |
+ // the code flusher for processing of code maps after marking. |
+ collector->code_flusher()->AddOptimizedCodeMap(shared); |
// Treat some references within the code map weakly by marking the |
- // code map itself but not pushing it onto the marking deque. The |
- // map will be processed after marking. |
+ // code map itself but not pushing it onto the marking deque. |
FixedArray* code_map = FixedArray::cast(shared->optimized_code_map()); |
MarkOptimizedCodeMap(heap, code_map); |
} |
- } |
- MarkCompactCollector* collector = heap->mark_compact_collector(); |
- if (collector->is_code_flushing_enabled()) { |
if (IsFlushable(heap, shared)) { |
// This function's code looks flushable. But we have to postpone |
// the decision until we see all functions that point to the same |
@@ -473,7 +473,6 @@ |
return; |
} |
} else { |
- // TODO(mstarzinger): Drop this case, it shouldn't be done here! |
if (!shared->optimized_code_map()->IsSmi()) { |
// Flush optimized code map on major GCs without code flushing, |
// needed because cached code doesn't contain breakpoints. |