diff --git a/src/d8/d8.cc b/src/d8/d8.cc index 8f9d5dbaf9..b10a9c4ba2 100644 --- a/src/d8/d8.cc +++ b/src/d8/d8.cc @@ -4013,6 +4013,13 @@ void Shell::RunShell(Isolate* isolate) { PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate)); Local name = String::NewFromUtf8Literal(isolate, "(d8)"); printf("V8 version %s\n", V8::GetVersion()); + if (i::v8_flags.experimental) { + // This message is printed to stderr so that it is also visible in + // Clusterfuzz reports. + fprintf(stderr, + "V8 is running with experimental features enabled. Stability and " + "security will suffer.\n"); + } while (true) { HandleScope inner_scope(isolate); printf("d8> "); diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h index da37c4cd36..14a4a272a9 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h @@ -187,6 +187,26 @@ // #define FLAG FLAG_FULL +// Experimental features. +// Features that are still considered experimental and which are not ready for +// fuzz testing should be defined using this macro. The feature will then imply +// --experimental, which will indicate to the user that they are running an +// experimental configuration of V8. Experimental features are always disabled +// by default. When these features mature, the flag should first turn into a +// regular feature flag (still disabled by default) and then ideally be staged +// behind (for example) --future before being enabled by default. +DEFINE_BOOL(experimental, false, + "Indicates that V8 is running with experimental features enabled. " + "This flag is typically not set explicitly but instead enabled as " + "an implication of other flags which enable experimental features.") +// Features considered experimental should not be staged behind --future. +DEFINE_NEG_IMPLICATION(future, experimental) +// Features considered experimental are not ready for fuzzing. +DEFINE_NEG_IMPLICATION(fuzzing, experimental) +#define DEFINE_EXPERIMENTAL_FEATURE(nam, cmt) \ + FLAG(BOOL, bool, nam, false, cmt " (experimental)") \ + DEFINE_IMPLICATION(nam, experimental) + // ATTENTION: This is set to true by default in d8. But for API compatibility, // it generally defaults to false. DEFINE_BOOL(abort_on_contradictory_flags, false,