mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
[vm] Remove support for '-c', '--checked' flags and '--enable-checked-mode'
1. Remove support for the following flags '-c', '--checked' and '--enable-checked-mode' 2. Cleanup some of the tests and test scripts where these options were being passed. https://github.com/dart-lang/sdk/issues/34660 Change-Id: I4d8aa0d14bd054cfba08d78a411a0df4fc829df1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97550 Commit-Queue: Siva Annamalai <asiva@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
c614b99ae1
commit
1bab46b06f
|
@ -8,6 +8,7 @@
|
|||
|
||||
### Dart VM
|
||||
|
||||
* Support for deprecated flags '-c' and '--checked' has been removed
|
||||
* RegExp patterns can now use lookbehind assertions.
|
||||
* RegExp patterns can now use named capture groups and named backreferences.
|
||||
Currently, named group matches can only be retrieved in Dart either by
|
||||
|
|
|
@ -62,4 +62,4 @@ esac
|
|||
|
||||
shift
|
||||
|
||||
exec "${DART_VM}" "${EXTRA_VM_ARGS[@]}" -c "${SCRIPT}" "$@"
|
||||
exec "${DART_VM}" "${EXTRA_VM_ARGS[@]}" "${SCRIPT}" "$@"
|
||||
|
|
|
@ -351,8 +351,6 @@ bool Options::ProcessAbiVersionOption(const char* arg,
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool checked_set = false;
|
||||
|
||||
int Options::ParseArguments(int argc,
|
||||
char** argv,
|
||||
bool vm_run_app_snapshot,
|
||||
|
@ -376,14 +374,7 @@ int Options::ParseArguments(int argc,
|
|||
i++;
|
||||
} else {
|
||||
// Check if this flag is a potentially valid VM flag.
|
||||
const char* kChecked = "-c";
|
||||
const char* kCheckedFull = "--checked";
|
||||
if ((strncmp(argv[i], kChecked, strlen(kChecked)) == 0) ||
|
||||
(strncmp(argv[i], kCheckedFull, strlen(kCheckedFull)) == 0)) {
|
||||
checked_set = true;
|
||||
i++;
|
||||
continue; // '-c' is not a VM flag so don't add to vm options.
|
||||
} else if (!OptionProcessor::IsValidFlag(argv[i], kPrefix, kPrefixLen)) {
|
||||
if (!OptionProcessor::IsValidFlag(argv[i], kPrefix, kPrefixLen)) {
|
||||
break;
|
||||
}
|
||||
// The following two flags are processed by both the embedder and
|
||||
|
@ -485,9 +476,6 @@ int Options::ParseArguments(int argc,
|
|||
" run using a snapshot is invalid.\n");
|
||||
return -1;
|
||||
}
|
||||
if (checked_set) {
|
||||
vm_options->AddArgument("--enable-asserts");
|
||||
}
|
||||
|
||||
// If --snapshot is given without --snapshot-kind, default to script snapshot.
|
||||
if ((snapshot_filename_ != NULL) && (gen_snapshot_kind_ == kNone)) {
|
||||
|
|
|
@ -66,20 +66,6 @@ DECLARE_FLAG(bool, reload_every_back_off);
|
|||
DECLARE_FLAG(bool, trace_reload);
|
||||
#endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#if !defined(PRODUCT)
|
||||
static void CheckedModeHandler(bool value) {
|
||||
FLAG_enable_asserts = value;
|
||||
}
|
||||
|
||||
// --enable-checked-mode and --checked both enable checked mode which is
|
||||
// equivalent to setting --enable-asserts and --enable-type-checks.
|
||||
DEFINE_FLAG_HANDLER(CheckedModeHandler,
|
||||
enable_checked_mode,
|
||||
"Enable checked mode.");
|
||||
|
||||
DEFINE_FLAG_HANDLER(CheckedModeHandler, checked, "Enable checked mode.");
|
||||
#endif // !defined(PRODUCT)
|
||||
|
||||
static void DeterministicModeHandler(bool value) {
|
||||
if (value) {
|
||||
FLAG_background_compilation = false; // Timing dependent.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
// VMOptions=--enable_checked_mode
|
||||
|
||||
import "dart:collection";
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
// VMOptions=--enable_checked_mode
|
||||
// Tests the type checking when passing code into closure from inside a factory method
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
|
|
@ -177,21 +177,10 @@ class NoneCompilerConfiguration extends CompilerConfiguration {
|
|||
List<String> originalArguments,
|
||||
CommandArtifact artifact) {
|
||||
var args = <String>[];
|
||||
if (previewDart2) {
|
||||
if (_isDebug) {
|
||||
// Temporarily disable background compilation to avoid flaky crashes
|
||||
// (see http://dartbug.com/30016 for details).
|
||||
args.add('--no-background-compilation');
|
||||
}
|
||||
if (_isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
}
|
||||
} else {
|
||||
args.add('--no-preview-dart-2');
|
||||
if (_isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
args.add('--enable_type_checks');
|
||||
}
|
||||
if (_isDebug) {
|
||||
// Temporarily disable background compilation to avoid flaky crashes
|
||||
// (see http://dartbug.com/30016 for details).
|
||||
args.add('--no-background-compilation');
|
||||
}
|
||||
if (_useEnableAsserts) {
|
||||
args.add('--enable_asserts');
|
||||
|
@ -259,7 +248,7 @@ class VMKernelCompilerConfiguration extends CompilerConfiguration
|
|||
List<String> originalArguments,
|
||||
CommandArtifact artifact) {
|
||||
var args = <String>[];
|
||||
if (_isChecked || _useEnableAsserts) {
|
||||
if (_useEnableAsserts) {
|
||||
args.add('--enable_asserts');
|
||||
}
|
||||
if (_configuration.hotReload) {
|
||||
|
@ -621,7 +610,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
int get timeoutMultiplier {
|
||||
var multiplier = 2;
|
||||
if (_isDebug) multiplier *= 4;
|
||||
if (_isChecked) multiplier *= 2;
|
||||
if (_useEnableAsserts) multiplier *= 2;
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
|
@ -629,15 +618,13 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
var commands = <Command>[];
|
||||
|
||||
if (previewDart2) {
|
||||
commands.add(computeCompileToKernelCommand(
|
||||
tempDir, arguments, environmentOverrides));
|
||||
}
|
||||
commands.add(computeCompileToKernelCommand(
|
||||
tempDir, arguments, environmentOverrides));
|
||||
|
||||
commands.add(
|
||||
computeDartBootstrapCommand(tempDir, arguments, environmentOverrides));
|
||||
|
||||
if (previewDart2 && !_configuration.keepGeneratedFiles) {
|
||||
if (!_configuration.keepGeneratedFiles) {
|
||||
commands.add(computeRemoveKernelFileCommand(
|
||||
tempDir, arguments, environmentOverrides));
|
||||
}
|
||||
|
@ -709,12 +696,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
args.add('--obfuscate');
|
||||
}
|
||||
|
||||
if (previewDart2) {
|
||||
args.addAll(_replaceDartFiles(arguments, tempKernelFile(tempDir)));
|
||||
} else {
|
||||
args.add('--no-preview-dart-2');
|
||||
args.addAll(arguments);
|
||||
}
|
||||
args.addAll(_replaceDartFiles(arguments, tempKernelFile(tempDir)));
|
||||
|
||||
return Command.compilation('precompiler', tempDir, bootstrapDependencies(),
|
||||
exec, args, environmentOverrides,
|
||||
|
@ -816,10 +798,6 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
List<String> ddcOptions,
|
||||
List<String> originalArguments) {
|
||||
List<String> args = [];
|
||||
if (_isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
args.add('--enable_type_checks');
|
||||
}
|
||||
return args
|
||||
..addAll(filterVmOptions(vmOptions))
|
||||
..addAll(sharedOptions)
|
||||
|
@ -835,17 +813,6 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
List<String> originalArguments,
|
||||
CommandArtifact artifact) {
|
||||
var args = <String>[];
|
||||
if (previewDart2) {
|
||||
if (_isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
}
|
||||
} else {
|
||||
args.add('--no-preview-dart-2');
|
||||
if (_isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
args.add('--enable_type_checks');
|
||||
}
|
||||
}
|
||||
if (_useEnableAsserts) {
|
||||
args.add('--enable_asserts');
|
||||
}
|
||||
|
@ -876,7 +843,7 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
|
|||
int get timeoutMultiplier {
|
||||
var multiplier = 1;
|
||||
if (_isDebug) multiplier *= 2;
|
||||
if (_isChecked) multiplier *= 2;
|
||||
if (_useEnableAsserts) multiplier *= 2;
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
|
@ -894,9 +861,6 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
|
|||
var exec = "${_configuration.buildDirectory}/dart";
|
||||
var snapshot = "$tempDir/out.jitsnapshot";
|
||||
var args = ["--snapshot=$snapshot", "--snapshot-kind=app-jit"];
|
||||
if (!previewDart2) {
|
||||
args.add("--no-preview-dart-2");
|
||||
}
|
||||
args.addAll(arguments);
|
||||
|
||||
return Command.compilation('app_jit', tempDir, bootstrapDependencies(),
|
||||
|
@ -907,10 +871,6 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
|
|||
List<String> computeCompilerArguments(
|
||||
vmOptions, sharedOptions, dart2jsOptions, ddcOptions, originalArguments) {
|
||||
var args = <String>[];
|
||||
if (_isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
args.add('--enable_type_checks');
|
||||
}
|
||||
return args
|
||||
..addAll(vmOptions)
|
||||
..addAll(sharedOptions)
|
||||
|
@ -926,17 +886,6 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
|
|||
List<String> originalArguments,
|
||||
CommandArtifact artifact) {
|
||||
var args = <String>[];
|
||||
if (previewDart2) {
|
||||
if (_isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
}
|
||||
} else {
|
||||
args.add("--no-preview-dart-2");
|
||||
if (_isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
args.add('--enable_type_checks');
|
||||
}
|
||||
}
|
||||
if (_useEnableAsserts) {
|
||||
args.add('--enable_asserts');
|
||||
}
|
||||
|
@ -1082,8 +1031,6 @@ abstract class VMKernelCompilerMixin {
|
|||
|
||||
bool get _isAot;
|
||||
|
||||
bool get _isChecked;
|
||||
|
||||
bool get _useEnableAsserts;
|
||||
|
||||
String get executableScriptSuffix;
|
||||
|
@ -1124,7 +1071,7 @@ abstract class VMKernelCompilerMixin {
|
|||
!arguments.any((String arg) => noCausalAsyncStacksRegExp.hasMatch(arg));
|
||||
args.add('-Ddart.developer.causal_async_stacks=$causalAsyncStacks');
|
||||
|
||||
if (_isChecked || _useEnableAsserts) {
|
||||
if (_useEnableAsserts) {
|
||||
args.add('--enable_asserts');
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,6 @@ class TestConfiguration {
|
|||
}
|
||||
|
||||
var args = ['--test-mode'];
|
||||
if (isChecked) args.add('--enable-checked-mode');
|
||||
|
||||
if (isMinified) args.add("--minify");
|
||||
if (isCsp) args.add("--csp");
|
||||
|
|
|
@ -150,7 +150,6 @@ simdbc, simdbc64''',
|
|||
test options, specifying how tests should be run.''',
|
||||
abbr: 'n',
|
||||
hide: true),
|
||||
new _Option.bool('checked', 'Run tests in checked mode.'),
|
||||
new _Option.bool('strong', 'Deprecated, no-op.', hide: true),
|
||||
// TODO(sigmund): rename flag once we migrate all dart2js bots to the test
|
||||
// matrix.
|
||||
|
@ -690,7 +689,6 @@ compiler.''',
|
|||
useSdk: data["use_sdk"] as bool,
|
||||
useHotReload: data["hot_reload"] as bool,
|
||||
useHotReloadRollback: data["hot_reload_rollback"] as bool,
|
||||
isChecked: data["checked"] as bool,
|
||||
isHostChecked: data["host_checked"] as bool,
|
||||
isCsp: data["csp"] as bool,
|
||||
isMinified: data["minified"] as bool,
|
||||
|
|
Loading…
Reference in a new issue