Index: src/ia32/deoptimizer-ia32.cc |
diff --git a/src/ia32/deoptimizer-ia32.cc b/src/ia32/deoptimizer-ia32.cc |
index f50010b9d97b884e2dda6109b5bf9e43ca8c7fd8..99ad5225bc0bada7edb634e15935f9647fd92e7f 100644 |
--- a/src/ia32/deoptimizer-ia32.cc |
+++ b/src/ia32/deoptimizer-ia32.cc |
@@ -198,19 +198,7 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) { |
// ignore all slots that might have been recorded on it. |
isolate->heap()->mark_compact_collector()->InvalidateCode(code); |
- // Iterate over all the functions which share the same code object |
- // and make them use unoptimized version. |
- Context* context = function->context()->native_context(); |
- Object* element = context->get(Context::OPTIMIZED_FUNCTIONS_LIST); |
- SharedFunctionInfo* shared = function->shared(); |
- while (!element->IsUndefined()) { |
- JSFunction* func = JSFunction::cast(element); |
- // Grab element before code replacement as ReplaceCode alters the list. |
- element = func->next_function_link(); |
- if (func->code() == code) { |
- func->ReplaceCode(shared->code()); |
- } |
- } |
+ ReplaceCodeForRelatedFunctions(function, code); |
if (FLAG_trace_deopt) { |
PrintF("[forced deoptimization: "); |