Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
flag_list.h
Go to the documentation of this file.
1// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_FLAG_LIST_H_
6#define RUNTIME_VM_FLAG_LIST_H_
7
9
10// Don't use USING_PRODUCT outside of this file.
11#if defined(PRODUCT)
12#define USING_PRODUCT true
13#else
14#define USING_PRODUCT false
15#endif
16
17#if defined(DART_PRECOMPILED_RUNTIME)
18constexpr bool kDartPrecompiledRuntime = true;
19#else
20constexpr bool kDartPrecompiledRuntime = false;
21#endif
22
23constexpr intptr_t kDefaultOptimizationCounterThreshold = 30000;
24
25// The disassembler might be force included even in product builds so we need
26// to conditionally make these into product flags to make the disassembler
27// usable in product mode.
28#if defined(FORCE_INCLUDE_DISASSEMBLER)
29#define DISASSEMBLE_FLAGS(P, R, C, D) \
30 P(disassemble, bool, false, "Disassemble dart code.") \
31 P(disassemble_optimized, bool, false, "Disassemble optimized code.") \
32 P(disassemble_relative, bool, false, "Use offsets instead of absolute PCs") \
33 P(disassemble_stubs, bool, false, "Disassemble generated stubs.") \
34 P(support_disassembler, bool, true, "Support the disassembler.")
35#else
36#define DISASSEMBLE_FLAGS(P, R, C, D) \
37 R(disassemble, false, bool, false, "Disassemble dart code.") \
38 R(disassemble_optimized, false, bool, false, "Disassemble optimized code.") \
39 R(disassemble_relative, false, bool, false, \
40 "Use offsets instead of absolute PCs") \
41 R(disassemble_stubs, false, bool, false, "Disassemble generated stubs.") \
42 R(support_disassembler, false, bool, true, "Support the disassembler.")
43#endif
44
45#if defined(INCLUDE_IL_PRINTER)
46constexpr bool FLAG_support_il_printer = true;
47#else
48constexpr bool FLAG_support_il_printer = false;
49#endif // defined(INCLUDE_IL_PRINTER)
50
51// List of VM-global (i.e. non-isolate specific) flags.
52//
53// The value used for those flags at snapshot generation time needs to be the
54// same as during runtime. Currently, only boolean flags are supported.
55//
56// The syntax used is the same as that for FLAG_LIST below, as these flags are
57// automatically included in FLAG_LIST.
58#define VM_GLOBAL_FLAG_LIST(P, R, C, D) \
59 P(code_comments, bool, false, "Include comments into code and disassembly.") \
60 P(dwarf_stack_traces_mode, bool, false, \
61 "Use --[no-]dwarf-stack-traces instead.") \
62 P(lazy_dispatchers, bool, true, "Generate dispatchers lazily") \
63 R(dedup_instructions, true, bool, false, \
64 "Canonicalize instructions when precompiling.")
65
66// List of all flags in the VM.
67// Flags can be one of four categories:
68// * P roduct flags: Can be set in any of the deployment modes, including in
69// production.
70// * R elease flags: Generally available flags except when building product.
71// * pre C ompile flags: Generally available flags except when building product
72// or precompiled runtime.
73// * D ebug flags: Can only be set in debug VMs, which also have C++ assertions
74// enabled.
75//
76// Usage:
77// P(name, type, default_value, comment)
78// R(name, product_value, type, default_value, comment)
79// C(name, precompiled_value, product_value, type, default_value, comment)
80// D(name, type, default_value, comment)
81#define FLAG_LIST(P, R, C, D) \
82 VM_GLOBAL_FLAG_LIST(P, R, C, D) \
83 DISASSEMBLE_FLAGS(P, R, C, D) \
84 P(abort_on_oom, bool, false, \
85 "Abort if memory allocation fails - use only with --old-gen-heap-size") \
86 P(add_readonly_data_symbols, bool, false, \
87 "Add static symbols for objects in snapshot read-only data") \
88 P(background_compilation, bool, true, \
89 "Run optimizing compilation in background") \
90 P(check_token_positions, bool, false, \
91 "Check validity of token positions while compiling flow graphs") \
92 P(collect_dynamic_function_names, bool, true, \
93 "Collects all dynamic function names to identify unique targets") \
94 P(compactor_tasks, int, 2, \
95 "The number of tasks to use for parallel compaction.") \
96 P(concurrent_mark, bool, true, "Concurrent mark for old generation.") \
97 P(concurrent_sweep, bool, true, "Concurrent sweep for old generation.") \
98 C(deoptimize_alot, false, false, bool, false, \
99 "Deoptimizes we are about to return to Dart code from native entries.") \
100 C(deoptimize_every, 0, 0, int, 0, \
101 "Deoptimize on every N stack overflow checks") \
102 P(deoptimize_on_runtime_call_every, int, 0, \
103 "Deoptimize functions on every runtime call.") \
104 P(dontneed_on_sweep, bool, false, \
105 "madvise(DONTNEED) free areas in partially used heap regions") \
106 R(dump_megamorphic_stats, false, bool, false, \
107 "Dump megamorphic cache statistics") \
108 R(dump_symbol_stats, false, bool, false, "Dump symbol table statistics") \
109 P(enable_asserts, bool, false, "Enable assert statements.") \
110 P(inline_alloc, bool, true, "Whether to use inline allocation fast paths.") \
111 P(enable_mirrors, bool, true, \
112 "Disable to make importing dart:mirrors an error.") \
113 P(enable_ffi, bool, true, "Disable to make importing dart:ffi an error.") \
114 P(force_clone_compiler_objects, bool, false, \
115 "Force cloning of objects needed in compiler (ICData and Field).") \
116 P(guess_icdata_cid, bool, true, \
117 "Artificially create type feedback for arithmetic etc. operations") \
118 P(huge_method_cutoff_in_ast_nodes, int, 10000, \
119 "Huge method cutoff in AST nodes: Disables optimizations for huge " \
120 "methods.") \
121 P(idle_timeout_micros, int, 61 * kMicrosecondsPerSecond, \
122 "Consider thread pool isolates for idle tasks after this long.") \
123 P(idle_duration_micros, int, kMaxInt32, \
124 "Allow idle tasks to run for this long.") \
125 P(interpret_irregexp, bool, false, "Use irregexp bytecode interpreter") \
126 P(link_natives_lazily, bool, false, "Link native calls lazily") \
127 R(log_marker_tasks, false, bool, false, \
128 "Log debugging information for old gen GC marking tasks.") \
129 P(scavenger_tasks, int, 2, \
130 "The number of tasks to spawn during scavenging (0 means " \
131 "perform all marking on main thread).") \
132 P(mark_when_idle, bool, false, \
133 "The Dart thread will assist in concurrent marking during idle time and " \
134 "is counted as one marker task") \
135 P(marker_tasks, int, 2, \
136 "The number of tasks to spawn during old gen GC marking (0 means " \
137 "perform all marking on main thread).") \
138 P(hash_map_probes_limit, int, kMaxInt32, \
139 "Limit number of probes while doing lookups in hash maps.") \
140 P(max_polymorphic_checks, int, 4, \
141 "Maximum number of polymorphic check, otherwise it is megamorphic.") \
142 P(max_equality_polymorphic_checks, int, 32, \
143 "Maximum number of polymorphic checks in equality operator,") \
144 P(new_gen_semi_max_size, int, kDefaultNewGenSemiMaxSize, \
145 "Max size of new gen semi space in MB") \
146 P(new_gen_semi_initial_size, int, (kWordSize <= 4) ? 1 : 2, \
147 "Initial size of new gen semi space in MB") \
148 P(optimization_counter_threshold, int, kDefaultOptimizationCounterThreshold, \
149 "Function's usage-counter value before it is optimized, -1 means never") \
150 P(optimization_level, int, 2, \
151 "Optimization level: 1 (favor size), 2 (default), 3 (favor speed)") \
152 P(old_gen_heap_size, int, kDefaultMaxOldGenHeapSize, \
153 "Max size of old gen heap size in MB, or 0 for unlimited," \
154 "e.g: --old_gen_heap_size=1024 allows up to 1024MB old gen heap") \
155 R(pause_isolates_on_start, false, bool, false, \
156 "Pause isolates before starting.") \
157 R(pause_isolates_on_exit, false, bool, false, "Pause isolates exiting.") \
158 R(pause_isolates_on_unhandled_exceptions, false, bool, false, \
159 "Pause isolates on unhandled exceptions.") \
160 P(polymorphic_with_deopt, bool, true, \
161 "Polymorphic calls with deoptimization / megamorphic call") \
162 P(precompiled_mode, bool, false, "Precompilation compiler mode") \
163 P(print_snapshot_sizes, bool, false, "Print sizes of generated snapshots.") \
164 P(print_snapshot_sizes_verbose, bool, false, \
165 "Print cluster sizes of generated snapshots.") \
166 R(print_ssa_liveranges, false, bool, false, \
167 "Print live ranges after allocation.") \
168 R(print_stacktrace_at_api_error, false, bool, false, \
169 "Attempt to print a native stack trace when an API error is created.") \
170 D(print_variable_descriptors, bool, false, \
171 "Print variable descriptors in disassembly.") \
172 R(profiler, false, bool, false, "Enable the profiler.") \
173 R(profiler_native_memory, false, bool, false, \
174 "Enable native memory statistic collection.") \
175 P(reorder_basic_blocks, bool, true, "Reorder basic blocks") \
176 C(stress_async_stacks, false, false, bool, false, \
177 "Stress test async stack traces") \
178 P(retain_function_objects, bool, true, \
179 "Serialize function objects for all code objects even if not otherwise " \
180 "needed in the precompiled runtime.") \
181 P(retain_code_objects, bool, true, \
182 "Serialize all code objects even if not otherwise " \
183 "needed in the precompiled runtime.") \
184 P(show_invisible_frames, bool, false, \
185 "Show invisible frames in stack traces.") \
186 P(target_unknown_cpu, bool, false, \
187 "Generate code for a generic CPU, unknown at compile time") \
188 D(trace_cha, bool, false, "Trace CHA operations") \
189 R(trace_field_guards, false, bool, false, "Trace changes in field's cids.") \
190 D(trace_finalizers, bool, false, "Traces finalizers.") \
191 D(trace_ic, bool, false, "Trace IC handling") \
192 D(trace_ic_miss_in_optimized, bool, false, \
193 "Trace IC miss in optimized code") \
194 C(trace_irregexp, false, false, bool, false, "Trace irregexps.") \
195 D(trace_intrinsified_natives, bool, false, \
196 "Report if any of the intrinsified natives are called") \
197 D(trace_isolates, bool, false, "Trace isolate creation and shut down.") \
198 D(trace_handles, bool, false, "Traces allocation of handles.") \
199 D(trace_kernel_binary, bool, false, "Trace Kernel reader/writer.") \
200 D(trace_natives, bool, false, "Trace invocation of natives") \
201 D(trace_optimization, bool, false, "Print optimization details.") \
202 R(trace_profiler, false, bool, false, "Profiler trace") \
203 D(trace_profiler_verbose, bool, false, "Verbose profiler trace") \
204 D(trace_runtime_calls, bool, false, "Trace runtime calls.") \
205 R(trace_ssa_allocator, false, bool, false, \
206 "Trace register allocation over SSA.") \
207 P(trace_strong_mode_types, bool, false, \
208 "Trace optimizations based on strong mode types.") \
209 D(trace_type_checks, bool, false, "Trace runtime type checks.") \
210 D(trace_type_checks_verbose, bool, false, \
211 "Enable verbose trace of runtime type checks.") \
212 D(trace_patching, bool, false, "Trace patching of code.") \
213 D(trace_optimized_ic_calls, bool, false, \
214 "Trace IC calls in optimized code.") \
215 D(trace_zones, bool, false, "Traces allocation sizes in the zone.") \
216 P(truncating_left_shift, bool, true, \
217 "Optimize left shift to truncate if possible") \
218 P(use_compactor, bool, false, "Compact the heap during old-space GC.") \
219 P(use_cha_deopt, bool, true, \
220 "Use class hierarchy analysis even if it can cause deoptimization.") \
221 P(use_field_guards, bool, true, "Use field guards and track field types") \
222 C(use_osr, false, true, bool, true, "Use OSR") \
223 P(use_slow_path, bool, false, "Whether to avoid inlined fast paths.") \
224 P(verbose_gc, bool, false, "Enables verbose GC.") \
225 P(verbose_gc_hdr, int, 40, "Print verbose GC header interval.") \
226 R(verify_after_gc, false, bool, false, \
227 "Enables heap verification after GC.") \
228 R(verify_before_gc, false, bool, false, \
229 "Enables heap verification before GC.") \
230 R(verify_store_buffer, false, bool, false, \
231 "Enables store buffer verification before and after scavenges.") \
232 R(verify_after_marking, false, bool, false, \
233 "Enables heap verification after marking.") \
234 P(enable_slow_path_sharing, bool, true, "Enable sharing of slow-path code.") \
235 P(shared_slow_path_triggers_gc, bool, false, \
236 "TESTING: slow-path triggers a GC.") \
237 P(enable_multiple_entrypoints, bool, true, \
238 "Enable multiple entrypoints per-function and related optimizations.") \
239 P(enable_testing_pragmas, bool, false, \
240 "Enable magical pragmas for testing purposes. Use at your own risk!") \
241 R(eliminate_type_checks, true, bool, true, \
242 "Eliminate type checks when allowed by static type analysis.") \
243 D(support_rr, bool, false, "Support running within RR.") \
244 P(verify_entry_points, bool, false, \
245 "Throw API error on invalid member access through native API. See " \
246 "entry_point_pragma.md") \
247 C(branch_coverage, false, false, bool, false, "Enable branch coverage")
248
249#endif // RUNTIME_VM_FLAG_LIST_H_
constexpr bool FLAG_support_il_printer
Definition flag_list.h:48
constexpr intptr_t kDefaultOptimizationCounterThreshold
Definition flag_list.h:23
constexpr bool kDartPrecompiledRuntime
Definition flag_list.h:20