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

Unified Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 1864063002: Add features for V8 serialization experiments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl format Created 4 years, 8 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: chrome/renderer/chrome_render_process_observer.cc
diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc
index ecad9b76d8c30f0ce9e2163cdd03e3090abd4f64..891c6bcf64e2b98e9255ae0109e9458355c15c1c 100644
--- a/chrome/renderer/chrome_render_process_observer.cc
+++ b/chrome/renderer/chrome_render_process_observer.cc
@@ -239,6 +239,24 @@ const base::Feature kV8_ES2015_TailCalls_Feature {
"V8_ES2015_TailCalls", base::FEATURE_DISABLED_BY_DEFAULT
};
+const base::Feature kV8SerializeEagerFeature{"V8_Serialize_Eager",
vogelheim 2016/04/06 12:57:43 This doesn't look right, but this is what "git cl
jochen (gone - plz use gerrit) 2016/04/06 13:00:56 can you file a bug (go/clang-format-bug)
vogelheim 2016/04/06 13:44:00 - This is intentional on clang-format's part. (b/2
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+const base::Feature kV8SerializeAgeCodeFeature{
+ "V8_Serialize_Age_Code", base::FEATURE_DISABLED_BY_DEFAULT};
+
+void SetV8FlagIfFeature(const base::Feature& feature, const char* v8_flag) {
+ if (base::FeatureList::IsEnabled(feature)) {
+ v8::V8::SetFlagsFromString(v8_flag, strlen(v8_flag));
+ }
+}
+
+void SetV8FlagIfHasSwitch(const char* switch_name, const char* v8_flag) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switch_name)) {
+ v8::V8::SetFlagsFromString(v8_flag, strlen(v8_flag));
+ }
+}
+
} // namespace
bool ChromeRenderProcessObserver::is_incognito_process_ = false;
@@ -252,25 +270,13 @@ ChromeRenderProcessObserver::ChromeRenderProcessObserver()
WebRuntimeFeatures::enableRequestAutocomplete(true);
#endif
- if (base::FeatureList::IsEnabled(kV8_ES2015_TailCalls_Feature)) {
- std::string flag("--harmony-tailcalls");
- v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
- }
-
- if (command_line.HasSwitch(switches::kDisableJavaScriptHarmonyShipping)) {
- std::string flag("--noharmony-shipping");
- v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
- }
-
- if (command_line.HasSwitch(switches::kJavaScriptHarmony)) {
- std::string flag("--harmony");
- v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
- }
-
- if (command_line.HasSwitch(switches::kEnableWasm)) {
- std::string flag("--expose-wasm");
- v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
- }
+ SetV8FlagIfFeature(kV8_ES2015_TailCalls_Feature, "--harmony-tailcalls");
+ SetV8FlagIfFeature(kV8SerializeEagerFeature, "--serialize_eager");
+ SetV8FlagIfFeature(kV8SerializeAgeCodeFeature, "--serialize_age_code");
+ SetV8FlagIfHasSwitch(switches::kDisableJavaScriptHarmonyShipping,
+ "--noharmony-shipping");
+ SetV8FlagIfHasSwitch(switches::kJavaScriptHarmony, "--harmony");
+ SetV8FlagIfHasSwitch(switches::kEnableWasm, "--expose-wasm");
RenderThread* thread = RenderThread::Get();
resource_delegate_.reset(new RendererResourceDelegate());
« 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