Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index d35532f04583f2fcf6ba934d87d42cae3c481d4c..fd8872783b1ee7a7e31301abc3935eefc3c588f9 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -533,7 +533,7 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source, |
info.SetLanguageMode(FLAG_harmony_scoping ? EXTENDED_MODE : STRICT_MODE); |
} |
result = MakeFunctionInfo(&info); |
- if (extension == NULL && !result.is_null()) { |
+ if (extension == NULL && !result.is_null() && !result->dont_cache()) { |
compilation_cache->PutScript(source, result); |
} |
} else { |
@@ -592,8 +592,10 @@ Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source, |
// extended mode. |
ASSERT(language_mode != EXTENDED_MODE || |
result->is_extended_mode()); |
- compilation_cache->PutEval( |
- source, context, is_global, result, scope_position); |
+ if (!result->dont_cache()) { |
+ compilation_cache->PutEval( |
+ source, context, is_global, result, scope_position); |
+ } |
} |
} else { |
if (result->ic_age() != HEAP->global_ic_age()) { |
@@ -707,6 +709,7 @@ bool Compiler::CompileLazy(CompilationInfo* info) { |
shared->set_code_age(0); |
shared->set_dont_optimize(lit->flags()->Contains(kDontOptimize)); |
shared->set_dont_inline(lit->flags()->Contains(kDontInline)); |
+ shared->set_dont_cache(lit->flags()->Contains(kDontCache)); |
shared->set_ast_node_count(lit->ast_node_count()); |
if (V8::UseCrankshaft()&& |
@@ -821,6 +824,7 @@ void Compiler::SetFunctionInfo(Handle<SharedFunctionInfo> function_info, |
function_info->set_is_function(lit->is_function()); |
function_info->set_dont_optimize(lit->flags()->Contains(kDontOptimize)); |
function_info->set_dont_inline(lit->flags()->Contains(kDontInline)); |
+ function_info->set_dont_cache(lit->flags()->Contains(kDontCache)); |
} |