Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index d488fc05e87c7c7902494e1f9646be9d65cd00cb..9c65e1e99998a9f02c7e8543c9f007d19901c63a 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -5112,6 +5112,11 @@ void JSFunction::ReplaceCode(Code* code) { |
bool was_optimized = IsOptimized(); |
bool is_optimized = code->kind() == Code::OPTIMIZED_FUNCTION; |
+ if (was_optimized && is_optimized) { |
+ shared()->EvictFromOptimizedCodeMap( |
+ this->code(), "Replacing with another optimized code"); |
+ } |
+ |
set_code(code); |
// Add/remove the function from the list of optimized functions for this |