| Index: src/factory.cc
|
| diff --git a/src/factory.cc b/src/factory.cc
|
| index 400132e14b520f1bf5ff7992d4c59e090d9dde88..39a1795d3e950dab49f4b13feea8fb2311c0abd2 100644
|
| --- a/src/factory.cc
|
| +++ b/src/factory.cc
|
| @@ -711,6 +711,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() &&
|
|
|