Note: This is a reland of https://dart-review.googlesource.com/c/sdk/+/150343
Adds a new SDK hash to kernels and the VM which is optionally checked
to verify kernels are built for the same SDK as the VM.
This helps catch incompatibilities that are currently causing
subtle bugs and (not so subtle) crashes.
The SDK hash is encoded in kernels as a new field in components.
The hash is derived from the 10 byte git short hash.
This new check can be disabled via:
tools/gn.py ... --no-verify-sdk-hash
This CL bumps the min. (and max.) supported kernel format version,
making the VM backwards incompatible from this point back.
This also bumps the min. and current ABI version.
Bug: https://github.com/dart-lang/sdk/issues/41802
Change-Id: I2f85945045a603eb9dcfd1f2c0d0d024bd84a956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152802
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Avoids an assertion failure in the front end.
Change-Id: I7994fa611f82011857750cc60af64a2c89c96bf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152923
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
From the spec: `It is no longer required that the [case expression] evaluate to instances of the same class.`
Fixes#42409
Change-Id: Ieecd96cb75d683658ffc767d973b0ff2f5e6d834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153060
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
I imagine that similar tests could/ should be written for other such ASTs.
Change-Id: Iea059af339e5dec34a937ed2c28fe55fdb072fc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
This CL would have reduced the number of errors given in
https://github.com/dart-lang/sdk/issues/42378
Namely the
"Warning: Tried to initialize from a previous compilation (build/cache.dill), but couldn't."
part wouldn't have been issued.
Change-Id: I3e7f2f0115a13a23522643b6f4c9ad8c57bc0d5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153141
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Previously the first file in the `Component.uriToSource` was used which
didn't work nicely with multifile tests.
Text outline expectations were already using the test description uri.
Change-Id: I0d4a7493cd1fa61beffba41f1ea859ca5e8ad08c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151825
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
If a user program installs custom signal handling for SIGINT,
the DartDev instance may exit before its child, potentially causing
confusing behavior and 'zombie' children. By ignoring these signals in
DartDev, the DartDev instance will only exit once its child process
exits.
Fixes https://github.com/dart-lang/sdk/issues/42092
Change-Id: I04bf6d1f375b8bb3a4f7022f2c79ddde3bd5f414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149643
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
This ignores the Lint on a few files where it is undesired.
Change-Id: I5e4244607da0ef60678cebb89a433e44cb1e753f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
If 'growable' argument of List.filled factory invocation is known at
compile time we can replace it with more specialized constructors
creating growable or fixed-size lists. This results in a more accurate
inferred type and more efficient code which uses the created list.
Fixes https://github.com/dart-lang/sdk/issues/42551
Change-Id: I427e1bdb8a0f2a83410a9533050d19cbca2d27d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153064
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
We cannot remove them completely just yet, there are users in google3.
But this CL will allow experimenting internally to track these users
and update them similarly.
R=brianwilkerson@google.com, devoncarew@google.com
Change-Id: Ic588b2873f9d5202783c8991f58e86bab28bd47e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL adds --trace-precompiler-to option which generates a machine readable
precompiler trace (list of all compiled functions and their dependencies).
It also expands package:vm_snapshot_analysis with tools for reading and
analysing this trace.
For example snapshot_analysis explain dynamic-calls command allows
to list all dynamic calls sorted by their impact on the size of the AOT
snapshot.
Issue https://github.com/dart-lang/sdk/issues/41249
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: Ie49143f4da375067991991e2ad20a41ec67bb1c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152851
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This helper method compares two size profiles and returns result
as a treemap.
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I82e5617bc367a2b89d3685ce7f7babc01492b531
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152908
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
This was noticed when running the benchmarks/Calls/dart/Calls.dart with
sound-null-safety.
The only fix that was needed is to swap the argument order, but I also changed
to add the type promotion to make these errors stand out statically.
Change-Id: If47b04596d2da9d30961705fd858f2f2ba2b12c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153062
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
I don't understand why it falls into the runZonedGuarded() error handler instead of being caught by `on AbortCompletion`.
It seems somehow related to the fact that we throw AbortCompletion inside an async function, but before any `await`.
IIRC we now execute this portion immediately, and actually return a Future instance only when we reach the first `await`.
Maybe this somehow affects the try/catch.
R=brianwilkerson@google.com
Change-Id: I192b5d410d9372205473b6032ef43c7c9880f9ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152906
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This is necessary for some Google internal testing environments that
are ipv6-only.
Change-Id: I1385786bd0f9614fabcf5730d96a0d6018c6401e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153063
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Please look this over carefully; all of your changes have been integrated,
but not all of the changes are yours. While itegrating your suggestions I
found a few more occurrances of 'is not' and 'are not' that I converted.
I also found a couple of other things that needed to be updated.
Change-Id: Iddaaa22d7e584506bc3c16606166771fd5a75caf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152942
Commit-Queue: Kathy Walrath <kathyw@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
This makes the implementation consistent with the spec text in
1ed6bab4cc.
Change-Id: Ie25b928c5aacb45a18e85c6f9196b5b55f083478
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152983
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The handling of null shorting in the variable initializer interfered with
the declaration of the variable, making subsequent flow potentially
losing track of promotions.
Closes#42504
Change-Id: Idb17920ffe8746983825714f76160abcca54751b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152760
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This CL adds support for type inference on type aliased invocations of
factory constructors, redirected as well as non-redirected, and it adds
some tests using this feature.
Additionally, this CL resolves a couple of issues that arose when the
directory nonfunction_type_aliases was migrated to null-safety (by
means of two single line fixes, in 'usage*_test.dart').
Still missing: The shadow nodes should be eliminated in
_unaliasTypeAliasedConstructorInvocations and
_unaliasTypeAliasedFactoryInvocations, this will be done in a separate
CL.
Change-Id: Ic146bd16a02ca8f79c46b7df7c8dff7712f21189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152740
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>