| Index: Source/bindings/core/v8/V8ScriptRunner.cpp
|
| diff --git a/Source/bindings/core/v8/V8ScriptRunner.cpp b/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| index 80da2d80a79aa14e61f4f149af15b7e3b44751ff..4bffe58068596dec34b9fbcd24f276be7341af11 100644
|
| --- a/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| +++ b/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| @@ -280,8 +280,7 @@
|
| // Caching is not available in this case.
|
| return bind(compileWithoutOptions, V8CompileHistogram::Noncacheable);
|
|
|
| - // Do not cache for small scripts, even if caching is available.
|
| - if (cacheOptions == V8CacheOptionsNone || code->Length() < minimalCodeLength)
|
| + if (cacheOptions == V8CacheOptionsNone)
|
| return bind(compileWithoutOptions, V8CompileHistogram::Cacheable);
|
|
|
| // The cacheOptions will guide our strategy:
|
| @@ -289,6 +288,10 @@
|
| 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;
|
|
|