7777 changed |= TriggerImplication(!v8_flags.whenflag, "!" #whenflag, \
7878 &v8_flags.thenflag, #thenflag, value, false);
7979
80+ #define DEFINE_NEG_VALUE_VALUE_IMPLICATION (whenflag , whenvalue , thenflag , \
81+ thenvalue ) \
82+ changed |= \
83+ TriggerImplication(v8_flags.whenflag != whenvalue, #whenflag, \
84+ &v8_flags.thenflag, #thenflag, thenvalue, false);
85+
86+ #define DEFINE_MIN_VALUE_IMPLICATION (flag , min_value ) \
87+ changed |= TriggerImplication(v8_flags.flag < min_value, #flag, \
88+ &v8_flags.flag, #flag, min_value, false);
89+
90+ #define DEFINE_DISABLE_FLAG_IMPLICATION (whenflag , thenflag ) \
91+ if (v8_flags.whenflag && v8_flags.thenflag) { \
92+ PrintF(stderr, "Warning: disabling flag --" #thenflag \
93+ " due to conflicting flags\n"); \
94+ } \
95+ DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false)
96+
8097// We apply a generic macro to the flags.
8198#elif defined(FLAG_MODE_APPLY )
8299
114131#ifndef DEFINE_NEG_VALUE_IMPLICATION
115132#define DEFINE_NEG_VALUE_IMPLICATION (whenflag , thenflag , value )
116133#endif
134+ #ifndef DEFINE_NEG_VALUE_VALUE_IMPLICATION
135+ #define DEFINE_NEG_VALUE_VALUE_IMPLICATION (whenflag , whenvalue , thenflag , \
136+ thenvalue )
137+ #endif
138+
139+ #ifndef DEFINE_MIN_VALUE_IMPLICATION
140+ #define DEFINE_MIN_VALUE_IMPLICATION (flag , min_value )
141+ #endif
142+
143+ #ifndef DEFINE_DISABLE_FLAG_IMPLICATION
144+ #define DEFINE_DISABLE_FLAG_IMPLICATION (whenflag , thenflag )
145+ #endif
117146
118147#ifndef DEBUG_BOOL
119148#error DEBUG_BOOL must be defined at this point.
@@ -1141,6 +1170,46 @@ DEFINE_SLOW_TRACING_BOOL(trace_representation, false,
11411170DEFINE_BOOL (
11421171 trace_turbo_stack_accesses , false,
11431172 "trace stack load/store counters for optimized code in run-time (x64 only)" )
1173+
1174+ // When fuzzing and concurrent compilation is enabled, disable Turbofan
1175+ // tracing flags since reading/printing heap state is not thread-safe and
1176+ // leads to false positives on TSAN bots.
1177+ // TODO(chromium:1205289): Teach relevant fuzzers to not pass TF tracing
1178+ // flags instead, and remove this section.
1179+ DEFINE_BOOL (fuzzing_and_concurrent_recompilation , true,
1180+ "fuzzing && concurrent_recompilation" )
1181+ DEFINE_NEG_NEG_IMPLICATION (fuzzing , fuzzing_and_concurrent_recompilation )
1182+ DEFINE_NEG_NEG_IMPLICATION (concurrent_recompilation ,
1183+ fuzzing_and_concurrent_recompilation )
1184+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1185+ trace_turbo )
1186+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1187+ trace_turbo_graph )
1188+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1189+ trace_turbo_scheduled )
1190+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1191+ trace_turbo_reduction )
1192+ #ifdef V8_ENABLE_SLOW_TRACING
1193+ // If expensive tracing is disabled via a build flag, the following flags
1194+ // cannot be disabled (because they are already).
1195+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1196+ trace_turbo_trimming )
1197+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1198+ trace_turbo_jt )
1199+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1200+ trace_turbo_ceq )
1201+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1202+ trace_turbo_loop )
1203+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1204+ trace_turbo_alloc )
1205+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1206+ trace_all_uses )
1207+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1208+ trace_representation )
1209+ #endif
1210+ DEFINE_DISABLE_FLAG_IMPLICATION (fuzzing_and_concurrent_recompilation ,
1211+ trace_turbo_stack_accesses )
1212+
11441213DEFINE_BOOL (turbo_verify , DEBUG_BOOL , "verify TurboFan graphs at each phase" )
11451214DEFINE_STRING (turbo_verify_machine_graph , nullptr ,
11461215 "verify TurboFan machine graph before instruction selection" )
@@ -1416,6 +1485,24 @@ DEFINE_BOOL(wasm_to_js_generic_wrapper, true,
14161485 "allow use of the generic wasm-to-js wrapper instead of "
14171486 "per-signature wrappers" )
14181487DEFINE_BOOL (expose_wasm , true, "expose wasm interface to JavaScript" )
1488+ // Do not expose wasm in jitless mode.
1489+ //
1490+ // Even in interpreter-only mode, wasm currently still creates executable
1491+ // memory at runtime. Unexpose wasm until this changes.
1492+ // The correctness fuzzers are a special case: many of their test cases are
1493+ // built by fetching a random property from the the global object, and thus
1494+ // the global object layout must not change between configs. That is why we
1495+ // continue exposing wasm on correctness fuzzers even in jitless mode.
1496+ // TODO(jgruber): Remove this once / if wasm can run without executable
1497+ // memory.
1498+ DEFINE_BOOL (jitless_and_not_correctness_fuzzer_suppressions , true,
1499+ "jitless && !correctness_fuzzer_suppressions" )
1500+ DEFINE_NEG_NEG_IMPLICATION (jitless ,
1501+ jitless_and_not_correctness_fuzzer_suppressions )
1502+ DEFINE_NEG_IMPLICATION (correctness_fuzzer_suppressions ,
1503+ jitless_and_not_correctness_fuzzer_suppressions )
1504+ DEFINE_DISABLE_FLAG_IMPLICATION (jitless_and_not_correctness_fuzzer_suppressions ,
1505+ expose_wasm )
14191506DEFINE_INT (wasm_num_compilation_tasks , 128 ,
14201507 "maximum number of parallel compilation tasks for wasm" )
14211508DEFINE_VALUE_IMPLICATION (single_threaded , wasm_num_compilation_tasks , 0 )
@@ -1719,6 +1806,8 @@ DEFINE_SIZE_T(max_semi_space_size, 0,
17191806 "max size of a semi-space (in MBytes), the new space consists of "
17201807 "two semi-spaces" )
17211808DEFINE_INT (semi_space_growth_factor , 2 , "factor by which to grow the new space" )
1809+ // Set minimum semi space growth factor
1810+ DEFINE_MIN_VALUE_IMPLICATION (semi_space_growth_factor , 2 )
17221811DEFINE_SIZE_T (max_old_space_size , 0 , "max size of the old space (in Mbytes)" )
17231812DEFINE_SIZE_T (
17241813 max_heap_size , 0 ,
@@ -1927,6 +2016,9 @@ DEFINE_BOOL(stress_compaction, false,
19272016DEFINE_BOOL (stress_compaction_random , false,
19282017 "Stress GC compaction by selecting random percent of pages as "
19292018 "evacuation candidates. Overrides stress_compaction." )
2019+ DEFINE_IMPLICATION (stress_compaction , force_marking_deque_overflows )
2020+ DEFINE_IMPLICATION (stress_compaction , gc_global )
2021+ DEFINE_VALUE_IMPLICATION (stress_compaction , max_semi_space_size , (size_t )1 )
19302022DEFINE_BOOL (flush_baseline_code , false,
19312023 "flush of baseline code when it has not been executed recently" )
19322024DEFINE_BOOL (flush_bytecode , true,
@@ -2992,6 +3084,13 @@ DEFINE_NEG_IMPLICATION(predictable, parallel_compile_tasks_for_lazy)
29923084DEFINE_NEG_IMPLICATION (predictable , maglev_deopt_data_on_background )
29933085DEFINE_NEG_IMPLICATION (predictable , maglev_build_code_on_background )
29943086#endif // V8_ENABLE_MAGLEV
3087+ // Avoid random seeds in predictable mode.
3088+ DEFINE_BOOL (predictable_and_random_seed_is_0 , true,
3089+ "predictable && (random_seed == 0)" )
3090+ DEFINE_NEG_NEG_IMPLICATION (predictable , predictable_and_random_seed_is_0 )
3091+ DEFINE_NEG_VALUE_VALUE_IMPLICATION (random_seed , 0 ,
3092+ predictable_and_random_seed_is_0 , false)
3093+ DEFINE_VALUE_IMPLICATION (predictable_and_random_seed_is_0 , random_seed , 12347 )
29953094
29963095DEFINE_BOOL (predictable_gc_schedule , false,
29973096 "Predictable garbage collection schedule. Fixes heap growing, "
@@ -3060,6 +3159,35 @@ DEFINE_IMPLICATION(verify_predictable, predictable)
30603159DEFINE_INT (dump_allocations_digest_at_alloc , -1 ,
30613160 "dump allocations digest each n-th allocation" )
30623161
3162+ #define LOG_FLAGS (V ) \
3163+ V(log_code) \
3164+ V(log_code_disassemble) \
3165+ V(log_deopt) \
3166+ V(log_feedback_vector) \
3167+ V(log_function_events) \
3168+ V(log_ic) \
3169+ V(log_maps) \
3170+ V(log_source_code) \
3171+ V(log_source_position) \
3172+ V(log_timer_events) \
3173+ V(prof) \
3174+ V(prof_cpp)
3175+
3176+ #define SET_IMPLICATIONS (V ) \
3177+ DEFINE_IMPLICATION(log_all, V) \
3178+ DEFINE_IMPLICATION(V, log)
3179+
3180+ LOG_FLAGS (SET_IMPLICATIONS )
3181+
3182+ #undef SET_IMPLICATIONS
3183+ #undef LOG_FLAGS
3184+
3185+ DEFINE_IMPLICATION (log_all , log )
3186+ DEFINE_IMPLICATION (perf_prof , log )
3187+ DEFINE_IMPLICATION (perf_basic_prof , log )
3188+ DEFINE_IMPLICATION (ll_prof , log )
3189+ DEFINE_IMPLICATION (gdbjit , log )
3190+
30633191// Cleanup...
30643192#undef FLAG_FULL
30653193#undef FLAG_READONLY
@@ -3075,10 +3203,14 @@ DEFINE_INT(dump_allocations_digest_at_alloc, -1,
30753203#undef DEFINE_IMPLICATION
30763204#undef DEFINE_WEAK_IMPLICATION
30773205#undef DEFINE_NEG_IMPLICATION
3206+ #undef DEFINE_NEG_IMPLICATION_WITH_WARNING
30783207#undef DEFINE_WEAK_NEG_IMPLICATION
30793208#undef DEFINE_NEG_NEG_IMPLICATION
30803209#undef DEFINE_NEG_VALUE_IMPLICATION
3210+ #undef DEFINE_NEG_VALUE_VALUE_IMPLICATION
30813211#undef DEFINE_VALUE_IMPLICATION
3212+ #undef DEFINE_MIN_VALUE_IMPLICATION
3213+ #undef DEFINE_DISABLE_FLAG_IMPLICATION
30823214#undef DEFINE_WEAK_VALUE_IMPLICATION
30833215#undef DEFINE_GENERIC_IMPLICATION
30843216#undef DEFINE_ALIAS_BOOL
0 commit comments