Chromium Code Reviews| Index: Source/bindings/core/v8/V8ScriptRunner.cpp |
| diff --git a/Source/bindings/core/v8/V8ScriptRunner.cpp b/Source/bindings/core/v8/V8ScriptRunner.cpp |
| index 4bffe58068596dec34b9fbcd24f276be7341af11..80da2d80a79aa14e61f4f149af15b7e3b44751ff 100644 |
| --- a/Source/bindings/core/v8/V8ScriptRunner.cpp |
| +++ b/Source/bindings/core/v8/V8ScriptRunner.cpp |
| @@ -280,7 +280,8 @@ PassOwnPtr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, CachedM |
| // Caching is not available in this case. |
| return bind(compileWithoutOptions, V8CompileHistogram::Noncacheable); |
| - if (cacheOptions == V8CacheOptionsNone) |
| + // Do not cache for small scripts, even if caching is available. |
|
falken
2015/03/10 00:54:05
This comment kind of just repeats the code. It'd b
|
| + if (cacheOptions == V8CacheOptionsNone || code->Length() < minimalCodeLength) |
| return bind(compileWithoutOptions, V8CompileHistogram::Cacheable); |
| // The cacheOptions will guide our strategy: |
| @@ -288,10 +289,6 @@ PassOwnPtr<CompileFn> selectCompileFunction(V8CacheOptions cacheOptions, CachedM |
| switch (cacheOptions) { |
| case V8CacheOptionsDefault: |
| case V8CacheOptionsParseMemory: |
| - if (code->Length() < minimalCodeLength) { |
| - // Do not cache for small scripts, though caching is available. |
| - return bind(compileWithoutOptions, V8CompileHistogram::Cacheable); |
| - } |
| // Use parser-cache; in-memory only. |
| return bind(compileAndConsumeOrProduce, cacheHandler, cacheTag(CacheTagParser, cacheHandler), v8::ScriptCompiler::kConsumeParserCache, v8::ScriptCompiler::kProduceParserCache, false, CachedMetadataHandler::CacheLocally); |
| break; |