Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 992003003: Revert of Do not cache resource metadata if the source code size is small. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698