Index: src/execution.cc |
diff --git a/src/execution.cc b/src/execution.cc |
index 91d340e5e1064f41b7c27c60ffc68a61a771a2a3..c59a737c32b63158f18b4f1fd41be7525c1f7f05 100644 |
--- a/src/execution.cc |
+++ b/src/execution.cc |
@@ -705,12 +705,14 @@ Handle<JSFunction> Execution::InstantiateFunction( |
Handle<FunctionTemplateInfo> data, |
bool* exc) { |
Isolate* isolate = data->GetIsolate(); |
- // Fast case: see if the function has already been instantiated |
- int serial_number = Smi::cast(data->serial_number())->value(); |
- Object* elm = |
- isolate->native_context()->function_cache()-> |
- GetElementNoExceptionThrown(isolate, serial_number); |
- if (elm->IsJSFunction()) return Handle<JSFunction>(JSFunction::cast(elm)); |
+ if (!data->do_not_cache()) { |
+ // Fast case: see if the function has already been instantiated |
+ int serial_number = Smi::cast(data->serial_number())->value(); |
+ Object* elm = |
+ isolate->native_context()->function_cache()-> |
+ GetElementNoExceptionThrown(isolate, serial_number); |
+ if (elm->IsJSFunction()) return Handle<JSFunction>(JSFunction::cast(elm)); |
+ } |
// The function has not yet been instantiated in this context; do it. |
Handle<Object> args[] = { data }; |
Handle<Object> result = Call(isolate, |