mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[VM] Added '--enable-asserts' to the top-level help message.
Change-Id: I91b22cc1563b7c5217f21032109d948a5bb78b57 Reviewed-on: https://dart-review.googlesource.com/48456 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
parent
44dbba2b80
commit
42581e4fa6
|
@ -63,10 +63,14 @@ ENUM_OPTIONS_LIST(ENUM_OPTION_DEFINITION)
|
|||
CB_OPTIONS_LIST(CB_OPTION_DEFINITION)
|
||||
#undef CB_OPTION_DEFINITION
|
||||
|
||||
static bool checked_set = false;
|
||||
static bool preview_dart_2_set = false;
|
||||
|
||||
static void SetPreviewDart2Options(CommandLineOptions* vm_options) {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
Options::dfe()->set_use_dfe();
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
preview_dart_2_set = true;
|
||||
vm_options->AddArgument("--strong");
|
||||
vm_options->AddArgument("--reify-generic-functions");
|
||||
vm_options->AddArgument("--limit-ints-to-64-bits");
|
||||
|
@ -125,7 +129,10 @@ void Options::PrintUsage() {
|
|||
Log::PrintErr(
|
||||
"Common options:\n"
|
||||
"--checked or -c\n"
|
||||
" Insert runtime type checks and enable assertions (checked mode).\n"
|
||||
" Insert runtime type checks and enable assertions (checked mode, not\n"
|
||||
" compatible with --preview-dart-2).\n"
|
||||
"--enable-asserts\n"
|
||||
" Enable assert statements.\n"
|
||||
"--help or -h\n"
|
||||
" Display this message (add -v or --verbose for information about\n"
|
||||
" all VM options).\n"
|
||||
|
@ -156,7 +163,10 @@ void Options::PrintUsage() {
|
|||
Log::PrintErr(
|
||||
"Supported options:\n"
|
||||
"--checked or -c\n"
|
||||
" Insert runtime type checks and enable assertions (checked mode).\n"
|
||||
" Insert runtime type checks and enable assertions (checked mode, not\n"
|
||||
" compatible with --preview-dart-2).\n"
|
||||
"--enable-asserts\n"
|
||||
" Enable assert statements.\n"
|
||||
"--help or -h\n"
|
||||
" Display this message (add -v or --verbose for information about\n"
|
||||
" all VM options).\n"
|
||||
|
@ -339,6 +349,7 @@ int Options::ParseArguments(int argc,
|
|||
} else {
|
||||
// Check if this flag is a potentially valid VM flag.
|
||||
const char* kChecked = "-c";
|
||||
const char* kCheckedFull = "--checked";
|
||||
const char* kPackageRoot = "-p";
|
||||
if (strncmp(argv[i], kPackageRoot, strlen(kPackageRoot)) == 0) {
|
||||
// If argv[i] + strlen(kPackageRoot) is \0, then look in argv[i + 1]
|
||||
|
@ -356,8 +367,10 @@ int Options::ParseArguments(int argc,
|
|||
package_root_ = opt;
|
||||
i++;
|
||||
continue; // '-p' is not a VM flag so don't add to vm options.
|
||||
} else if (strncmp(argv[i], kChecked, strlen(kChecked)) == 0) {
|
||||
vm_options->AddArgument("--checked");
|
||||
} else if ((strncmp(argv[i], kChecked, strlen(kChecked)) == 0) ||
|
||||
(strncmp(argv[i], kCheckedFull, strlen(kCheckedFull)) == 0)) {
|
||||
checked_set = true;
|
||||
vm_options->AddArgument(kCheckedFull);
|
||||
i++;
|
||||
continue; // '-c' is not a VM flag so don't add to vm options.
|
||||
} else if (!OptionProcessor::IsValidFlag(argv[i], kPrefix, kPrefixLen)) {
|
||||
|
@ -434,6 +447,10 @@ int Options::ParseArguments(int argc,
|
|||
" run using a snapshot is invalid.\n");
|
||||
return -1;
|
||||
}
|
||||
if (checked_set && preview_dart_2_set) {
|
||||
Log::PrintErr("Flags --checked and --preview-dart-2 are not compatible.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// If --snapshot is given without --snapshot-kind, default to script snapshot.
|
||||
if ((snapshot_filename_ != NULL) && (gen_snapshot_kind_ == kNone)) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
// Dart test program to test arithmetic operations.
|
||||
// VMOptions=--optimization-counter-threshold=10 --checked --no-background-compilation
|
||||
// VMOptions=--optimization-counter-threshold=10 --no-background-compilation
|
||||
|
||||
// This test crashes if we recompute type of AssertAssignableInstr based on its
|
||||
// output types. By doing that we would eliminate not only the unnecessary
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) 2011, 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=--checked
|
||||
|
||||
/// Dart test program testing generic type allocations and generic type tests.
|
||||
import "package:expect/expect.dart";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
// Test various optimizations and deoptimizations of optimizing compiler..
|
||||
// VMOptions=--checked --enable-inlining-annotations --no-background-compilation --optimization-counter-threshold=1000
|
||||
// VMOptions=--enable-inlining-annotations --no-background-compilation --optimization-counter-threshold=1000
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
// OtherScripts=issue_24243_child1_isolate.dart
|
||||
// OtherScripts=issue_24243_child2_isolate.dart
|
||||
// OtherScripts=issue_24243_child3_isolate.dart
|
||||
// VMOptions=--checked
|
||||
|
||||
import 'dart:collection';
|
||||
import 'dart:isolate';
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Dart test program for testing isolate communication with
|
||||
// typed objects.
|
||||
// VMOptions=--checked
|
||||
|
||||
library TypedMessageTest;
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ html/transition_event_test: Skip # Times out. Issue 22167
|
|||
[ !$checked && !$strong ]
|
||||
async/future_or_only_in_async_test/00: MissingCompileTimeError
|
||||
async/multiple_timer_test: Pass, Fail # Timing related
|
||||
isolate/issue_24243_parent_isolate_test: SkipByDesign # Requires type checks.
|
||||
|
||||
[ !$fasta && $strong ]
|
||||
mirrors/redirecting_factory_test: CompileTimeError # Issue 30855
|
||||
|
|
Loading…
Reference in a new issue