Updates imports in `tests/lib_2` from `tests/language` to use the
version in `tests/language_2` instead.
I think it is also a little awkward to import libraries across
tests suites period but that is an issue for another day.
Change-Id: Ib61bb1e1790926f92ee2650a6497916f2edce7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289407
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Although the true branch of `x != null` and the false branch of `x ==
null` promote `x` to non-nullable, the opposing branches do not promote
`x` to `Null` in the current flow analysis spec, which applies to the
CFE.
When switching from the dart2js static type computation to the CFE
static type computation, attempting to use `x` in these branches may
generate an unintended type check, which can overflow the stack if this
occurs in code responsible for performing type checks. The fix is fairly
straightforward - we can simply use an unchecked cast (via `JS`) instead.
See https://github.com/dart-lang/language/issues/1505 for discussion on
why the expected promotion does not (yet) occur.
Change-Id: Ia9cca4e1aa8e9c67b42c60189f0d3811afb61360
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289061
Reviewed-by: Stephen Adams <sra@google.com>
Adds class modifiers to `dart:ffi`.
Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
and `AbiSpecificInteger` to be `final class`es.
Does not remove the manual error checking, so some errors will show up
twice now in language version 3.0. In language version <3.0, only the
FFI-specific error will show up.
In a follow-up CL, we will try to make the language-errors to show up
also <3.0 so that we can remove the FFI-specific errors.
Examples of duplicated errors:
pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart
TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)
CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Recent changes that made migration tool more conservative affected
functions used in Angular's DI: functions annotated with `@Injectable`
must have non-nullable non-annotated arguments. Previously that
worked just because there was no reason to make them nullable.
Make such functions' arguments explicitly non-nullable.
Bug: b/250862403
Change-Id: I27207994b058ba845aafd7776d14380e8104e8f8
Tested: added a test
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289505
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
This changes the analyzer and CFE to use the real exhaustiveness
checking algorithm. The fallback algorithm is kept and will be
removed once we know that the real exhaustiveness algorithm sticks.
Change-Id: Ic9df92c1ca9f7dec4cbdfa138dc6ed39ef2d4df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Update the dart2js and kernel worker steps themselves to run
with sound null safety. This is separate from the code being compiled
in the step which will be migrated in another change.
Change-Id: Idbaaeb255209e79bb34aa34aedeb020be097c1c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289408
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
http (805a147..74f9d3d):
74f9d3d 2023-03-09 Brian Quinlan Add conformances test that verify that the Client works in Isolates (#889)
ee03604 2023-03-09 Brian Quinlan Add a flag to allow the default Client to be tree shaken away. (#868)
2039fb3 2023-03-09 Brian Quinlan Fix a reference count race with forwarded delegates. (#888)
Change-Id: I56faf5cf41ad16f6a365db66265b02e66adbc59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289502
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
This is less than half of them, will send some other chunks later.
Bug:51557
Change-Id: I4e80812a689fde99e23c34b6405aaf57cd431ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289261
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
This uses the context type when creating the space for a cast pattern
to include the implicitly covered subtypes in the space. This is done
when the context type is a sealed type which means that we can reason
about which of the subtypes of the sealed type that are implicitly
handled by the throw of the cast.
Change-Id: I3a4f14bf6ca82f59a2c2a3c27bb472a8f38c1613
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289222
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The Maps are all JSON, so they become `Map<Object?, Object?>`.
Most other types get a `Object` or `Object?` type argument, and a
few also get `dynamic`.
Change-Id: I097318defed55360b5b0d910bd2d085a121e97b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287673
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
- Adds a new flag, `--suppress-analytics` to the `dart` command to
disable both the unified and the legacy analytics for a single
session while deprecating the existing flag, `--[no-]analytics` used
for disabling the legacy analytics on a single pass.
- Pipelines the flag from `dart` through `dart analyze` and `dart fix`
to the execution of the analysis server.
- Updates all applicable uses of `dart analyze`, `dart fix`, and the
analysis_server binary entry points in the SDK to disable analytics
for the test infrastructure.
Bug: https://github.com/dart-lang/sdk/issues/49445
Change-Id: I1302cad7e04b21454aa7d9e8ee72a876b231377d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287661
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Having this hard coded means that older SDKs will forever put in a bad constraint, which will ultimately cause webdev to fail initially for all new projects created by those SDKs.
Bug:https://github.com/dart-lang/sdk/issues/51732
Change-Id: Icfbeda77662f62124e350b0f55c5a59b864c689f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289260
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
The recent change [1] improved availability of static types.
While that change improved performance on a lot of benchmarks,
it also caused a regression of SkeletalAnimationSIMD
benchmark in JIT mode.
The benchmark regressed because:
* When inlining a recognized method in call specializer,
compiler checks if an extra CheckClass instruction should be
inserted using FlowGraph::CheckForInstanceCall.
* CheckForInstanceCall has been looking only at the static type of
the receiver. When static type is absent, it is calculated from cid.
For a method lookup, cid is more precise compared to a static type.
So, when static type becomes available since [1], cid was no longer
used and extra CheckClass instructions were inserted to the IL.
* During inlining, extra CheckClass instructions increased callee size
and a useful inlining didn't happen, prohibiting other optimizations
and causing the regression.
This change fixes CheckForInstanceCall to look at the cid
first before looking at the static type.
[1] https://dart-review.googlesource.com/c/sdk/+/287222
TEST=SkeletalAnimationSIMD benchmark
Change-Id: I8cb496dee443eab9db828f1e28ba1efe7ea3f8ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289020
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Instead of finding the current library through the parents relation
we use the static type context which already had access to the
library.
Change-Id: Ia2116160b24b701ffa0794b9ccc9a59506c3adc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288840
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This removes the "unset" values and uses nullable types instead.
The names and uses of the pattern fields are normalized, using
`matchedValueType`, `requiredType` and `lookupType` consistently
between [Pattern] subclasses.
TEST=existing
Change-Id: Ic79ce17075aa8ce252e1c223b59bef660f32bb7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288704
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Change-Id: I00752198daceccf41d688f5aeb3bb8595e91d78b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289040
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Currently users can enable analytics using the unified analytics package in VS Code, but there is no option the disable from the UI. Adding this allows users to disable analytics by running `dart --disable-analytics`.
Change-Id: Ieff4281ab3fbdccee7ec7a05b185f5c4f9da6f76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289082
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>