Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index e12d0ba3c40d0d064399c916175a1dbbf84a48bc..245e8f375a3a14be596a3850732f8e7d21aa0773 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -11397,13 +11397,15 @@ void DependentCode::DeoptimizeDependentCodeGroup( |
int code_entries = starts.number_of_entries(); |
if (start == end) return; |
- // Collect all the code to deoptimize. |
- Zone zone(isolate); |
- ZoneList<Code*> codes(end - start, &zone); |
+ // Mark all the code that needs to be deoptimized. |
+ bool marked = false; |
for (int i = start; i < end; i++) { |
if (is_code_at(i)) { |
Code* code = code_at(i); |
- if (!code->marked_for_deoptimization()) codes.Add(code, &zone); |
+ if (!code->marked_for_deoptimization()) { |
+ code->set_marked_for_deoptimization(true); |
+ marked = true; |
+ } |
} else { |
CompilationInfo* info = compilation_info_at(i); |
info->AbortDueToDependencyChange(); |
@@ -11419,7 +11421,8 @@ void DependentCode::DeoptimizeDependentCodeGroup( |
clear_at(i); |
} |
set_number_of_entries(group, 0); |
- Deoptimizer::DeoptimizeCodeList(isolate, &codes); |
+ |
+ if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate); |
} |