Commit f2e7ed01 authored by Mythri Alle's avatar Mythri Alle Committed by Commit Bot

Remove the option to request a parser cache.

The parser cache in V8 is no longer used. Hence removing
the option to produce a parser cache.

Bug: chromium:779254
Change-Id: I70b0e211e63f312c701f4df3d57b3d75094cd762
Reviewed-on: https://chromium-review.googlesource.com/906988
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537761}
parent 02c4ef18
...@@ -535,8 +535,6 @@ const FeatureEntry::Choice kV8CacheOptionsChoices[] = { ...@@ -535,8 +535,6 @@ const FeatureEntry::Choice kV8CacheOptionsChoices[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""}, {flags_ui::kGenericExperimentChoiceDefault, "", ""},
{flags_ui::kGenericExperimentChoiceDisabled, switches::kV8CacheOptions, {flags_ui::kGenericExperimentChoiceDisabled, switches::kV8CacheOptions,
"none"}, "none"},
{flag_descriptions::kV8CacheOptionsParse, switches::kV8CacheOptions,
"parse"},
{flag_descriptions::kV8CacheOptionsCode, switches::kV8CacheOptions, "code"}, {flag_descriptions::kV8CacheOptionsCode, switches::kV8CacheOptions, "code"},
}; };
......
...@@ -1603,7 +1603,6 @@ const char kUseSuggestionsEvenIfFewFeatureDescription[] = ...@@ -1603,7 +1603,6 @@ const char kUseSuggestionsEvenIfFewFeatureDescription[] =
const char kV8CacheOptionsName[] = "V8 caching mode."; const char kV8CacheOptionsName[] = "V8 caching mode.";
const char kV8CacheOptionsDescription[] = const char kV8CacheOptionsDescription[] =
"Caching mode for the V8 JavaScript engine."; "Caching mode for the V8 JavaScript engine.";
const char kV8CacheOptionsParse[] = "Cache V8 parser data.";
const char kV8CacheOptionsCode[] = "Cache V8 compiler data."; const char kV8CacheOptionsCode[] = "Cache V8 compiler data.";
const char kV8ContextSnapshotName[] = "Use a snapshot to create V8 contexts."; const char kV8ContextSnapshotName[] = "Use a snapshot to create V8 contexts.";
......
...@@ -80,8 +80,6 @@ V8CacheOptions GetV8CacheOptions() { ...@@ -80,8 +80,6 @@ V8CacheOptions GetV8CacheOptions() {
v8_cache_options = base::FieldTrialList::FindFullName("V8CacheOptions"); v8_cache_options = base::FieldTrialList::FindFullName("V8CacheOptions");
if (v8_cache_options == "none") { if (v8_cache_options == "none") {
return V8_CACHE_OPTIONS_NONE; return V8_CACHE_OPTIONS_NONE;
} else if (v8_cache_options == "parse") {
return V8_CACHE_OPTIONS_PARSE;
} else if (v8_cache_options == "code") { } else if (v8_cache_options == "code") {
return V8_CACHE_OPTIONS_CODE; return V8_CACHE_OPTIONS_CODE;
} else { } else {
......
...@@ -29,7 +29,6 @@ STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_ANDROID, ...@@ -29,7 +29,6 @@ STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_ANDROID,
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_DEFAULT, STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_DEFAULT,
WebSettings::kV8CacheOptionsDefault); WebSettings::kV8CacheOptionsDefault);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_NONE, WebSettings::kV8CacheOptionsNone); STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_NONE, WebSettings::kV8CacheOptionsNone);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_PARSE, WebSettings::kV8CacheOptionsParse);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE, WebSettings::kV8CacheOptionsCode); STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE, WebSettings::kV8CacheOptionsCode);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_LAST, WebSettings::kV8CacheOptionsCode); STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_LAST, WebSettings::kV8CacheOptionsCode);
......
...@@ -39,7 +39,6 @@ enum EditingBehavior { ...@@ -39,7 +39,6 @@ enum EditingBehavior {
enum V8CacheOptions { enum V8CacheOptions {
V8_CACHE_OPTIONS_DEFAULT, V8_CACHE_OPTIONS_DEFAULT,
V8_CACHE_OPTIONS_NONE, V8_CACHE_OPTIONS_NONE,
V8_CACHE_OPTIONS_PARSE,
V8_CACHE_OPTIONS_CODE, V8_CACHE_OPTIONS_CODE,
V8_CACHE_OPTIONS_LAST = V8_CACHE_OPTIONS_CODE V8_CACHE_OPTIONS_LAST = V8_CACHE_OPTIONS_CODE
}; };
......
...@@ -597,16 +597,9 @@ void ScriptStreamer::StartStreaming( ...@@ -597,16 +597,9 @@ void ScriptStreamer::StartStreaming(
// to arrive: the Content-Length HTTP header is not sent for chunked // to arrive: the Content-Length HTTP header is not sent for chunked
// downloads. // downloads.
// Decide what kind of cached data we should produce while streaming. Only ScriptStreamer* streamer = new ScriptStreamer(
// produce parser cache if the non-streaming compile takes advantage of it. script, script_type, script_state, v8::ScriptCompiler::kNoCompileOptions,
v8::ScriptCompiler::CompileOptions compile_option = std::move(loading_task_runner));
v8::ScriptCompiler::kNoCompileOptions;
if (settings->GetV8CacheOptions() == kV8CacheOptionsParse)
compile_option = v8::ScriptCompiler::kProduceParserCache;
ScriptStreamer* streamer =
new ScriptStreamer(script, script_type, script_state, compile_option,
std::move(loading_task_runner));
// If this script was ready when streaming began, no callbacks will be // If this script was ready when streaming began, no callbacks will be
// received to populate the data for the ScriptStreamer, so send them now. // received to populate the data for the ScriptStreamer, so send them now.
......
...@@ -36,7 +36,6 @@ namespace blink { ...@@ -36,7 +36,6 @@ namespace blink {
enum V8CacheOptions { enum V8CacheOptions {
kV8CacheOptionsDefault, // Use whatever the current default is. kV8CacheOptionsDefault, // Use whatever the current default is.
kV8CacheOptionsNone, // V8 caching turned off. kV8CacheOptionsNone, // V8 caching turned off.
kV8CacheOptionsParse, // Use parser caching.
kV8CacheOptionsCode, // Use code caching. kV8CacheOptionsCode, // Use code caching.
// Generate the code cache in the first load. // Generate the code cache in the first load.
kV8CacheOptionsCodeWithoutHeatCheck, kV8CacheOptionsCodeWithoutHeatCheck,
......
...@@ -42,9 +42,6 @@ class V8ScriptRunnerTest : public ::testing::Test { ...@@ -42,9 +42,6 @@ class V8ScriptRunnerTest : public ::testing::Test {
KURL Url() const { KURL Url() const {
return KURL(WTF::String::Format("http://bla.com/bla%d", counter_)); return KURL(WTF::String::Format("http://bla.com/bla%d", counter_));
} }
unsigned TagForParserCache(CachedMetadataHandler* cache_handler) const {
return V8ScriptRunner::TagForParserCache(cache_handler);
}
unsigned TagForCodeCache(CachedMetadataHandler* cache_handler) const { unsigned TagForCodeCache(CachedMetadataHandler* cache_handler) const {
return V8ScriptRunner::TagForCodeCache(cache_handler); return V8ScriptRunner::TagForCodeCache(cache_handler);
} }
...@@ -122,8 +119,6 @@ TEST_F(V8ScriptRunnerTest, resourcelessShouldPass) { ...@@ -122,8 +119,6 @@ TEST_F(V8ScriptRunnerTest, resourcelessShouldPass) {
nullptr /* cache_handler */, Url()); nullptr /* cache_handler */, Url());
EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(), EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(),
source_code, kV8CacheOptionsNone)); source_code, kV8CacheOptionsNone));
EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(),
source_code, kV8CacheOptionsParse));
EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(), EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(),
source_code, kV8CacheOptionsCode)); source_code, kV8CacheOptionsCode));
} }
...@@ -133,23 +128,6 @@ TEST_F(V8ScriptRunnerTest, emptyResourceDoesNotHaveCacheHandler) { ...@@ -133,23 +128,6 @@ TEST_F(V8ScriptRunnerTest, emptyResourceDoesNotHaveCacheHandler) {
EXPECT_FALSE(resource->CacheHandler()); EXPECT_FALSE(resource->CacheHandler());
} }
TEST_F(V8ScriptRunnerTest, parseOption) {
V8TestingScope scope;
ScriptSourceCode source_code(nullptr, CreateResource(UTF8Encoding()));
EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(),
source_code, kV8CacheOptionsParse));
CachedMetadataHandler* cache_handler = source_code.CacheHandler();
EXPECT_TRUE(
cache_handler->GetCachedMetadata(TagForParserCache(cache_handler)));
EXPECT_FALSE(
cache_handler->GetCachedMetadata(TagForCodeCache(cache_handler)));
// The cached data is associated with the encoding.
ScriptResource* another_resource =
CreateResource(UTF16LittleEndianEncoding());
EXPECT_FALSE(cache_handler->GetCachedMetadata(
TagForParserCache(another_resource->CacheHandler())));
}
TEST_F(V8ScriptRunnerTest, codeOption) { TEST_F(V8ScriptRunnerTest, codeOption) {
V8TestingScope scope; V8TestingScope scope;
ScriptSourceCode source_code(nullptr, CreateResource(UTF8Encoding())); ScriptSourceCode source_code(nullptr, CreateResource(UTF8Encoding()));
...@@ -159,8 +137,6 @@ TEST_F(V8ScriptRunnerTest, codeOption) { ...@@ -159,8 +137,6 @@ TEST_F(V8ScriptRunnerTest, codeOption) {
EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(), EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(),
source_code, kV8CacheOptionsCode)); source_code, kV8CacheOptionsCode));
EXPECT_FALSE(
cache_handler->GetCachedMetadata(TagForParserCache(cache_handler)));
EXPECT_TRUE(cache_handler->GetCachedMetadata(TagForCodeCache(cache_handler))); EXPECT_TRUE(cache_handler->GetCachedMetadata(TagForCodeCache(cache_handler)));
// The cached data is associated with the encoding. // The cached data is associated with the encoding.
ScriptResource* another_resource = ScriptResource* another_resource =
...@@ -180,9 +156,7 @@ TEST_F(V8ScriptRunnerTest, consumeCodeOption) { ...@@ -180,9 +156,7 @@ TEST_F(V8ScriptRunnerTest, consumeCodeOption) {
EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(), EXPECT_TRUE(CompileScript(scope.GetIsolate(), scope.GetScriptState(),
source_code, kV8CacheOptionsCode)); source_code, kV8CacheOptionsCode));
// Check the produced cache is for code and not parser cache. // Check the produced cache is for code cache.
EXPECT_FALSE(
cache_handler->GetCachedMetadata(TagForParserCache(cache_handler)));
EXPECT_TRUE(cache_handler->GetCachedMetadata(TagForCodeCache(cache_handler))); EXPECT_TRUE(cache_handler->GetCachedMetadata(TagForCodeCache(cache_handler)));
// Hot run - should consume code cache. // Hot run - should consume code cache.
......
...@@ -336,14 +336,12 @@ const char* CompileOptionsString(v8::ScriptCompiler::CompileOptions options) { ...@@ -336,14 +336,12 @@ const char* CompileOptionsString(v8::ScriptCompiler::CompileOptions options) {
switch (options) { switch (options) {
case v8::ScriptCompiler::kNoCompileOptions: case v8::ScriptCompiler::kNoCompileOptions:
return "code"; return "code";
case v8::ScriptCompiler::kProduceParserCache:
return "parser";
case v8::ScriptCompiler::kConsumeParserCache:
return "parser";
case v8::ScriptCompiler::kConsumeCodeCache: case v8::ScriptCompiler::kConsumeCodeCache:
return "code"; return "code";
case v8::ScriptCompiler::kEagerCompile: case v8::ScriptCompiler::kEagerCompile:
return "full code"; return "full code";
case v8::ScriptCompiler::kProduceParserCache:
case v8::ScriptCompiler::kConsumeParserCache:
case v8::ScriptCompiler::kProduceCodeCache: case v8::ScriptCompiler::kProduceCodeCache:
case v8::ScriptCompiler::kProduceFullCodeCache: case v8::ScriptCompiler::kProduceFullCodeCache:
NOTREACHED(); NOTREACHED();
...@@ -1055,8 +1053,7 @@ InspectorCompileScriptEvent::V8CacheResult::ProduceResult::ProduceResult( ...@@ -1055,8 +1053,7 @@ InspectorCompileScriptEvent::V8CacheResult::ProduceResult::ProduceResult(
v8::ScriptCompiler::CompileOptions produce_options, v8::ScriptCompiler::CompileOptions produce_options,
int cache_size) int cache_size)
: produce_options(produce_options), cache_size(cache_size) { : produce_options(produce_options), cache_size(cache_size) {
DCHECK(produce_options == v8::ScriptCompiler::kProduceParserCache || DCHECK(produce_options == v8::ScriptCompiler::kNoCompileOptions ||
produce_options == v8::ScriptCompiler::kNoCompileOptions ||
produce_options == v8::ScriptCompiler::kEagerCompile); produce_options == v8::ScriptCompiler::kEagerCompile);
} }
...@@ -1067,8 +1064,7 @@ InspectorCompileScriptEvent::V8CacheResult::ConsumeResult::ConsumeResult( ...@@ -1067,8 +1064,7 @@ InspectorCompileScriptEvent::V8CacheResult::ConsumeResult::ConsumeResult(
: consume_options(consume_options), : consume_options(consume_options),
cache_size(cache_size), cache_size(cache_size),
rejected(rejected) { rejected(rejected) {
DCHECK(consume_options == v8::ScriptCompiler::kConsumeParserCache || DCHECK_EQ(consume_options, v8::ScriptCompiler::kConsumeCodeCache);
consume_options == v8::ScriptCompiler::kConsumeCodeCache);
} }
InspectorCompileScriptEvent::V8CacheResult::V8CacheResult( InspectorCompileScriptEvent::V8CacheResult::V8CacheResult(
......
...@@ -65,7 +65,6 @@ class WebSettings { ...@@ -65,7 +65,6 @@ class WebSettings {
enum V8CacheOptions { enum V8CacheOptions {
kV8CacheOptionsDefault, kV8CacheOptionsDefault,
kV8CacheOptionsNone, kV8CacheOptionsNone,
kV8CacheOptionsParse,
kV8CacheOptionsCode, kV8CacheOptionsCode,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment