Index: src/runtime/runtime-compiler.cc |
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc |
index f929d736977e08dc256537817c41fecc22825e19..f9384232709fe0075b37b7dca06b7260813d472a 100644 |
--- a/src/runtime/runtime-compiler.cc |
+++ b/src/runtime/runtime-compiler.cc |
@@ -213,14 +213,9 @@ RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) { |
isolate->thread_manager()->IterateArchivedThreads(&activations_finder); |
if (!activations_finder.has_code_activations_) { |
- if (function->code() == *optimized_code) { |
- if (FLAG_trace_deopt) { |
- PrintF("[removing optimized code for: "); |
- function->PrintName(); |
- PrintF("]\n"); |
- } |
- function->ReplaceCode(function->shared()->code()); |
- } |
+ Deoptimizer::UnlinkOptimizedCode(*optimized_code, |
+ function->context()->native_context()); |
+ |
// Evict optimized code for this function from the cache so that it |
// doesn't get used for new closures. |
function->shared()->EvictFromOptimizedCodeMap(*optimized_code, |