Introduce --experimental

This flag, together with the DEFINE_EXPERIMENTAL_FEATURE macro, allows
declaring features as "experimental", implying that they are expected to
contain bugs and are not yet ready for fuzz testing for example.

Change-Id: I1288b6c2d28ef20d19d388bf56c57c44a25ba19b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181025
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85645}
This commit is contained in:
Samuel Groß 2023-02-01 10:57:37 +01:00 committed by V8 LUCI CQ
parent df0e9dca39
commit 65e87d962d
2 changed files with 27 additions and 0 deletions

View File

@ -4013,6 +4013,13 @@ void Shell::RunShell(Isolate* isolate) {
PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate));
Local<String> 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> ");

View File

@ -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,