Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index 227233773931ac0418fe7338f99a326617b8c5f9..c9c2480fa2c6dbf326b1bc3314bb5d46de302cd8 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -531,6 +531,10 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source, |
if (extension == NULL && !result.is_null()) { |
compilation_cache->PutScript(source, result); |
} |
+ } else { |
+ if (result->ic_age() != HEAP->global_ic_age()) { |
+ result->ResetForNewContext(HEAP->global_ic_age()); |
+ } |
} |
if (result.is_null()) isolate->ReportPendingMessages(); |
@@ -586,6 +590,10 @@ Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source, |
compilation_cache->PutEval( |
source, context, is_global, result, scope_position); |
} |
+ } else { |
+ if (result->ic_age() != HEAP->global_ic_age()) { |
+ result->ResetForNewContext(HEAP->global_ic_age()); |
+ } |
} |
return result; |