[VM] Turn dart2 on by default on the command line VM

- make Dart2 the default option for the command line VM
- add option --no-preview-dart-2 as a fallback option to run dart1
- change test scripts to use the executable dart for testing dart2 mode instead of
pkg/vm/tool/dart2
- adjust numerous build and test configurations

Change-Id: Id813fa5b71a89c7ec9335d3f6e83cfc9f35f86e7
Reviewed-on: https://dart-review.googlesource.com/58240
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
This commit is contained in:
asiva 2018-06-18 22:31:32 +00:00 committed by commit-bot@chromium.org
parent cdd2553a12
commit bc7220a4fd
66 changed files with 210 additions and 305 deletions

View file

@ -13,7 +13,7 @@ group("default") {
testonly = true
}
deps = [
":runtime_kernel",
":runtime",
]
}
@ -34,6 +34,11 @@ group("most") {
}
group("runtime") {
import("runtime/runtime_args.gni")
target_supports_aot = dart_target_arch == "arm" ||
dart_target_arch == "arm64" || dart_target_arch == "x64"
if (targetting_fuchsia) {
# Fuchsia has run_vm_tests marked testonly.
testonly = true
@ -45,21 +50,6 @@ group("runtime") {
"runtime/bin:run_vm_tests",
"runtime/bin:sample_extension",
"runtime/bin:test_extension",
]
}
group("runtime_kernel") {
import("runtime/runtime_args.gni")
target_supports_aot = dart_target_arch == "arm" ||
dart_target_arch == "arm64" || dart_target_arch == "x64"
if (targetting_fuchsia) {
# Fuchsia has run_vm_tests marked testonly.
testonly = true
}
deps = [
":runtime",
"runtime/vm:kernel_platform_files($host_toolchain)",
# TODO(rmacnak): Link this into 'dart'.
@ -72,6 +62,12 @@ group("runtime_kernel") {
}
}
group("runtime_kernel") {
deps = [
":runtime",
]
}
group("runtime_precompiled") {
deps = [
"runtime/bin:dart_bootstrap($host_toolchain)",

View file

@ -48,6 +48,7 @@ Future runCompiler(Uri compiler, Uri input, Uri output) async {
Uri dartVm = Uri.base.resolveUri(new Uri.file(Platform.resolvedExecutable));
StdioProcess result = await StdioProcess.run(dartVm.toFilePath(), <String>[
"-c",
"--no_preview_dart_2",
compiler.toFilePath(),
"--compile-sdk=sdk/",
"--output=${output.toFilePath()}",

View file

@ -56,6 +56,7 @@ Future runCompiler(Uri input, Uri output) async {
final List<String> arguments = <String>[
'--packages=${packagesFile.toFilePath()}',
'--no_preview_dart_2',
'-c',
compiler.toFilePath(),
'--platform=${platformDill.toFilePath()}',
@ -91,7 +92,7 @@ Future dumpDillFile(Uri dillFile, Uri txtFile) async {
}
Future runHelloWorld(Uri dillFile) async {
final List<String> arguments = <String>['-c', dillFile.toFilePath()];
final List<String> arguments = <String>[dillFile.toFilePath()];
await run('Running hello.dart', arguments, 'hello world!\n');
}

View file

@ -80,6 +80,24 @@
"exclude": [
"/testcases/.*_part[0-9]*\\.dart$",
"/testcases/.*_lib[0-9]*\\.dart$",
"/testcases/bug33099",
"/testcases/covariant_generic",
"/testcases/inference/bug32291",
"/testcases/inference/downward_inference_miscellaneous",
"/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound",
"/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method",
"/testcases/inference/generic_methods_nested_generic_instantiation",
"/testcases/inference/infer_list_literal_nested_in_map_literal",
"/testcases/inference/infer_return_of_statement_lambda",
"/testcases/inference/override_equals",
"/testcases/inference/unsafe_block_closure_inference_in_map_typed",
"/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param",
"/testcases/rasta/issue_000002",
"/testcases/regress/issue_31766",
"/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast",
"/testcases/runtime_checks_new/mixin_forwarding_stub_field",
"/testcases/runtime_checks_new/mixin_forwarding_stub_setter",
"/testcases/runtime_checks_new/stub_checked_via_target",
"/testcases/dartino/",
"/testcases/shaker/",
"/testcases/expression/"

View file

@ -22,6 +22,7 @@ main(List<String> arguments) {
Uri platformDill = tmp.resolve("vm_platform.dill");
Uri outlineDill = tmp.resolve("vm_outline_strong.dill");
ProcessResult result = await Process.run(dartVm.toFilePath(), <String>[
"--no_preview_dart_2",
compilePlatform.toFilePath(),
"-v",
"dart:core",

View file

@ -22,6 +22,7 @@ main(List<String> arguments) {
Uri platformDill = tmp.resolve("vm_platform.dill");
Uri outlineDill = tmp.resolve("vm_outline_strong.dill");
ProcessResult result = await Process.run(dartVm.toFilePath(), <String>[
"--no_preview_dart_2",
compilePlatform.toFilePath(),
"-v",
"--strong",

View file

@ -68,4 +68,4 @@ esac
shift
exec "${DART_VM}" -c "${SCRIPT}" "$@"
exec "${DART_VM}" --no_preview_dart_2 -c "${SCRIPT}" "$@"

View file

@ -222,6 +222,7 @@ analyzer/tool/task_dependency_graph/check_test: Slow, Pass
front_end/tool/perf_test: Slow, Pass
[ $runtime == vm && $checked ]
analysis_server/test/benchmarks_test: Pass, Slow
analysis_server/test/completion_test: Pass, Slow
analysis_server/test/integration/edit/sort_members_test: Pass, Slow
analysis_server/test/services/correction/fix_test: Pass, Slow

View file

@ -1,46 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2017, 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.
# Script for running JIT mode VM with Dart 2 pipeline: using Fasta in DFE
# isolate and strong mode semantics.
function follow_links() {
file="$1"
while [ -h "$file" ]; do
# On Mac OS, readlink -f doesn't work.
file="$(readlink "$file")"
done
echo "$file"
}
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
PROG_NAME="$(follow_links "$BASH_SOURCE")"
# Handle the case where dart-sdk/bin has been symlinked to.
CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
if [[ `uname` == 'Darwin' ]]; then
OUT_DIR="$CUR_DIR"/../../../xcodebuild/
else
OUT_DIR="$CUR_DIR"/../../../out/
fi
export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
export DART_USE_SDK=${DART_USE_SDK:0}
BUILD_DIR="$OUT_DIR$DART_CONFIGURATION"
if [[ $DART_USE_SDK -eq 1 ]]; then
DART_BINARY="$BUILD_DIR"/dart-sdk/bin/dart
KERNEL_BINARIES_DIR="$BUILD_DIR"/dart-sdk/lib/_internal
else
DART_BINARY="$BUILD_DIR"/dart
KERNEL_BINARIES_DIR="$BUILD_DIR"
fi
exec "$DART_BINARY" \
--preview_dart_2 \
--strong \
--reify-generic-functions \
"$@"

View file

@ -1,38 +0,0 @@
@echo off
REM Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.
REM Script for running JIT mode VM with Dart 2 pipeline: using Fasta in DFE
REM isolate and strong mode semantics.
set SCRIPTPATH=%~dp0
REM Does the path have a trailing slash? If so, remove it.
if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%
set OUT_DIR=%SCRIPTPATH%/../../../out/
REM Remove trailing spaces if line is not empty
if not "%DART_CONFIGURATION%" == "" (
set DART_CONFIGURATION=%DART_CONFIGURATION: =%
)
if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseX64
if "%DART_USE_SDK%"=="" set DART_USE_SDK=0
set BUILD_DIR=%OUT_DIR%%DART_CONFIGURATION%
if not "_%DART_VM_OPTIONS%_" == "__" (
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
)
if "%DART_USE_SDK%"=="1" (
set DART_BINARY=%BUILD_DIR%/dart-sdk/bin/dart
set KERNEL_BINARIES_DIR=%BUILD_DIR%/dart-sdk/lib/_internal
) else (
set DART_BINARY=%BUILD_DIR%/dart
set KERNEL_BINARIES_DIR=%BUILD_DIR%
)
set KERNEL_SERVICE_SNAPSHOT=%BUILD_DIR%/gen/kernel-service.dart.snapshot
"%DART_BINARY%" --preview_dart_2 --strong --reify-generic-functions %*

View file

@ -503,6 +503,7 @@ static Dart_Isolate CreateAndSetupKernelIsolate(const char* script_uri,
}
if (isolate == NULL) {
Log::PrintErr("%s\n", *error);
delete isolate_data;
return NULL;
}
@ -1302,7 +1303,7 @@ void main(int argc, char** argv) {
application_kernel_buffer_size);
// Since we saw a dill file, it means we have to turn on all the
// preview_dart_2 options.
Options::SetPreviewDart2Options(&vm_options);
Options::SetDart2Options(&vm_options);
}
#endif

View file

@ -63,19 +63,17 @@ ENUM_OPTIONS_LIST(ENUM_OPTION_DEFINITION)
CB_OPTIONS_LIST(CB_OPTION_DEFINITION)
#undef CB_OPTION_DEFINITION
void Options::SetPreviewDart2Options(CommandLineOptions* vm_options) {
#if !defined(DART_PRECOMPILED_RUNTIME)
Options::dfe()->set_use_dfe();
#endif // !defined(DART_PRECOMPILED_RUNTIME)
OPTION_FIELD(preview_dart_2) = true;
void Options::SetDart2Options(CommandLineOptions* vm_options) {
vm_options->AddArgument("--strong");
vm_options->AddArgument("--reify-generic-functions");
vm_options->AddArgument("--sync-async");
}
bool OPTION_FIELD(preview_dart_2) = false;
DEFINE_BOOL_OPTION_CB(preview_dart_2,
{ Options::SetPreviewDart2Options(vm_options); });
void Options::SetDart1Options(CommandLineOptions* vm_options) {
vm_options->AddArgument("--no-strong");
vm_options->AddArgument("--no-reify-generic-functions");
vm_options->AddArgument("--no-sync-async");
}
#if !defined(DART_PRECOMPILED_RUNTIME)
DFE* Options::dfe_ = NULL;
@ -338,6 +336,9 @@ int Options::ParseArguments(int argc,
const char* kPrefix = "--";
const intptr_t kPrefixLen = strlen(kPrefix);
// Set Dart 2 as the default option.
Options::SetDart2Options(vm_options);
// Store the executable name.
Platform::SetExecutableName(argv[0]);
@ -381,6 +382,13 @@ int Options::ParseArguments(int argc,
}
}
if (Options::no_preview_dart_2()) {
Options::SetDart1Options(vm_options);
} else {
#if !defined(DART_PRECOMPILED_RUNTIME)
Options::dfe()->set_use_dfe();
#endif // !defined(DART_PRECOMPILED_RUNTIME)
}
if (Options::deterministic()) {
// Both an embedder and VM flag.
vm_options->AddArgument("--deterministic");

View file

@ -42,7 +42,8 @@ namespace bin {
V(trace_loading, trace_loading) \
V(short_socket_read, short_socket_read) \
V(short_socket_write, short_socket_write) \
V(disable_exit, exit_disabled)
V(disable_exit, exit_disabled) \
V(no_preview_dart_2, no_preview_dart_2)
// Boolean flags that have a short form.
#define SHORT_BOOL_OPTIONS_LIST(V) \
@ -107,8 +108,9 @@ class Options {
CB_OPTIONS_LIST(CB_OPTIONS_DECL)
#undef CB_OPTIONS_DECL
static bool preview_dart_2() { return preview_dart_2_; }
static void SetPreviewDart2Options(CommandLineOptions* vm_options);
static bool preview_dart_2() { return !no_preview_dart_2(); }
static void SetDart2Options(CommandLineOptions* vm_options);
static void SetDart1Options(CommandLineOptions* vm_options);
static dart::HashMap* environment() { return environment_; }
@ -143,7 +145,6 @@ class Options {
ENUM_OPTIONS_LIST(ENUM_OPTION_DECL)
#undef ENUM_OPTION_DECL
static bool preview_dart_2_;
static dart::HashMap* environment_;
// Frontend argument processing.
@ -175,8 +176,6 @@ class Options {
ENUM_OPTIONS_LIST(ENUM_OPTION_FRIEND)
#undef ENUM_OPTION_FRIEND
friend class OptionProcessor_preview_dart_2;
DISALLOW_ALLOCATION();
DISALLOW_IMPLICIT_CONSTRUCTORS(Options);
};

View file

@ -72,6 +72,12 @@ pause_on_unhandled_async_exceptions_test: Pass, RuntimeError # Issue 33365
[ $compiler == dart2analyzer && $strong ]
*: Skip # Issue 28649
[ $compiler == none && $runtime == vm ]
coverage_leaf_function_test: RuntimeError
coverage_optimized_function_test: RuntimeError
get_object_rpc_test: RuntimeError # Spawned process runs in Dart2 mode
get_source_report_test: RuntimeError # Spawned process runs in Dart2 mode
[ $compiler == none && $runtime == vm && $system == fuchsia ]
*: Skip # Not yet triaged.
@ -85,12 +91,8 @@ async_scope_test: Pass, Slow
*: Skip
[ ($compiler == none || $compiler == precompiler) && ($runtime == dart_precompiled || $runtime == vm) ]
async_step_out_test: RuntimeError # Issue 29158, Async debugging
awaiter_async_stack_contents_test: RuntimeError # Issue 29158, Async debugging
evaluate_activation_test/instance: RuntimeError # http://dartbug.com/20047
evaluate_activation_test/scope: RuntimeError # http://dartbug.com/20047
regress_28980_test: RuntimeError # Issue 29158, Async debugging
set_library_debuggable_test: RuntimeError # Issue 29158, Async debugging
[ $arch != ia32 || $arch != x64 || $system != linux ]
get_native_allocation_samples_test: Skip # Unsupported.

View file

@ -233,8 +233,6 @@ async_generator_breakpoint_test: Pass, RuntimeError, Crash # dartbug.com/33175 f
bad_reload_test: Skip # Times out on sim architectures, also RuntimeError.
break_on_activation_test: RuntimeError # Issue #33087
complex_reload_test: Skip # Times out on sim architectures, also RuntimeError.
coverage_leaf_function_test: RuntimeError # Please triage.
coverage_optimized_function_test: RuntimeError # Please triage.
debugger_inspect_test: RuntimeError, Timeout # Issue #33087
developer_service_get_isolate_id_test: RuntimeError # Issue #33087
eval_internal_class_test: RuntimeError # Issue #33087
@ -251,7 +249,6 @@ evaluate_with_scope_test: RuntimeError # Issue #33087
get_instances_rpc_test: RuntimeError # Issue #33087
get_object_rpc_test: RuntimeError # Please triage.
get_retaining_path_rpc_test: RuntimeError # Issue #33087
get_source_report_test: RuntimeError # Please triage.
get_user_level_retaining_path_rpc_test: RuntimeError # Issue #33087
instance_field_order_rpc_test: RuntimeError # Issue #33087
pause_on_exceptions_test: RuntimeError, Timeout # Issue #33087

View file

@ -553,10 +553,9 @@ List<String> removeAdjacentDuplicates(List<String> fromList) {
bool isKernel() {
for (String argument in Platform.executableArguments) {
if (argument.startsWith("--preview_dart_2") || argument.startsWith("--dfe"))
return true;
if (argument.startsWith("--no-preview_dart_2")) return false;
}
return false;
return true;
}
E ifKernel<E>(E then, E otherwise) {

View file

@ -6,8 +6,10 @@ import "dart:io";
import "package:expect/expect.dart";
main() {
var result = Process.runSync(Platform.executable,
[Platform.script.resolve('./bad_snapshot').toFilePath()]);
var result = Process.runSync(Platform.executable, [
'--no-preview-dart-2',
Platform.script.resolve('./bad_snapshot').toFilePath()
]);
print("=== stdout ===\n ${result.stdout}");
print("=== stderr ===\n ${result.stderr}");
Expect.equals(253, result.exitCode);

View file

@ -159,7 +159,7 @@ constexpr bool kDartPrecompiledRuntime = false;
C(stress_async_stacks, false, false, bool, false, \
"Stress test async stack traces") \
P(strong, bool, false, "Enable strong mode.") \
P(sync_async, bool, true, "Start `async` functions synchronously.") \
P(sync_async, bool, false, "Start `async` functions synchronously.") \
R(support_ast_printer, false, bool, true, "Support the AST printer.") \
R(support_compiler_stats, false, bool, true, "Support compiler stats.") \
R(support_disassembler, false, bool, true, "Support the disassembler.") \

View file

@ -89,7 +89,7 @@ class RunKernelTask : public ThreadPool::Task {
api_flags.enable_error_on_bad_override = false;
api_flags.reify_generic_functions = false;
api_flags.strong = false;
api_flags.sync_async = true;
api_flags.sync_async = false;
#if !defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC)
api_flags.use_field_guards = true;
#endif

View file

@ -73,11 +73,16 @@ Future testNativeExtensions(String snapshotKind) async {
snapshot = script;
} else {
snapshot = join(testDirectory, "$test.snapshot");
await run(Platform.executable,
['--snapshot=$snapshot', '--snapshot-kind=$snapshotKind', script]);
List<String> args = new List<String>.from(Platform.executableArguments);
args.add('--snapshot=$snapshot');
args.add('--snapshot-kind=$snapshotKind');
args.add(script);
await run(Platform.executable, args);
}
await run(Platform.executable, [snapshot]);
List<String> args = new List<String>.from(Platform.executableArguments);
args.add(snapshot);
await run(Platform.executable, args);
}
} finally {
await tempDirectory.deleteSync(recursive: true);

View file

@ -8,11 +8,6 @@ sample_extension/test/*: Skip # Issue 14705
[ $compiler == dart2analyzer ]
build_dart: Skip
[ $compiler == dartkp ]
sample_extension/test/sample_extension_app_snapshot_test: RuntimeError
sample_extension/test/sample_extension_script_snapshot_test: RuntimeError
sample_extension/test/sample_extension_test: RuntimeError
[ $compiler == precompiler ]
sample_extension/test/*: Skip # These tests attempt to spawn another script using the precompiled runtime.
@ -28,6 +23,11 @@ sample_extension/test/sample_extension_app_snapshot_test: Pass, RuntimeError # I
[ $compiler == none && $runtime == vm && $system == fuchsia ]
*: Skip # Not yet triaged.
[ $compiler == dartk || $compiler == dartkp ]
sample_extension/test/sample_extension_app_snapshot_test: RuntimeError
sample_extension/test/sample_extension_script_snapshot_test: RuntimeError
sample_extension/test/sample_extension_test: RuntimeError
# Skip tests that use dart:io
[ $runtime == d8 || $browser ]
build_dart/*: Skip

View file

@ -41,7 +41,6 @@ case $0 in
EXTRA_VM_OPTIONS+=('--enable-asserts')
;;
esac
EXTRA_VM_OPTIONS+=('--preview-dart-2')
# We allow extra vm options to be passed in through an environment variable.
if [[ $DART_VM_OPTIONS ]]; then

View file

@ -20,7 +20,7 @@ IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
set DART=%BIN_DIR%\dart
set EXTRA_OPTIONS=
set EXTRA_VM_OPTIONS=--preview-dart-2
set EXTRA_VM_OPTIONS=
if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --enable-asserts

View file

@ -48,7 +48,6 @@ case $0 in
EXTRA_VM_OPTIONS+=('--enable-asserts')
;;
esac
EXTRA_VM_OPTIONS+=('--preview-dart-2')
# We allow extra vm options to be passed in through an environment variable.
if [[ $DART_VM_OPTIONS ]]; then

View file

@ -21,7 +21,7 @@ set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\dart2js.dart.snapshot
set EXTRA_OPTIONS=
set EXTRA_VM_OPTIONS=--preview-dart-2
set EXTRA_VM_OPTIONS=
if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --enable-asserts

View file

@ -47,4 +47,4 @@ ANALYZER="$DART_ROOT/pkg/analyzer_cli/bin/analyzer.dart"
DEV_OPTIONS="--use-analysis-driver-memory-byte-store"
exec "$DART" "--preview-dart-2" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$ANALYZER" "$DEV_OPTIONS" "$SDK_ARG" "$@"
exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$ANALYZER" "$DEV_OPTIONS" "$SDK_ARG" "$@"

View file

@ -40,7 +40,7 @@ if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
set ANALYZER=%DART_ROOT%\pkg\analyzer_cli\bin\analyzer.dart
"%DART%" "--preview-dart-2" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "%ANALYZER%" "%SDK_ARG%" %*
"%DART%" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "%ANALYZER%" "%SDK_ARG%" %*
endlocal

View file

@ -28,4 +28,4 @@ SNAPSHOT="$BIN_DIR/snapshots/dartanalyzer.dart.snapshot"
# We are running the snapshot in the built SDK.
DART="$BIN_DIR/dart"
exec "$DART" "--preview-dart-2" "$SNAPSHOT" "$SDK_ARG" "$@"
exec "$DART" "$SNAPSHOT" "$SDK_ARG" "$@"

View file

@ -22,7 +22,7 @@ if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
set SDK_ARG=--dart-sdk=%SDK_DIR%
"%DART%" "--preview-dart-2" "%SNAPSHOT%" "%SDK_ARG%" %*
"%DART%" "%SNAPSHOT%" "%SDK_ARG%" %*
endlocal

View file

@ -45,4 +45,4 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
DEV_COMPILER="$DART_ROOT/pkg/dev_compiler/bin/dartdevc.dart"
exec "$DART" "--preview-dart-2" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DEV_COMPILER" "$SDK_ARG" "$@"
exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DEV_COMPILER" "$SDK_ARG" "$@"

View file

@ -36,7 +36,7 @@ if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
set DEV_COMPILER=%DART_ROOT%\third_party\pkg\dev_compiler\bin\dartdevc.dart
"%DART%" "--preview-dart-2" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "DEV_COMPILER%" "%SDK_ARG%" %*
"%DART%" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "DEV_COMPILER%" "%SDK_ARG%" %*
endlocal

View file

@ -28,4 +28,4 @@ SNAPSHOT="$BIN_DIR/snapshots/dartdevc.dart.snapshot"
# We are running the snapshot in the built SDK.
DART="$BIN_DIR/dart"
exec "$DART" "--preview-dart-2" "$SNAPSHOT" "$SDK_ARG" "$@"
exec "$DART" "$SNAPSHOT" "$SDK_ARG" "$@"

View file

@ -22,7 +22,7 @@ if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
set SDK_ARG=--dart-sdk=%SDK_DIR%
"%DART%" "--preview-dart-2" "%SNAPSHOT%" "%SDK_ARG%" %*
"%DART%" "%SNAPSHOT%" "%SDK_ARG%" %*
endlocal

View file

@ -43,4 +43,4 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
DEV_COMPILER="$DART_ROOT/pkg/dev_compiler/bin/dartdevk.dart"
exec "$DART" "--preview-dart-2" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DEV_COMPILER" "$@"
exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DEV_COMPILER" "$@"

View file

@ -34,7 +34,7 @@ if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
set DEV_COMPILER=%DART_ROOT%\pkg\dev_compiler\bin\dartdevk.dart
"%DART%" "--preview-dart-2" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "%DEV_COMPILER%" %*
"%DART%" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "%DEV_COMPILER%" %*
endlocal

View file

@ -26,4 +26,4 @@ SNAPSHOT="$BIN_DIR/snapshots/dartdevk.dart.snapshot"
# We are running the snapshot in the built SDK.
DART="$BIN_DIR/dart"
exec "$DART" "--preview-dart-2" "$SNAPSHOT" "--packages=$SDK_DIR/../../../.packages" "$@"
exec "$DART" "$SNAPSHOT" "--packages=$SDK_DIR/../../../.packages" "$@"

View file

@ -20,7 +20,7 @@ for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
rem Remove trailing backslash if there is one
if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
"%DART%" "--preview-dart-2" "%SNAPSHOT%" "--packages=%SDK_DIR%\..\..\..\.packages" %*
"%DART%" "%SNAPSHOT%" "--packages=%SDK_DIR%\..\..\..\.packages" %*
endlocal

View file

@ -26,4 +26,4 @@ SNAPSHOT="$BIN_DIR/snapshots/dartdoc.dart.snapshot"
# We are running the snapshot in the built SDK.
DART="$BIN_DIR/dart"
exec "$DART" "--preview-dart-2" --packages="$BIN_DIR/snapshots/resources/dartdoc/.packages" "$SNAPSHOT" "$@"
exec "$DART" "--packages=$BIN_DIR/snapshots/resources/dartdoc/.packages" "$SNAPSHOT" "$@"

View file

@ -14,7 +14,7 @@ for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\dartdoc.dart.snapshot
"%DART%" "--preview-dart-2" --packages="%BIN_DIR%/snapshots/resources/dartdoc/.packages" "%SNAPSHOT%" %*
"%DART%" "--packages=%BIN_DIR%/snapshots/resources/dartdoc/.packages" "%SNAPSHOT%" %*
endlocal

View file

@ -28,4 +28,4 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
DARTFMT="$DART_ROOT/third_party/pkg_tested/dart_style/bin/format.dart"
exec "$DART" "--preview-dart-2" "--packages=$DART_ROOT/.packages" "$DARTFMT" "$@"
exec "$DART" "--packages=$DART_ROOT/.packages" "$DARTFMT" "$@"

View file

@ -27,7 +27,7 @@ if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
set DARTFMT=%DART_ROOT%\third_party\pkg_tested\dart_style\bin\format.dart
"%DART%" "--preview-dart-2" "--packages=%DART_ROOT%\.packages" "%DARTFMT%" %*
"%DART%" "--packages=%DART_ROOT%\.packages" "%DARTFMT%" %*
endlocal

View file

@ -26,4 +26,4 @@ SNAPSHOT="$BIN_DIR/snapshots/dartfmt.dart.snapshot"
# We are running the snapshot in the built SDK.
DART="$BIN_DIR/dart"
exec "$DART" "--preview-dart-2" "$SNAPSHOT" "$@"
exec "$DART" "$SNAPSHOT" "$@"

View file

@ -14,7 +14,7 @@ for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\dartfmt.dart.snapshot
"%DART%" "--preview-dart-2" "%SNAPSHOT%" %*
"%DART%" "%SNAPSHOT%" %*
endlocal

View file

@ -41,10 +41,10 @@ fi
# Run the pub snapshot.
DART="$BIN_DIR/dart"
if array_contains "--preview-dart-2" "${VM_OPTIONS[@]}"; then
SNAPSHOT="$BIN_DIR/snapshots/pub2.dart.snapshot"
exec "$DART" "${VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
else
if array_contains "--no-preview-dart-2" "${VM_OPTIONS[@]}"; then
SNAPSHOT="$BIN_DIR/snapshots/pub.dart.snapshot"
exec "$DART" "${VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
else
SNAPSHOT="$BIN_DIR/snapshots/pub2.dart.snapshot"
exec "$DART" "${VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
fi

View file

@ -18,20 +18,20 @@ rem Remove trailing backslash if there is one
IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
set VM_OPTIONS=
set USING_DART_2=
set USING_DART_1=
rem We allow extra vm options to be passed in through an environment variable.
if not "_%DART_VM_OPTIONS%_" == "__" (
set VM_OPTIONS=%VM_OPTIONS% %DART_VM_OPTIONS%
for %%o in (%DART_VM_OPTIONS%) do (
if "%%o" equ "--preview-dart-2" set USING_DART_2=y
if "%%o" equ "--no-preview-dart-2" set USING_DART_1=y
)
)
if defined USING_DART_2 (
"%BIN_DIR%\dart" %VM_OPTIONS% "%BIN_DIR%\snapshots\pub2.dart.snapshot" %*
) else (
if defined USING_DART_1 (
"%BIN_DIR%\dart" %VM_OPTIONS% "%BIN_DIR%\snapshots\pub.dart.snapshot" %*
) else (
"%BIN_DIR%\dart" %VM_OPTIONS% "%BIN_DIR%\snapshots\pub2.dart.snapshot" %*
)
endlocal

View file

@ -241,9 +241,6 @@ LibTest/collection/ListMixin/ListMixin_class_A01_t01: Skip # Timeout
LibTest/collection/ListMixin/ListMixin_class_A01_t02: Skip # Timeout
LibTest/core/Uri/Uri_A06_t03: Skip # Timeout
[ $compiler == app_jit || $compiler == none || $compiler == precompiler ]
Language/Expressions/Function_Invocation/async_invokation_t02: RuntimeError # sync-async is on by default.
[ $compiler == app_jit || $compiler == precompiler ]
Language/Mixins/Mixin_Application/error_t01: Pass
Language/Mixins/Mixin_Application/error_t02: Pass

View file

@ -95,6 +95,7 @@ symbol_test/03: MissingCompileTimeError
[ !$strong ]
cast_test: SkipByDesign # Uses generic method parameters.
regress_33166_test: SkipByDesign # Not a Dart 1 test
[ $arch == simarmv5te && ($runtime == dart_precompiled || $runtime == vm) ]
int_parse_radix_test/*: Pass, Slow

View file

@ -475,10 +475,6 @@ vm/causal_async_exception_stack_test: SkipByDesign # Causal async stacks are not
[ $runtime == dart_precompiled || $runtime == vm ]
arithmetic_test: CompileTimeError # Large integer literal
async_await_test: RuntimeError # sync-async is on by default
asyncstar_throw_in_catch_test: RuntimeError # sync-async is on by default
await_nonfuture_test: RuntimeError # sync-async is on by default
await_not_started_immediately_test: RuntimeError # sync-async is on by default
bit_operations_test: CompileTimeError # Large integer literal
deopt_inlined_function_lazy_test: CompileTimeError # Large integer literal
guess_cid_test: CompileTimeError # Large integer literal

View file

@ -367,7 +367,6 @@ convert/chunked_conversion_utf88_test: Skip # Pass, Slow Issue 12644.
convert/utf85_test: Skip # Pass, Slow Issue 12644.
[ $compiler == app_jit || $compiler == none || $compiler == precompiler ]
async/async_await_sync_completer_test: RuntimeError # sync-async is on by default.
async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8)
async/timer_regress22626_test: Pass, RuntimeError # Issue 28254
mirrors/mirrors_used*: SkipByDesign # Invalid tests. MirrorsUsed does not have a specification, and dart:mirrors is not required to hide declarations that are not covered by any MirrorsUsed annotation.

View file

@ -23,6 +23,9 @@ verbose_gc_to_bmu_test: SkipByDesign # No verbose_gc in product mode
[ $runtime == dart_precompiled ]
verbose_gc_to_bmu_test: Skip # These tests attempt to spawn another script using the precompiled runtime.
[ $runtime == vm ]
verbose_gc_to_bmu_test: Skip # spawns a process which runs in Dart2 mode.
[ $system == windows ]
io/sleep_test: Pass, Fail # Issue 25757
verbose_gc_to_bmu_test: Skip

View file

@ -12,7 +12,7 @@ void main(List<String> args) {
// If an argument 'echo' is passed echo stdin to stdout and stderr.
if (args.length == 1 && args[0] == 'echo') {
stdin.fold([], (p, e) => p..addAll(e)).then((message) {
stdin.fold(<int>[], (p, e) => p..addAll(e)).then((message) {
stdout.add(message);
stderr.add(message);
stdout.close();

View file

@ -40,9 +40,10 @@ void main() {
var clientScript = localFile('secure_unauthorized_client.dart');
Future clientProcess(int port) {
return Process
.run(Platform.executable, [clientScript, port.toString()]).then(
(ProcessResult result) {
List<String> args = new List<String>.from(Platform.executableArguments);
args.add(clientScript);
args.add(port.toString());
return Process.run(Platform.executable, args).then((ProcessResult result) {
if (result.exitCode != 0 || !result.stdout.contains('SUCCESS')) {
print("Client failed");
print(" stdout:");

View file

@ -75,6 +75,12 @@ io/*: Skip # Issue 30618
[ $compiler != app_jitk && $compiler != dart2analyzer && $compiler != dartdevc && $compiler != dartk && $compiler != dartkp && $runtime != none && $strong ]
float_array_static_test: MissingCompileTimeError
# These tests spawn a process that imports using a http URL, since
# spawned processes now run in Dart2 mode the tests fail as http URL imports
# is not supported by the front end.
[ $compiler == none && $runtime == vm ]
http_launch_test: RuntimeError # Issue 33388
[ $compiler == none && $runtime == vm && $system == fuchsia ]
*: Skip # Not yet triaged.

View file

@ -73,8 +73,8 @@ io/socket_port_test: Pass, Crash
io/http_basic_test: Crash
io/web_socket_ping_test: Crash, Pass
# ===== dartk + vm status lines =====
[ $compiler == dartk && $runtime == vm && $strong ]
http_launch_test: RuntimeError # Issue 33388
io/http_client_request_test: Pass, Timeout
io/http_compression_test: RuntimeError
io/platform_resolved_executable_test/03: Pass, RuntimeError
@ -93,10 +93,6 @@ io/wait_for_event_isolate_test: Skip # Issues 32137 and 32138.
[ $compiler == dartk && $system == windows && $strong ]
io/compile_all_test: Pass, Fail # Possibly related to issue 32373
io/file_stream_test: RuntimeError # Issue 31904
io/platform_test: RuntimeError # Issue 31904
io/process_non_ascii_test: RuntimeError # Issue 31904
io/regress_7679_test: RuntimeError # Issue 31904
map_insert_remove_oom_test: Skip # Heap limit too low.
[ $compiler == dartk && $hot_reload ]

View file

@ -7,6 +7,7 @@ io/web_socket_test: Pass, RuntimeError # Issue 24674
map_insert_remove_oom_test: Skip # Heap limit too low. Increasing iteration count to make a higher limit a meaningful test makes it too slow for simarm[64] bots.
[ $runtime == dart_precompiled ]
app_snapshot_share_test: RuntimeError
http_launch_test: Skip
io/addlatexhash_test: Skip
io/dart_std_io_pipe_test: Skip
@ -46,7 +47,6 @@ io/stdio_implicit_close_test: Skip
io/stdio_nonblocking_test: Skip
io/test_extension_fail_test: Skip
io/test_extension_test: Skip
io/test_runner_test: RuntimeError # Issue 33168
io/windows_environment_test: Skip
[ $arch == arm && $mode == release && $runtime == dart_precompiled && $system == android ]

View file

@ -14,6 +14,10 @@ pub/test/dart2js/compiles_generated_file_from_dependency_test: Pass, Slow
pub/test/serve/web_socket/url_to_asset_id_test: Pass, Slow
pub/test/transformer/loads_a_diamond_transformer_dependency_graph_test: Pass, Slow
[ $runtime == vm ]
dart_style/test/command_line_test: Skip # Issue 33473
http_io/test/http_client_stays_alive_test: Skip # Issue 33472
[ $browser ]
dart_style/*: SkipByDesign
pub/*: SkipByDesign

View file

@ -237,7 +237,7 @@ isParagraphCommand(line) => line.contains(paragraphRE);
/// Returns true iff [line] does not end a block of lines that gets
/// a hash value.
isntHashBlockTerminator(line) => !isSectioningCommand(line);
bool isntHashBlockTerminator(line) => !isSectioningCommand(line);
/// Returns the label text part from [line], based on the assumption
/// that isHashLabel(line) returns true.

View file

@ -523,7 +523,6 @@
"name": "ddc sourcemap tests",
"script": "out/ReleaseX64/dart",
"arguments": [
"--preview-dart-2",
"pkg/dev_compiler/test/sourcemap/sourcemaps_ddc_suite.dart",
"-rnone"
]
@ -532,7 +531,6 @@
"name": "ddk sourcemap tests",
"script": "out/ReleaseX64/dart",
"arguments": [
"--preview-dart-2",
"pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart",
"-rnone"
]
@ -541,7 +539,6 @@
"name": "ddc sourcemap stacktrace tests",
"script": "out/ReleaseX64/dart",
"arguments": [
"--preview-dart-2",
"pkg/dev_compiler/test/sourcemap/stacktrace_ddc_suite.dart",
"-rnone"
]
@ -550,7 +547,6 @@
"name": "ddk sourcemap stacktrace tests",
"script": "out/ReleaseX64/dart",
"arguments": [
"--preview-dart-2",
"pkg/dev_compiler/test/sourcemap/stacktrace_ddk_suite.dart",
"-rnone"
]
@ -598,7 +594,6 @@
"name": "ddc sourcemap tests",
"script": "xcodebuild/ReleaseX64/dart",
"arguments": [
"--preview-dart-2",
"pkg/dev_compiler/test/sourcemap/sourcemaps_ddc_suite.dart",
"-rnone"
]
@ -607,7 +602,6 @@
"name": "ddk sourcemap tests",
"script": "xcodebuild/ReleaseX64/dart",
"arguments": [
"--preview-dart-2",
"pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart",
"-rnone"
]
@ -616,7 +610,6 @@
"name": "ddc sourcemap stacktrace tests",
"script": "xcodebuild/ReleaseX64/dart",
"arguments": [
"--preview-dart-2",
"pkg/dev_compiler/test/sourcemap/stacktrace_ddc_suite.dart",
"-rnone"
]
@ -625,7 +618,6 @@
"name": "ddk sourcemap stacktrace tests",
"script": "xcodebuild/ReleaseX64/dart",
"arguments": [
"--preview-dart-2",
"pkg/dev_compiler/test/sourcemap/stacktrace_ddk_suite.dart",
"-rnone"
]

View file

@ -41,11 +41,7 @@ abstract class CompilerConfiguration {
bool get _useSdk => _configuration.useSdk;
bool get _useEnableAsserts => _configuration.useEnableAsserts;
/// Only some subclasses support this check, but we statically allow calling
/// it on [CompilerConfiguration].
bool get useDfe {
throw new UnsupportedError("This compiler does not support DFE.");
}
bool get previewDart2 => !_configuration.noPreviewDart2;
/// Whether to run the runtime on the compilation result of a test which
/// expects a compile-time error and the compiler did not emit one.
@ -66,13 +62,15 @@ abstract class CompilerConfiguration {
return new DevKernelCompilerConfiguration(configuration);
case Compiler.appJit:
return new AppJitCompilerConfiguration(configuration);
return new AppJitCompilerConfiguration(configuration,
previewDart2: false);
case Compiler.appJitk:
return new AppJitCompilerConfiguration(configuration, useDfe: true);
return new AppJitCompilerConfiguration(configuration);
case Compiler.precompiler:
return new PrecompilerCompilerConfiguration(configuration);
return new PrecompilerCompilerConfiguration(configuration,
previewDart2: false);
case Compiler.dartk:
if (configuration.architecture == Architecture.simdbc64 ||
@ -80,11 +78,10 @@ abstract class CompilerConfiguration {
configuration.architecture == Architecture.simarm64) {
return new VMKernelCompilerConfiguration(configuration);
}
return new NoneCompilerConfiguration(configuration, useDfe: true);
return new NoneCompilerConfiguration(configuration);
case Compiler.dartkp:
return new PrecompilerCompilerConfiguration(configuration,
useDfe: true);
return new PrecompilerCompilerConfiguration(configuration);
case Compiler.specParser:
return new SpecParserCompilerConfiguration(configuration);
@ -156,11 +153,7 @@ abstract class CompilerConfiguration {
/// The "none" compiler.
class NoneCompilerConfiguration extends CompilerConfiguration {
// This boolean is used by the [VMTestSuite] for running cc tests via
// run_vm_tests.
final bool useDfe;
NoneCompilerConfiguration(Configuration configuration, {this.useDfe: false})
NoneCompilerConfiguration(Configuration configuration)
: super._subclass(configuration);
bool get hasCompiler => false;
@ -173,29 +166,22 @@ class NoneCompilerConfiguration extends CompilerConfiguration {
List<String> originalArguments,
CommandArtifact artifact) {
var args = <String>[];
if (useDfe) {
// DFE+strong configuration is a Dart 2.0 configuration which uses
// pkg/vm/tool/dart2 wrapper script, which takes care of passing
// correct arguments to VM binary. No need to pass any additional
// arguments.
if (!_isStrong) {
args.add('--preview_dart_2');
}
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 (_isStrong) {
args.add('--strong');
if (_isChecked) {
args.add('--enable_asserts');
args.add('--enable_type_checks');
}
}
if (_isChecked) {
args.add('--enable_asserts');
args.add('--enable_type_checks');
}
if (_useEnableAsserts) {
args.add('--enable_asserts');
}
@ -216,12 +202,6 @@ class VMKernelCompilerConfiguration extends CompilerConfiguration
VMKernelCompilerConfiguration(Configuration configuration)
: super._subclass(configuration);
// This boolean is used by the [VMTestSuite] for running cc tests via
// run_vm_tests. We enable it here, so the cc tests continue to use the
// kernel-isolate. All the remaining tests will use a separate compilation
// command (which this class represents).
bool get useDfe => true;
bool get _isAot => false;
// Issue(http://dartbug.com/29840): Currently fasta sometimes does not emit a
@ -255,11 +235,7 @@ class VMKernelCompilerConfiguration extends CompilerConfiguration
CommandArtifact artifact) {
var args = <String>[];
args.add('--preview-dart-2');
if (_isChecked) {
args.add('--enable_asserts');
args.add('--enable_type_checks');
}
if (_useEnableAsserts) {
if (_isChecked || _useEnableAsserts) {
args.add('--enable_asserts');
}
if (_configuration.hotReload) {
@ -664,9 +640,7 @@ class DevKernelCompilerConfiguration extends CompilerConfiguration {
class PrecompilerCompilerConfiguration extends CompilerConfiguration
with VMKernelCompilerMixin {
// This boolean is used by the [VMTestSuite] for running cc tests via
// run_vm_tests.
final bool useDfe;
final bool previewDart2;
bool get _isAndroid => _configuration.system == System.android;
bool get _isArm => _configuration.architecture == Architecture.arm;
@ -675,7 +649,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
bool get _isAot => true;
PrecompilerCompilerConfiguration(Configuration configuration,
{this.useDfe: false})
{this.previewDart2: true})
: super._subclass(configuration);
int get timeoutMultiplier {
@ -689,7 +663,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
List<String> arguments, Map<String, String> environmentOverrides) {
var commands = <Command>[];
if (useDfe) {
if (previewDart2) {
commands.add(computeCompileToKernelCommand(
tempDir, arguments, environmentOverrides));
}
@ -697,7 +671,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
commands.add(
computeDartBootstrapCommand(tempDir, arguments, environmentOverrides));
if (useDfe) {
if (previewDart2) {
commands.add(computeRemoveKernelFileCommand(
tempDir, arguments, environmentOverrides));
}
@ -770,7 +744,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
if (_isStrong) {
args.add('--strong');
}
if (useDfe) {
if (previewDart2) {
args.add('--preview-dart-2');
args.addAll(_replaceDartFiles(arguments, tempKernelFile(tempDir)));
} else {
@ -892,12 +866,19 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
List<String> originalArguments,
CommandArtifact artifact) {
var args = <String>[];
if (_isChecked) {
args.add('--enable_asserts');
args.add('--enable_type_checks');
}
if (useDfe) {
if (previewDart2) {
args.add('--preview-dart-2');
if (_isChecked) {
args.add('--enable_asserts');
}
} else {
if (_isChecked) {
args.add('--enable_asserts');
args.add('--enable_type_checks');
}
}
if (_useEnableAsserts) {
args.add('--enable_asserts');
}
var dir = artifact.filename;
if (runtimeConfiguration is DartPrecompiledAdbRuntimeConfiguration) {
@ -916,11 +897,10 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
}
class AppJitCompilerConfiguration extends CompilerConfiguration {
// This boolean is used by the [VMTestSuite] for running cc tests via
// run_vm_tests.
final bool useDfe;
final bool previewDart2;
AppJitCompilerConfiguration(Configuration configuration, {this.useDfe: false})
AppJitCompilerConfiguration(Configuration configuration,
{this.previewDart2: true})
: super._subclass(configuration);
int get timeoutMultiplier {
@ -944,7 +924,7 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
var exec = "${_configuration.buildDirectory}/dart";
var snapshot = "$tempDir/out.jitsnapshot";
var args = ["--snapshot=$snapshot", "--snapshot-kind=app-jit"];
if (useDfe) {
if (previewDart2) {
args.add("--preview-dart-2");
} else {
args.add("--no-preview-dart-2");
@ -977,14 +957,20 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
List<String> originalArguments,
CommandArtifact artifact) {
var args = <String>[];
if (_isChecked) {
args.add('--enable_asserts');
args.add('--enable_type_checks');
}
if (useDfe) {
if (previewDart2) {
args.add('--preview-dart-2');
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');
}
args
..addAll(vmOptions)
@ -1170,9 +1156,6 @@ class FastaCompilerConfiguration extends CompilerConfiguration {
this._platformDill, this._vmExecutable, Configuration configuration)
: super._subclass(configuration);
@override
bool get useDfe => true;
@override
bool get runRuntimeDespiteMissingCompileTimeError => true;

View file

@ -41,7 +41,6 @@ class Configuration {
this.listTests,
this.listStatusFiles,
this.noPreviewDart2,
this.previewDart2,
this.printTiming,
this.printReport,
this.reportInJson,
@ -116,7 +115,6 @@ class Configuration {
final bool listTests;
final bool listStatusFiles;
final bool noPreviewDart2;
final bool previewDart2;
final bool printTiming;
final bool printReport;
final bool reportInJson;
@ -197,13 +195,6 @@ class Configuration {
compiler == Compiler.dart2js && !useDart2JSOldFrontend;
}
/// Returns true if this configuration is considered Dart 2.0 configuration
/// by VM (which is identified by using common front-end and strong mode).
/// In this case instead of invoking VM binary directly we use
/// pkg/vm/tool/dart2 wrapper script, which takes care of passing
/// correct arguments to VM binary.
bool get usingDart2VMWrapper => isStrong && compiler == Compiler.dartk;
/// The base directory named for this configuration, like:
///
/// none_vm_release_x64
@ -478,7 +469,6 @@ class Configuration {
'fast_startup': useFastStartup,
'timeout': timeout,
'no_preview_dart_2': noPreviewDart2,
'preview_dart_2': previewDart2,
'dart2js_with_kernel': useDart2JSWithKernel,
'dart2js_old_frontend': useDart2JSOldFrontend,
'enable_asserts': useEnableAsserts,

View file

@ -33,10 +33,11 @@ final _variables = {
"minified": new _Variable.bool((c) => c.isMinified),
"mode": new _Variable((c) => c.mode.name, Mode.names),
"no_preview_dart_2": new _Variable.bool((c) => c.noPreviewDart2),
"preview_dart_2": new _Variable.bool((c) => c.previewDart2),
"preview_dart_2": new _Variable.bool((c) => !c.noPreviewDart2),
"runtime": new _Variable(_runtimeName, Runtime.names),
"spec_parser": new _Variable.bool((c) => c.compiler == Compiler.specParser),
"strong": new _Variable.bool((c) => c.isStrong),
"strong": new _Variable.bool(
(c) => c.isStrong || c.compilerConfiguration.previewDart2),
"system": new _Variable((c) => c.system.name, System.names),
"use_sdk": new _Variable.bool((c) => c.useSdk)
};

View file

@ -168,10 +168,10 @@ simdbc, simdbc64''',
new _Option.bool('enable_asserts',
'Pass the --enable-asserts flag to dart2js or to the vm.'),
new _Option.bool(
'no_preview_dart_2', 'Pass the --no-preview-dart-2 flag for Dart1 mode',
'preview_dart_2', 'Pass the --preview-dart-2 flag to analyzer',
hide: true),
new _Option.bool('preview_dart_2',
'Pass the --preview-dart-2 flag to analyzer, or pass --no-preview-dart-2 if false.',
new _Option.bool(
'no_preview_dart_2', 'Pass the --no-preview-dart-2 flag to analyzer',
hide: true),
// TODO(sigmund): replace dart2js_with_kernel with preview-dart-2.
new _Option.bool(
@ -465,6 +465,10 @@ compiler.''',
}
}
if (configuration['no_preview_dart_2'] && configuration['preview_dart_2']) {
_fail('"--no-preview-dart-2" and "--preview-dart-2" specified,');
}
return _createConfigurations(configuration);
}
@ -645,8 +649,7 @@ compiler.''',
isVerbose: data["verbose"] as bool,
listTests: data["list"] as bool,
listStatusFiles: data["list_status_files"] as bool,
noPreviewDart2: !(data["preview_dart_2"] as bool),
previewDart2: data["preview_dart_2"] as bool,
noPreviewDart2: data["no_preview_dart_2"] as bool,
printTiming: data["time"] as bool,
printReport: data["report"] as bool,
reportInJson: data["report_in_json"] as bool,

View file

@ -130,10 +130,6 @@ abstract class TestSuite {
_environmentOverrides = {
'DART_CONFIGURATION': configuration.configurationDirectory,
};
if (useSdk && configuration.usingDart2VMWrapper) {
_environmentOverrides['DART_USE_SDK'] = '1';
}
}
Map<String, String> get environmentOverrides => _environmentOverrides;
@ -168,14 +164,6 @@ abstract class TestSuite {
// Controlled by user with the option "--dart".
var dartExecutable = configuration.dartPath;
if (configuration.usingDart2VMWrapper) {
if (dartExecutable != null) {
throw 'Can not use --dart when testing Dart 2.0 configuration';
}
dartExecutable = 'pkg/vm/tool/dart2$executableScriptSuffix';
}
if (dartExecutable == null) {
dartExecutable = dartVmExecutableFileName;
}
@ -489,7 +477,7 @@ class VMTestSuite extends TestSuite {
void _addTest(ExpectationSet testExpectations, String testName) {
var args = configuration.standardOptions.toList();
if (configuration.compilerConfiguration.useDfe) {
if (configuration.compilerConfiguration.previewDart2) {
args.add('--use-dart-frontend');
// '--dfe' has to be the first argument for run_vm_test to pick it up.
args.insert(0, '--dfe=$buildDir/gen/kernel-service.dart.snapshot');
@ -859,14 +847,6 @@ class StandardTestSuite extends TestSuite {
allVmOptions = vmOptions.toList()..addAll(extraVmOptions);
}
// TODO(rnystrom): Hack. When running the 2.0 tests, always implicitly
// turn on reified generics in the VM.
// Note that VMOptions=--no-reify-generic-functions in test is ignored.
// Dart 2 VM wrapper (pkg/vm/tool/dart2) already passes correct arguments.
if (suiteName.endsWith("_2") && !configuration.usingDart2VMWrapper) {
allVmOptions = allVmOptions.toList()..add("--reify-generic-functions");
}
var commands =
makeCommands(info, vmOptionsVariant, allVmOptions, commonArguments);
var expectations = testExpectations.expectations(testName);
@ -1309,13 +1289,16 @@ class StandardTestSuite extends TestSuite {
if (configuration.compiler == Compiler.dart2analyzer) {
args.add('--format=machine');
args.add('--no-hints');
if (configuration.previewDart2) args.add("--preview-dart-2");
if (configuration.noPreviewDart2) args.add("--no-preview-dart-2");
if (filePath.filename.contains("dart2js") ||
filePath.directoryPath.segments().last.contains('html_common')) {
args.add("--use-dart2js-libraries");
}
if (configuration.noPreviewDart2) {
args.add("--no-preview-dart-2");
} else {
args.add("--preview-dart-2");
}
}
var isMultitest = optionsFromFile["isMultitest"] as bool;

View file

@ -5,6 +5,7 @@
import("../application_snapshot.gni")
application_snapshot("analysis_server") {
dart_version = 2
main_dart = "../../pkg/analysis_server/bin/server.dart"
training_args = [ "--help" ]
}

View file

@ -76,6 +76,7 @@ template("application_snapshot") {
if (defined(invoker.output)) {
output = invoker.output
}
# TODO(asiva), flip default once the VM is dart2 by default.
dart_version = 1
if (defined(invoker.dart_version)) {
dart_version = invoker.dart_version
@ -85,14 +86,15 @@ template("application_snapshot") {
dart_action(target_name) {
deps = extra_deps
if (dart_version == 2) {
if (dart_version == 1) {
snapshot_vm_args += [ "--no-preview-dart-2" ]
} else {
# HACK: When creating app-jit snapshots for Dart 2 apps, the standalone
# Dart VM binary requires the app-jit snapshot for the kernel service to
# be adjacent to it. This deps ensures that it is there, but a different
# approach will be needed when the kernel service itself switches to
# Dart 2 to avoid creating a circular dependence.
deps += [ "$_dart_root/utils/kernel-service:copy_kernel_service_snapshot"]
snapshot_vm_args += [ "--preview-dart-2" ]
}
depfile = "$output.d"

View file

@ -30,6 +30,7 @@ template("generate_entry_points_json_with_dart_bootstrap") {
output,
]
vm_args = [
"--no-preview-dart-2",
"--print-precompiler-entry-points=" + rebase_path(output),
"--snapshot=" + rebase_path("$target_gen_dir/dummy.snapshot"),
"--snapshot-kind=app-aot",