| Index: src/factory.cc
|
| diff --git a/src/factory.cc b/src/factory.cc
|
| index cccc3e76297b20a2ade4272efcd978e7d0c2f06b..7d383551fc8c4fb9f2ba0e3aa23b6eca3ff30016 100644
|
| --- a/src/factory.cc
|
| +++ b/src/factory.cc
|
| @@ -733,6 +733,12 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
|
| // Caching of optimized code enabled and optimized code found.
|
| function_info->InstallFromOptimizedCodeMap(*result, index);
|
| return result;
|
| + } else {
|
| + // The optimization count should be tied to the context, similar to the
|
| + // optimized code map. But for simplicity's sake we just reset the opt
|
| + // count whenever the optimized code map lookup fails. This happens
|
| + // only when the function has never been optimized for the current context.
|
| + function_info->set_opt_count(0);
|
| }
|
|
|
| if (isolate()->use_crankshaft() &&
|
|
|