1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "gin/gin_features.h"
6 #include "base/metrics/field_trial_params.h"
10 // Enable code space compaction when finalizing a full GC with stack.
11 BASE_FEATURE(kV8CompactCodeSpaceWithStack,
12 "V8CompactCodeSpaceWithStack",
13 base::FEATURE_ENABLED_BY_DEFAULT);
15 // Enable compaction when finalizing a full GC with stack.
16 BASE_FEATURE(kV8CompactWithStack,
18 base::FEATURE_ENABLED_BY_DEFAULT);
20 // Enables compaction of maps in a full GC.
21 BASE_FEATURE(kV8CompactMaps,
23 base::FEATURE_DISABLED_BY_DEFAULT);
25 // Crashes on evacuation failures in a full GC instead of aborting evacuation.
26 BASE_FEATURE(kV8CrashOnEvacuationFailure,
27 "V8CrashOnEvacuationFailure",
28 base::FEATURE_DISABLED_BY_DEFAULT);
30 // Enables a separate heap space for all map objects.
31 BASE_FEATURE(kV8UseMapSpace, "V8UseMapSpace", base::FEATURE_ENABLED_BY_DEFAULT);
33 // Enables optimization of JavaScript in V8.
34 BASE_FEATURE(kV8OptimizeJavascript,
35 "V8OptimizeJavascript",
36 base::FEATURE_ENABLED_BY_DEFAULT);
38 // Enables flushing of JS bytecode in V8.
39 BASE_FEATURE(kV8FlushBytecode,
41 base::FEATURE_ENABLED_BY_DEFAULT);
42 const base::FeatureParam<int> kV8FlushBytecodeOldAge{
43 &kV8FlushBytecode, "V8FlushBytecodeOldAge", 5};
45 // Enables flushing of baseline code in V8.
46 BASE_FEATURE(kV8FlushBaselineCode,
47 "V8FlushBaselineCode",
48 base::FEATURE_DISABLED_BY_DEFAULT);
50 // Enables finalizing streaming JS compilations on a background thread.
51 BASE_FEATURE(kV8OffThreadFinalization,
52 "V8OffThreadFinalization",
53 base::FEATURE_ENABLED_BY_DEFAULT);
55 // Enables lazy feedback allocation in V8.
56 BASE_FEATURE(kV8LazyFeedbackAllocation,
57 "V8LazyFeedbackAllocation",
58 base::FEATURE_ENABLED_BY_DEFAULT);
60 // Enables per-context marking worklists in V8 GC.
61 BASE_FEATURE(kV8PerContextMarkingWorklist,
62 "V8PerContextMarkingWorklist",
63 base::FEATURE_DISABLED_BY_DEFAULT);
65 // Enables flushing of the instruction cache for the embedded blob.
66 BASE_FEATURE(kV8FlushEmbeddedBlobICache,
67 "V8FlushEmbeddedBlobICache",
68 base::FEATURE_DISABLED_BY_DEFAULT);
70 // Enables reduced number of concurrent marking tasks.
71 BASE_FEATURE(kV8ReduceConcurrentMarkingTasks,
72 "V8ReduceConcurrentMarkingTasks",
73 base::FEATURE_DISABLED_BY_DEFAULT);
75 // Disables reclaiming of unmodified wrappers objects.
76 BASE_FEATURE(kV8NoReclaimUnmodifiedWrappers,
77 "V8NoReclaimUnmodifiedWrappers",
78 base::FEATURE_DISABLED_BY_DEFAULT);
80 // Enables W^X code memory protection in V8.
81 // This is enabled in V8 by default. To test the performance impact, we are
82 // going to disable this feature in a finch experiment.
83 BASE_FEATURE(kV8CodeMemoryWriteProtection,
84 "V8CodeMemoryWriteProtection",
85 base::FEATURE_ENABLED_BY_DEFAULT);
87 // Enables fallback to a breadth-first regexp engine on excessive backtracking.
88 BASE_FEATURE(kV8ExperimentalRegexpEngine,
89 "V8ExperimentalRegexpEngine",
90 base::FEATURE_ENABLED_BY_DEFAULT);
92 // Enables experimental Maglev compiler.
93 BASE_FEATURE(kV8Maglev, "V8Maglev", base::FEATURE_DISABLED_BY_DEFAULT);
95 // Enables Sparkplug compiler. Note that this only sets the V8 flag when
96 // manually overridden; otherwise it defers to whatever the V8 default is.
97 BASE_FEATURE(kV8Sparkplug, "V8Sparkplug", base::FEATURE_ENABLED_BY_DEFAULT);
99 // Enables the concurrent Sparkplug compiler.
100 BASE_FEATURE(kV8ConcurrentSparkplug,
101 "V8ConcurrentSparkplug",
102 base::FEATURE_DISABLED_BY_DEFAULT);
103 const base::FeatureParam<int> kV8ConcurrentSparkplugMaxThreads{
104 &kV8ConcurrentSparkplug, "V8ConcurrentSparkplugMaxThreads", 0};
105 BASE_FEATURE(kV8ConcurrentSparkplugHighPriorityThreads,
106 "V8ConcurrentSparkplugHighPriorityThreads",
107 base::FEATURE_DISABLED_BY_DEFAULT);
108 // Makes sure the experimental Sparkplug compiler is only enabled if short
109 // builtin calls are enabled too.
110 BASE_FEATURE(kV8SparkplugNeedsShortBuiltinCalls,
111 "V8SparkplugNeedsShortBuiltinCalls",
112 base::FEATURE_DISABLED_BY_DEFAULT);
114 // Enables short builtin calls feature.
115 BASE_FEATURE(kV8ShortBuiltinCalls,
116 "V8ShortBuiltinCalls",
117 base::FEATURE_ENABLED_BY_DEFAULT);
119 // Enables fast API calls in TurboFan.
120 BASE_FEATURE(kV8TurboFastApiCalls,
121 "V8TurboFastApiCalls",
122 base::FEATURE_ENABLED_BY_DEFAULT);
124 // Artificially delays script execution.
125 BASE_FEATURE(kV8ScriptAblation,
127 base::FEATURE_DISABLED_BY_DEFAULT);
128 const base::FeatureParam<int> kV8ScriptDelayOnceMs{&kV8ScriptAblation,
129 "V8ScriptDelayOnceMs", 0};
130 const base::FeatureParam<int> kV8ScriptDelayMs{&kV8ScriptAblation,
131 "V8ScriptDelayMs", 0};
132 const base::FeatureParam<double> kV8ScriptDelayFraction{
133 &kV8ScriptAblation, "V8ScriptDelayFraction", 0.0};
135 // Enables slow histograms that provide detailed information at increased
136 // runtime overheads.
137 BASE_FEATURE(kV8SlowHistograms,
139 base::FEATURE_DISABLED_BY_DEFAULT);
140 // Multiple finch experiments might use slow-histograms. We introduce
141 // separate feature flags to circumvent finch limitations.
142 BASE_FEATURE(kV8SlowHistogramsCodeMemoryWriteProtection,
143 "V8SlowHistogramsCodeMemoryWriteProtection",
144 base::FEATURE_DISABLED_BY_DEFAULT);
145 BASE_FEATURE(kV8SlowHistogramsSparkplug,
146 "V8SlowHistogramsSparkplug",
147 base::FEATURE_DISABLED_BY_DEFAULT);
148 BASE_FEATURE(kV8SlowHistogramsSparkplugAndroid,
149 "V8SlowHistogramsSparkplugAndroid",
150 base::FEATURE_DISABLED_BY_DEFAULT);
151 BASE_FEATURE(kV8SlowHistogramsScriptAblation,
152 "V8SlowHistogramsScriptAblation",
153 base::FEATURE_DISABLED_BY_DEFAULT);
155 BASE_FEATURE(kV8DelayMemoryReducer,
156 "V8DelayMemoryReducer",
157 base::FEATURE_DISABLED_BY_DEFAULT);
158 const base::FeatureParam<base::TimeDelta> kV8MemoryReducerStartDelay{
159 &kV8DelayMemoryReducer, "delay", base::Seconds(8)};
161 } // namespace features