where --enable experiment is accepted
Adds --enable-experiment support for:
- dart compile aot-snapshot
- dart compile jit-snapshot
- dart compile js
- dart compile exe
- dart compile kernel
Also changes --enable-experiment from a top level CLI flag to a
per-command flag. --enable-experiment flags will now only be
interpreted by the VM if:
1) They are provided before a CLI command (e.g., dart
--enable-experiment=non-nullable analyze) or
2) They are provided with an explicit or implicit run command (e.g.,
dart --enable-experiment=non-nullable foo.dart or dart
--enable-experiment=non-nullable run foo.dart or dart run
--enable-experiment=non-nullable foo.dart)
This should make it more generally clear where --enable-experiment is
accepted and what subcommands can accept the flag. Prior to this change,
providing --enable-experiment anywhere, even for commands without
experiment support, would not raise an error.
Fixes https://github.com/dart-lang/sdk/issues/43623
Change-Id: I5ec48b2dd2bb6db5526185dae2edbca95ef24d9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169902
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
This allows `invalid_use_of_visible_for_testing_member` to work with `@visibleForTesting` annotations when such symbols are accessed from an `integration_test/` package directory.
Bug: https://github.com/dart-lang/sdk/issues/43921
Change-Id: I530b88459060dbb05eb18d2a6de2902c88c246af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169180
Auto-Submit: Jia Hao Goh <jiahaog@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Previously, when analyzing a call to an iterable method that could
potentially be transformed into an `OrNull` extension, such as:
allMatches(str).firstWhere(..., orElse: () => null);
the migration tool would erroneously identify some subexpressions of
the call target (`str` in this example) as the argument supplied to
`orElse`, resulting in a crash.
This CL fixes the logic so that we use an `identical` check to verify
when we are looking at the argument to `orElse`.
Fixes#43956.
Bug: https://github.com/dart-lang/sdk/issues/43956
Change-Id: I2f4a0e81becf789cab5334d4926e014bda2772f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170162
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
VM was not performing auto-detection of sound null safety mode
if --enable-experiment=non-nullable was not specified on the command
line. This change flips that logic to perform auto-detection unless
--enable-experiment=no-non-nullable is specified.
TEST=Added regression test runtime/tests/vm/dart/regress_44026_test.dart.
Fixes https://github.com/dart-lang/sdk/issues/44026
Fixes https://github.com/dart-lang/sdk/issues/44043
Change-Id: Ide8935e90dd3a8bd5a417aeb758605dedbb853eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170201
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Use a 2.12.0 lower bound since pub does not understand allowed
experiments for earlier versions.
Use a 3.0.0 upper bound to avoid a warning in pub and to give some
flexibility in publishing for stable.
Change-Id: I482e89becc7aa9f1a36298701ade70cbcc39702c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170204
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Use a 2.12.0 lower bound since pub does not understand allowed
experiments for earlier versions.
Use a 3.0.0 upper bound to avoid a warning in pub and to give some
flexibility in publishing for stable.
Change-Id: I3540dc3c085ac120997e107cfed5a991ad3f5ec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170202
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
As of Dart 2.1, Future/Stream have been exported from dart:core.
Change-Id: Ia4d70d1ccb55ac117bafe630a24b4ee2f60ff993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170126
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This Hint reports when an expression of type Null is null-checked with `!`.
This check will always fail at runtime.
Fixes https://github.com/dart-lang/sdk/issues/43982
Change-Id: I6e2eac4f7b7720a6b9a1c02066470eb039aa9010
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170122
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This CL adds predefined constructors to LateInitializationErrorImpl that
only take the name of the late field/variable as argument. This can reduce
the size of the generated code for ddc/dart2js size because the long
message isn't repeated at all call sites.
In response to #43995
Change-Id: Ie276dd1455feab1655da3a503856da425b20f04f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169883
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
The `bool` return types were added to `FlowAnalysis` methods
`nullAwareAccess_rightBegin`, `ifNullExpression_rightBegin`,
`equalityOp_end`, and `isExpression_end` in September as part of an
effort to fix mixed-mode unsoundness loopholes by having the front end
throw exceptions if "impossible" conditions arose. We later decided
that we would prefer to allow these conditions to arise without
generating exceptions, because that makes it easier for the user to
write defensive mixed-mode code. So the booleans stopped being used.
This CL removes them entirely.
Change-Id: Ia0ff91a22fe79c2df1dea89bbb286c84a3603821
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170125
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Changes Dart_NewWeakPersistentHandle to no longer auto delete the
weak persistent handle.
Changes the signatures of WeakPersistentHandleFinalizers to no longer
have access to the handle.
Flutter PR: https://github.com/flutter/engine/pull/19843
g3 presubmit: cl/318028238
Issue: https://github.com/dart-lang/sdk/issues/42312
TEST=runtime/vm/dart_api_impl_test.cc
Change-Id: I3f77db9954d9486759f903b78c03a494f73c68ba
Cq-Include-Trybots:dart/try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151525
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This does not affect the formatting of any existing code, so is safe to
roll without updating the pre-built SDK.
Change-Id: I2e7fc20d6933d136dc0390f93f6bc72dc340e9ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170141
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
The Dart exception is converted to a string, stored in a trap which
is passed through wasm, then converted back to a Dart exception.
Module instantiation can also throw a trap, because it internally
invokes the initialization function, if the module defines one. So I'm
handling this too.
Also, update to the new version of the wasm C API, which replaces some
foo_t** with foo_vec_t*.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I1e6952a191134734a892c42b2fb8ba3506bb0844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169784
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
This CL:
- Fixes https://github.com/dart-lang/sdk/issues/43987 (an exception in custom formatting code)
- Restores (most of) debugger_test.dart to passing (which tests above)
- Fixes a type caching error also exposed by the above test
Note, this skips the golden file comparison. That appears to be very broken
(see comment).
Change-Id: I283b66a710f17765faed47aa099b0b8570e6cac1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170022
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Change-Id: Ife3c77834df9f781d447a7d3cbc842fb7e44be49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170140
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
SuspendLongJumpScope during Dart entry ensures that if a longjmp base is available, it is the innermost error handler.
Bug: https://github.com/dart-lang/sdk/issues/35224
Change-Id: Ifc19a0241d213b9f012aacaddca0f85b0e79aedd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169783
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This partially undoes changes from acbd51c08
because they are now known to increate RSS of AOT
compiled applications.
This CL also removes length adjustment code from *String::InstanceSize
which tried to ensure that external string fits into a non-external
string. This code is no longer necessary because APIs for
string externalization were removed.
TEST=covered by the existing tests
Cq-Include-Trybots: luci.dart.try:app-kernel-linux-release-x64-try,app-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try
Change-Id: Ife4f16d6939d98bb7966121b5899cef9f0121220
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170080
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The version 0.40.6 was published, without 0.41.0 breaking changes.
We did not want to land this CL, but we want the CHANGELOG.md
Change-Id: I667c4bf8308cc81ff608b21993e0e1b5591ab5c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170027
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Previously, we hard a hard-coded set that included all packages added
by unit tests, which created confusion when writing new unit tests.
Now, `addPackageFile` records a list of all packages and
`package_config.json` is automatically generated just before analysis
begins.
Change-Id: I3393c0266a54d051ffa7601e74753a75857635e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170024
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Currently the migrator can add `@required` from the preview, which will crash
the preview upon rerunning, if package:meta is not imported.
This change instead adds a /*required*/ hint when meta is not imported.
Additionally, /*required*/ is understood by the migrator just as if it were
`@required`.
Fixes https://github.com/dart-lang/sdk/issues/43751
Change-Id: I1ea532246b956feacedd179146372b13c65003df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Specifically, we used to specialize TypeParameter TTS stubs, but that
was mistakenly removed when the non-IA32 versions were unified. Also
move the int subtype check before TypeParameters as it was before.
TEST=Ran golem benchmarks before submission to verify.
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try
Change-Id: I235d519c49341af76a902ac22df46c6754445a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170086
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
The option is changed from --cleanup_dart_processes to
--cleanup-dart-processes.
Change-Id: I3f9aefea81ac4ea040741d0850a851688f69e1a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170084
Reviewed-by: Alexander Thomas <athom@google.com>
Change-Id: I178f18484b853aa35248fa9f6252509ec0df6832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169500
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
There are no formatting changes in this release. The only change is the
fix for https://github.com/dart-lang/dart_style/issues/964.
Includes corresponding adaptations of dartdev/dart CLI.
Change-Id: I1c97f0b7009b98ae609b258401522453faa35c64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170083
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
This is needed for Windows test shards on swarming builders,
where the task_kill step at the end of the recipe is not sufficient
to clean up abandoned Dart processes on a single shard task.
BUG=https://github.com/dart-lang/sdk/issues/32138
Change-Id: Id48f29f46350b5496c7427ca043dc5f2445fae37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170082
Reviewed-by: Karl Klose <karlklose@google.com>