This patch combine three patch which is related to "--gcov" flag.
[platform/framework/web/chromium-efl.git] / gin / gin_features.cc
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.
4
5 #include "gin/gin_features.h"
6 #include "base/metrics/field_trial_params.h"
7
8 namespace features {
9
10 // Enable code space compaction when finalizing a full GC with stack.
11 BASE_FEATURE(kV8CompactCodeSpaceWithStack,
12              "V8CompactCodeSpaceWithStack",
13              base::FEATURE_ENABLED_BY_DEFAULT);
14
15 // Enable compaction when finalizing a full GC with stack.
16 BASE_FEATURE(kV8CompactWithStack,
17              "V8CompactWithStack",
18              base::FEATURE_ENABLED_BY_DEFAULT);
19
20 // Enables optimization of JavaScript in V8.
21 BASE_FEATURE(kV8OptimizeJavascript,
22              "V8OptimizeJavascript",
23              base::FEATURE_ENABLED_BY_DEFAULT);
24
25 // Enables flushing of JS bytecode in V8.
26 BASE_FEATURE(kV8FlushBytecode,
27              "V8FlushBytecode",
28              base::FEATURE_ENABLED_BY_DEFAULT);
29 const base::FeatureParam<int> kV8FlushBytecodeOldAge{
30     &kV8FlushBytecode, "V8FlushBytecodeOldAge", 5};
31
32 // Enables flushing of baseline code in V8.
33 BASE_FEATURE(kV8FlushBaselineCode,
34              "V8FlushBaselineCode",
35              base::FEATURE_DISABLED_BY_DEFAULT);
36
37 // Enables code flushing based on tab visibility.
38 BASE_FEATURE(kV8FlushCodeBasedOnTabVisibility,
39              "V8FlushCodeBasedOnTabVisibility",
40              base::FEATURE_DISABLED_BY_DEFAULT);
41
42 // Enables code flushing based on time.
43 BASE_FEATURE(kV8FlushCodeBasedOnTime,
44              "V8FlushCodeBasedOnTime",
45              base::FEATURE_DISABLED_BY_DEFAULT);
46 const base::FeatureParam<int> kV8FlushCodeOldTime{&kV8FlushCodeBasedOnTime,
47                                                   "V8FlushCodeOldTime", 30};
48
49 // Enables finalizing streaming JS compilations on a background thread.
50 BASE_FEATURE(kV8OffThreadFinalization,
51              "V8OffThreadFinalization",
52              base::FEATURE_ENABLED_BY_DEFAULT);
53
54 // Enables lazy feedback allocation in V8.
55 BASE_FEATURE(kV8LazyFeedbackAllocation,
56              "V8LazyFeedbackAllocation",
57              base::FEATURE_ENABLED_BY_DEFAULT);
58
59 // Enables per-context marking worklists in V8 GC.
60 BASE_FEATURE(kV8PerContextMarkingWorklist,
61              "V8PerContextMarkingWorklist",
62              base::FEATURE_DISABLED_BY_DEFAULT);
63
64 // Enables flushing of the instruction cache for the embedded blob.
65 BASE_FEATURE(kV8FlushEmbeddedBlobICache,
66              "V8FlushEmbeddedBlobICache",
67              base::FEATURE_DISABLED_BY_DEFAULT);
68
69 // Enables reduced number of concurrent marking tasks.
70 BASE_FEATURE(kV8ReduceConcurrentMarkingTasks,
71              "V8ReduceConcurrentMarkingTasks",
72              base::FEATURE_DISABLED_BY_DEFAULT);
73
74 // Disables reclaiming of unmodified wrappers objects.
75 BASE_FEATURE(kV8NoReclaimUnmodifiedWrappers,
76              "V8NoReclaimUnmodifiedWrappers",
77              base::FEATURE_DISABLED_BY_DEFAULT);
78
79 // Enables W^X code memory protection in V8.
80 // This is enabled in V8 by default. To test the performance impact, we are
81 // going to disable this feature in a finch experiment.
82 BASE_FEATURE(kV8CodeMemoryWriteProtection,
83              "V8CodeMemoryWriteProtection",
84              base::FEATURE_ENABLED_BY_DEFAULT);
85
86 // Enables fallback to a breadth-first regexp engine on excessive backtracking.
87 BASE_FEATURE(kV8ExperimentalRegexpEngine,
88              "V8ExperimentalRegexpEngine",
89              base::FEATURE_ENABLED_BY_DEFAULT);
90
91 // Enables the Turbofan compiler.
92 BASE_FEATURE(kV8Turbofan, "V8Turbofan", base::FEATURE_ENABLED_BY_DEFAULT);
93
94 // Enables Turbofan's new compiler IR Turboshaft.
95 BASE_FEATURE(kV8Turboshaft, "V8Turboshaft", base::FEATURE_ENABLED_BY_DEFAULT);
96
97 // Enable running instruction selection on Turboshaft IR directly.
98 BASE_FEATURE(kV8TurboshaftInstructionSelection,
99              "V8TurboshaftInstructionSelection",
100              base::FEATURE_DISABLED_BY_DEFAULT);
101
102 // Enables Maglev compiler. Note that this only sets the V8 flag when
103 // manually overridden; otherwise it defers to whatever the V8 default is.
104 BASE_FEATURE(kV8Maglev, "V8Maglev", base::FEATURE_ENABLED_BY_DEFAULT);
105
106 BASE_FEATURE(kV8MemoryReducer,
107              "V8MemoryReducer",
108              base::FEATURE_DISABLED_BY_DEFAULT);
109
110 const base::FeatureParam<int> kV8MemoryReducerGCCount{
111     &kV8MemoryReducer, "V8MemoryReducerGCCount", 3};
112
113 // Enables MinorMC young generation garbage collector.
114 BASE_FEATURE(kV8MinorMS, "V8MinorMS", base::FEATURE_DISABLED_BY_DEFAULT);
115
116 // Enables Sparkplug compiler. Note that this only sets the V8 flag when
117 // manually overridden; otherwise it defers to whatever the V8 default is.
118 BASE_FEATURE(kV8Sparkplug, "V8Sparkplug", base::FEATURE_ENABLED_BY_DEFAULT);
119
120 // Enables the concurrent Sparkplug compiler.
121 BASE_FEATURE(kV8ConcurrentSparkplug,
122              "V8ConcurrentSparkplug",
123              base::FEATURE_DISABLED_BY_DEFAULT);
124 const base::FeatureParam<int> kV8ConcurrentSparkplugMaxThreads{
125     &kV8ConcurrentSparkplug, "V8ConcurrentSparkplugMaxThreads", 0};
126 BASE_FEATURE(kV8ConcurrentSparkplugHighPriorityThreads,
127              "V8ConcurrentSparkplugHighPriorityThreads",
128              base::FEATURE_DISABLED_BY_DEFAULT);
129 // Makes sure the experimental Sparkplug compiler is only enabled if short
130 // builtin calls are enabled too.
131 BASE_FEATURE(kV8SparkplugNeedsShortBuiltinCalls,
132              "V8SparkplugNeedsShortBuiltinCalls",
133              base::FEATURE_DISABLED_BY_DEFAULT);
134
135 // Enables short builtin calls feature.
136 BASE_FEATURE(kV8ShortBuiltinCalls,
137              "V8ShortBuiltinCalls",
138              base::FEATURE_ENABLED_BY_DEFAULT);
139
140 // Enables fast API calls in TurboFan.
141 BASE_FEATURE(kV8TurboFastApiCalls,
142              "V8TurboFastApiCalls",
143              base::FEATURE_ENABLED_BY_DEFAULT);
144
145 // Enables faster DOM methods for megamorphic ICs
146 BASE_FEATURE(kV8MegaDomIC, "V8MegaDomIC", base::FEATURE_DISABLED_BY_DEFAULT);
147
148 // Avoids background threads for GC if isolate is in background.
149 BASE_FEATURE(kV8SingleThreadedGCInBackground,
150              "V8SingleThreadedGCInBackground",
151              base::FEATURE_DISABLED_BY_DEFAULT);
152
153 // Enables slow histograms that provide detailed information at increased
154 // runtime overheads.
155 BASE_FEATURE(kV8SlowHistograms,
156              "V8SlowHistograms",
157              base::FEATURE_DISABLED_BY_DEFAULT);
158 // Multiple finch experiments might use slow-histograms. We introduce
159 // separate feature flags to circumvent finch limitations.
160 BASE_FEATURE(kV8SlowHistogramsCodeMemoryWriteProtection,
161              "V8SlowHistogramsCodeMemoryWriteProtection",
162              base::FEATURE_DISABLED_BY_DEFAULT);
163 BASE_FEATURE(kV8SlowHistogramsSparkplug,
164              "V8SlowHistogramsSparkplug",
165              base::FEATURE_DISABLED_BY_DEFAULT);
166 BASE_FEATURE(kV8SlowHistogramsSparkplugAndroid,
167              "V8SlowHistogramsSparkplugAndroid",
168              base::FEATURE_DISABLED_BY_DEFAULT);
169 BASE_FEATURE(kV8SlowHistogramsNoTurbofan,
170              "V8SlowHistogramsNoTurbofan",
171              base::FEATURE_DISABLED_BY_DEFAULT);
172
173 BASE_FEATURE(kV8DelayMemoryReducer,
174              "V8DelayMemoryReducer",
175              base::FEATURE_ENABLED_BY_DEFAULT);
176 const base::FeatureParam<base::TimeDelta> kV8MemoryReducerStartDelay{
177     &kV8DelayMemoryReducer, "delay", base::Seconds(30)};
178
179 BASE_FEATURE(kV8ConcurrentMarkingHighPriorityThreads,
180              "V8ConcurrentMarkingHighPriorityThreads",
181              base::FEATURE_DISABLED_BY_DEFAULT);
182
183 BASE_FEATURE(kV8UseLibmTrigFunctions,
184              "V8UseLibmTrigFunctions",
185              base::FEATURE_ENABLED_BY_DEFAULT);
186
187 // Elide redundant TDZ hole checks in bytecode. This only sets the V8 flag when
188 // manually overridden.
189 BASE_FEATURE(kV8IgnitionElideRedundantTdzChecks,
190              "V8IgnitionElideRedundantTdzChecks",
191              base::FEATURE_ENABLED_BY_DEFAULT);
192
193 // The currently enabled fallback to the mid-tier register allocator for huge
194 // Wasm functions. We want to remove this fallback in the future.
195 BASE_FEATURE(kV8MidtierRegallocFallback,
196              "V8MidtierRegallocFallback",
197              base::FEATURE_DISABLED_BY_DEFAULT);
198
199 // JavaScript language features.
200
201 // Enables the Symbols-as-WeakMap-keys proposal.
202 BASE_FEATURE(kJavaScriptSymbolAsWeakMapKey,
203              "JavaScriptSymbolAsWeakMapKey",
204              base::FEATURE_ENABLED_BY_DEFAULT);
205
206 // Enables the change-Array-by-copy proposal.
207 BASE_FEATURE(kJavaScriptChangeArrayByCopy,
208              "JavaScriptChangeArrayByCopy",
209              base::FEATURE_ENABLED_BY_DEFAULT);
210
211 // Enables the Resizable ArrayBuffer proposal.
212 BASE_FEATURE(kJavaScriptRabGsab,
213              "JavaScriptRabGsab",
214              base::FEATURE_ENABLED_BY_DEFAULT);
215
216 // Enables the JavaScript RegExp Unicode set notation proposal.
217 BASE_FEATURE(kJavaScriptRegExpUnicodeSets,
218              "JavaScriptRegExpUnicodeSets",
219              base::FEATURE_ENABLED_BY_DEFAULT);
220
221 // Enables the JSON.parse with source proposal.
222 BASE_FEATURE(kJavaScriptJsonParseWithSource,
223              "JavaScriptJsonParseWithSource",
224              base::FEATURE_ENABLED_BY_DEFAULT);
225
226 // Enables the ArrayBuffer transfer proposal.
227 BASE_FEATURE(kJavaScriptArrayBufferTransfer,
228              "JavaScriptArrayBufferTransfer",
229              base::FEATURE_ENABLED_BY_DEFAULT);
230
231 // Enables the experiment with compile hints as magic comments.
232 BASE_FEATURE(kJavaScriptCompileHintsMagic,
233              "JavaScriptCompileHintsMagic",
234              base::FEATURE_DISABLED_BY_DEFAULT);
235
236 // Enables the iterator helpers proposal.
237 BASE_FEATURE(kJavaScriptIteratorHelpers,
238              "kJavaScriptIteratorHelpers",
239              base::FEATURE_ENABLED_BY_DEFAULT);
240
241 // Enables the Promise.withResolvers proposal.
242 BASE_FEATURE(kJavaScriptPromiseWithResolvers,
243              "JavaScriptPromiseWithResolvers",
244              base::FEATURE_ENABLED_BY_DEFAULT);
245
246 // WebAssembly features.
247
248 // Enable support for the WebAssembly tail-call proposal:
249 // https://github.com/WebAssembly/tail-call.
250 BASE_FEATURE(kWebAssemblyTailCall,
251              "WebAssemblyTailCall",
252              base::FEATURE_ENABLED_BY_DEFAULT);
253
254 // Enable WebAssembly inlining (not user visible).
255 BASE_FEATURE(kWebAssemblyInlining,
256              "WebAssemblyInlining",
257              base::FEATURE_DISABLED_BY_DEFAULT);
258
259 // Enable the generic wasm-to-js wrapper.
260 BASE_FEATURE(kWebAssemblyGenericWrapper,
261              "WebAssemblyGenericWrapper",
262              base::FEATURE_DISABLED_BY_DEFAULT);
263
264 // Enable support for multiple memories according to the multi-memory proposal:
265 // https://github.com/WebAssembly/multi-memory. See
266 // https://chromestatus.com/feature/5106389887746048.
267 BASE_FEATURE(kWebAssemblyMultipleMemories,
268              "WebAssemblyMultipleMemories",
269              base::FEATURE_ENABLED_BY_DEFAULT);
270
271 BASE_FEATURE(kWebAssemblyTurboshaft,
272              "WebAssemblyTurboshaft",
273              base::FEATURE_DISABLED_BY_DEFAULT);
274
275 }  // namespace features