diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h index ffa5eb6c90..3fbc0b03e1 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h @@ -227,6 +227,12 @@ DEFINE_BOOL(abort_on_contradictory_flags, false, // This implication is also hard-coded into the flags processing to make sure it // becomes active before we even process subsequent flags. DEFINE_NEG_IMPLICATION(fuzzing, abort_on_contradictory_flags) +// This is not really a flag, it affects the interpretation of the next flag but +// doesn't become permanently true when specified. This only works for flags +// defined in this file, but not for d8 flags defined in src/d8/d8.cc. +DEFINE_BOOL(allow_overwriting_for_next_flag, false, + "temporary disable flag contradiction to allow overwriting just " + "the next flag") // Flags for language modes and experimental language features. DEFINE_BOOL(use_strict, false, "enforce strict mode") diff --git a/src/flags/flags.cc b/src/flags/flags.cc index 982754a946..f9f74b009b 100644 --- a/src/flags/flags.cc +++ b/src/flags/flags.cc @@ -213,6 +213,13 @@ struct Flag { } static bool ShouldCheckFlagContradictions() { + if (FLAG_allow_overwriting_for_next_flag) { + // Setting the flag manually to false before calling Reset() avoids this + // becoming re-entrant. + FLAG_allow_overwriting_for_next_flag = false; + FindFlagByPointer(&FLAG_allow_overwriting_for_next_flag)->Reset(); + return false; + } return FLAG_abort_on_contradictory_flags && !FLAG_fuzzing; } @@ -268,9 +275,17 @@ struct Flag { name(), implied_by, hint); } else if (new_set_by == SetBy::kCommandLine && check_command_line_flags) { - FATAL( - "Command-line provided flag --%s specified multiple times.\n%s", - name(), hint); + if (is_bool_flag) { + FATAL( + "Command-line provided flag --%s specified as both true and " + "false.\n%s", + name(), hint); + } else { + FATAL( + "Command-line provided flag --%s specified multiple " + "times.\n%s", + name(), hint); + } } break; } diff --git a/test/mjsunit/ensure-growing-store-learns.js b/test/mjsunit/ensure-growing-store-learns.js index 6b697dbdf7..ba5e5ae5a9 100644 --- a/test/mjsunit/ensure-growing-store-learns.js +++ b/test/mjsunit/ensure-growing-store-learns.js @@ -2,14 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// The flags are processed left to right. --no-abort-on-contradictory-flags -// disables the checking for conflicts, then we process --noverify-heap and +// Overwrite the value for --noverify-heap and // --noenable-slow-asserts, which the test runner already set to true before. -// This causes the flags to be overwritten while silencing the error. Then we -// re-enable --abort-on-contradictory-flags to make sure that the processing of -// other flags and flag implications, which happens later, still produces -// errors. -// Flags: --no-abort-on-contradictory-flags --noverify-heap --noenable-slow-asserts --abort-on-contradictory-flags +// Due to flag contradiction checking, this requires +// --allow-overwriting-for-next-flag to avoid an error. +// Flags: --allow-overwriting-for-next-flag --noverify-heap +// Flags: --allow-overwriting-for-next-flag --noenable-slow-asserts // Flags: --allow-natives-syntax --opt --no-always-opt // --noverify-heap and --noenable-slow-asserts are set because the test is too diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index d4e95e4365..4307d1a209 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -865,13 +865,6 @@ 'harmony/atomics-waitasync-worker-shutdown-before-wait-finished-no-timeout': [SKIP], }], # 'isolates' -############################################################################## -['deopt_fuzzer or gc_fuzzer', { - # https://crbug.com/v8/10942 - 'ensure-growing-store-learns': [SKIP], - 'random-bit-correlations': [SKIP], -}], # 'deopt_fuzzer or gc_fuzzer' - ############################################################################## ['deopt_fuzzer', { diff --git a/test/mjsunit/random-bit-correlations.js b/test/mjsunit/random-bit-correlations.js index 301c50abeb..b7e2a3c0fe 100644 --- a/test/mjsunit/random-bit-correlations.js +++ b/test/mjsunit/random-bit-correlations.js @@ -3,13 +3,9 @@ // found in the LICENSE file. // Overwrite the random seed provided by the test runner to make this test less -// flaky. -// The flags are processed left to right. --no-abort-on-contradictory-flags -// disables the checking for conflicts, then we process --random-seed=20 to -// overwrite the value the test runner already set before. Then we re-enable -// --abort-on-contradictory-flags to make sure that the processing of other -// flags and flag implications, which happens later, still produces errors. -// Flags: --no-abort-on-contradictory-flags --random-seed=20 --abort-on-contradictory-flags +// flaky. Due to flag contradiction checking, this requires +// --allow-overwriting-for-next-flag to avoid an error. +// Flags: --allow-overwriting-for-next-flag --random-seed=20 // Flags: --nostress-opt --noalways-opt --predictable (function() {