Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 99dcec472d51fe580fbdfec14da7ec779a60e697..29ccacf42138c66421b81bd8c3fa2c489e8fe040 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -7873,6 +7873,11 @@ void SharedFunctionInfo::ResetForNewContext(int new_ic_age) { |
code()->ClearInlineCaches(); |
code()->set_profiler_ticks(0); |
set_ic_age(new_ic_age); |
+ if (optimization_disabled() && opt_count() >= Compiler::kDefaultMaxOptCount) { |
+ // Re-enable optimizations if they were disabled due to opt_count limit. |
+ set_optimization_disabled(false); |
+ code()->set_optimizable(true); |
+ } |
set_opt_count(0); |
} |