Index: src/x64/deoptimizer-x64.cc |
diff --git a/src/x64/deoptimizer-x64.cc b/src/x64/deoptimizer-x64.cc |
index 36280ec8b4d516758f44a7a96e16af00fe6ecf14..927496c458a09d7be1e9ffa5afc18d649ccfbce8 100644 |
--- a/src/x64/deoptimizer-x64.cc |
+++ b/src/x64/deoptimizer-x64.cc |
@@ -55,13 +55,12 @@ void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( |
ASSERT(function->IsOptimized()); |
ASSERT(function->FunctionsInFunctionListShareSameCode()); |
- // The optimized code is going to be patched, so we cannot use it |
- // any more. Play safe and reset the whole cache. |
- function->shared()->ClearOptimizedCodeMap("deoptimized function"); |
- |
// Get the optimized code. |
Code* code = function->code(); |
+ // The optimized code is going to be patched, so we cannot use it any more. |
+ function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function"); |
+ |
// Invalidate the relocation information, as it will become invalid by the |
// code patching below, and is not needed any more. |
code->InvalidateRelocation(); |