Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 7dee66f6de955f76e1100f2cd1ccde8e7f1475f1..d1d6c46fe07b511880d62c9fb02981ed7037baa2 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -444,6 +444,14 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo( |
context->global_context()); |
} |
result->set_literals(*literals); |
+ if (FLAG_cache_optimized_code) { |
+ Code* code = |
+ function_info->SearchOptimizedCodeMap(context->global_context()); |
+ if (code != NULL) { |
+ result->ReplaceCode(code); |
+ return result; |
+ } |
+ } |
result->set_next_function_link(isolate()->heap()->undefined_value()); |
if (V8::UseCrankshaft() && |