| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index f3980573d0f7a051f45ecb17914799e5d66a5c32..7b455bfe385dae41e496428249fd58bc8595fe8b 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -13517,8 +13517,15 @@ void SharedFunctionInfo::ResetForNewContext(int new_ic_age) {
|
| set_ic_age(new_ic_age);
|
| if (code()->kind() == Code::FUNCTION) {
|
| code()->set_profiler_ticks(0);
|
| - if (optimization_disabled() &&
|
| - opt_count() >= FLAG_max_opt_count) {
|
| + if (optimization_disabled() && opt_count() >= FLAG_max_opt_count) {
|
| + // Re-enable optimizations if they were disabled due to opt_count limit.
|
| + set_optimization_disabled(false);
|
| + }
|
| + set_opt_count(0);
|
| + set_deopt_count(0);
|
| + } else if (code()->is_interpreter_entry_trampoline()) {
|
| + set_profiler_ticks(0);
|
| + if (optimization_disabled() && opt_count() >= FLAG_max_opt_count) {
|
| // Re-enable optimizations if they were disabled due to opt_count limit.
|
| set_optimization_disabled(false);
|
| }
|
|
|