Commit Graph

113432 Commits

Author SHA1 Message Date
Jake Macdonald 06bdbd777f Update mcp-server command to be an alias for 'run dart_mcp_server@'
Strips the dart-lang/ai dependency from the SDK entirely, as well as the snapshot.

Bug: https://github.com/dart-lang/ai/issues/479
Change-Id: Id919c6a8fbf5fedeffb37e5181bc2fbd85adf986
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507220
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2026-05-28 12:06:25 -07:00
Alexander Aprelev 527d529493 [vm/shared] Implement Isolate runEventLoopSync.
TEST=ffi/threading_runeventloop_test

Change-Id: I2061d10d14bcdd589a4a9893f122620f8d0a4e7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497100
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-28 11:38:29 -07:00
Konstantin Shcheglov a898adf8b7 Augment. Support for abstract top-level variables and static fields.
Change-Id: Idf0ce319492c405dd06364cb6feb81e000a7c741
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506606
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-28 09:19:15 -07:00
Konstantin Shcheglov 6f804b8121 CQ. Inline _IndexMixin. Trim _IndexResult.
Change-Id: Iee776321cc5a5aad72d539dc38b6f052dccb6872
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506881
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-28 09:00:37 -07:00
Konstantin Shcheglov d68c1befce CQ. Replace 'late AnalysisDriverUnitIndex index' with '_IndexResult'.
Change-Id: I795224feff73eab3bca791db2feb49759cd7b888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506900
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-28 08:57:32 -07:00
Konstantin Shcheglov 9543bb6472 CQ. Migrate from assertErrorsInTestResult() to resolveFileWithDiagnostics().
Change-Id: I1fc158dad37eba700b8c83e288de63270cedf3b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506880
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-28 08:52:34 -07:00
Konstantin Shcheglov f81c7f2140 CQ. Migrate from assertNoErrorsInTestResult() to resolveFileWithDiagnostics().
Change-Id: I1ec29d0051a90656092df9e321fba7f1ce2b7556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506861
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-28 08:49:28 -07:00
Konstantin Shcheglov 062a1fdcc5 CQ. Migrate to assertTestCodeWithStrictCastsDiagnostics().
Change-Id: I10858511860a8c8867ddfe0d60440bb54d4385cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506860
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-28 07:54:46 -07:00
Konstantin Shcheglov 1af709f3f0 CQ. Support for multi-line messages in inline expectations.
Change-Id: Iafb0f33ed1ad7167b4155e5d2c58d3db5833fae4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506820
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-28 07:50:54 -07:00
Konstantin Shcheglov c91d6d2373 CQ. Remove assertErrorsInResolvedUnit(), assertErrorsInResult(), assertNoErrorsInResult().
Update affected tests to use resolveFileWithDiagnostics() or
resolveFilesWithDiagnostics() instead.

Change-Id: I77acc47f62640ea55dc32103b526cbe489f57e6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506742
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-28 07:46:41 -07:00
Martin Kustermann 639f505308 [dart2wasm] Change dart2wasm-mac-safari to shards=1, i.e. no shards
Change-Id: Ia87d3ff035f936f1ca18a74a4ab75d464d502dbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507020
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-05-28 06:23:29 -07:00
Jens Johansen d441e28656 [CFE/VM] Fix mixin deleting procedure-setter because of final field
Fixes https://github.com/dart-lang/sdk/issues/63440
Tested: Tests added.
Change-Id: I0bdfd71c48ecae6094557fa4f46b8fc4b50afa73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506980
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-05-28 05:15:07 -07:00
Lasse R.H. Nielsen 69e9d32e87 Retire 'privately-named-parameters' experiment flag.
Change-Id: I6526bd63be5f71090a3ea7f3c705778e7debf584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2026-05-28 05:13:49 -07:00
Martin Kustermann 2198d25b1e [vm/testing] Make vm/dart/gc/scavenger_abort_2_test more robust
The test tries to keep fields alive by my making a

  toString() => field1 + field2 + ...

Though some field values don't have a `+` operator (e.g. instances of `class C`).

Improving TFA precision can infer that some of these `+` operations will throw,
which then makes other `+` operations unreachable, which removes usages
of those other fields, which will tree shake those other fields, which
will make the test not test anymore what it's intended to.

=> Make the test more robust by using string concatenation instead.

Change-Id: I80788af516083ea3d78ad910eb394e4b7e122384
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507000
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-05-28 03:49:20 -07:00
Martin Kustermann 5423762c21 [dart2wasm] Fix unreachable instance call issue
When a call is unreachable we used to generate sometimes a block with no
outputs, but callers expected an output which they may drop. That caused
stack discipline mismatch.

Instead we should simply emit an unreachable and tell the caller there's
no value.

Issue https://github.com/dart-lang/sdk/issues/63454

Change-Id: I81be6729fd578e237c4e6483539a9d53a9ed355e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506960
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-28 03:37:13 -07:00
Robert Nystrom 6c88c6f2ba Migrate pkg/smith to the new constructor syntax.
Change-Id: I5f17f4a7eddd5dd839b2061f5d4a1f33c40703a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506661
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-27 16:54:31 -07:00
Robert Nystrom 5ccd5818e0 Migrate pkg/expect to the new constructor syntax.
Change-Id: I872868b7f9dea21889aeac00a92eef0b03849354
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506603
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-27 16:17:46 -07:00
Robert Nystrom 9f11b2fd45 Migrate pkg/status_file to primary constructors and new constructor syntax.
Unlike my previous couple of CLs, I went ahead here and also migrated
most of the classes to use primary constructors since so many of them
were small and well suited for it.

In the process, I found and fixed one bug in the assist to convert to a
primary constructor:

https://dart-review.googlesource.com/c/sdk/+/506760

So I guess this CL has already paid its way. :)

Change-Id: I9b7d08e27f4ddce3f19127aaf4f14fe627b75dab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506743
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2026-05-27 15:56:27 -07:00
Paul Berry afcfbbeba8 Migrate developer experience packages to new constructor decl syntax.
(Part of https://github.com/dart-lang/sdk/issues/63288)

This change migrates the packages owned by the developer experience
team to use the new constructor declaration syntax, described in
https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md#abbreviations-of-in-body-constructor-declarations.

This change was performed in an automated fashion, by (a) bumping the
packages' SDK constraints to `3.13.0-0`, (b) enabling the lints
`unnecessary_type_name_in_constructor` and
`unnecessary_const_in_enum_constructor`, (c) fixing the resulting lint
failures using `dart fix`, and then (d) reformatting the affected
files.

To ease code review, I've reverted unrelated formatting changes.

Since this change requires bumping SDK constaints to `3.13.0-0`, it
was only performed on packages that are *not* published on
pub. (Packages that *are* published on pub should remain on lower
language versions until at least after the stable version of 3.13 is
released, so that we don't block users on the stable channel from
receiving updates to those packages.)

Change-Id: Ibb4daebafd239da58251e838ea6a3f336a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505046
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
2026-05-27 14:52:58 -07:00
Robert Nystrom 1e5aebc601 Reformat pkg/status_file.
I was starting to migrate it to use primary constructors but realized
the formatting was out of date, so I figured I may as well fix that
first so that the migration CL is easier to read.

There are no changes in this CL, I only ran `dart format .`.

Change-Id: I25f772ce0e0a00d83f1f8b561fc8bb9fe9486859
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506741
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-27 14:43:43 -07:00
Brian Wilkerson 8b555128be Support converting a declaring param to an initializing param
Server already supports the opposite, so this just makes it possible to
go both ways.

This doesn't support converting a declaring function typed parameter.
We could add that, but I'm hoping it's rare enough to not be worth doing.

Other than that, I think I've covered all the cases, but please pay
special attention to the test coverage.

Change-Id: I400204ca820d0e0f1cc44075dd54946db79b2115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506740
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-27 14:39:09 -07:00
Paul Berry 8b66930364 [presubmits] Print stdout,stderr if CheckSorted result can't be parsed.
Previously, in the `CheckSorted` presubmit check, if
`verify_sorted_test.dart` returned a nonzero exit code but none of its
output lines contained the string `Unsorted file`, then a presubmit
failure would be generated containing an empty string, resulting in
confusing output like this:

    Running presubmit upload checks ...
      18.4s to run CheckChangeOnUpload from /home/paulberry/dart1/sdk/pkg/_fe_analyzer_shared/PRESUBMIT.py.
    ** Presubmit ERRORS: 1 **


    Presubmit checks took 21.4s to calculate.
    There were presubmit errors.

This might happen, for example, if `verify_sorted_test.dart` contained
a compile-time error or threw an unhandled exception.

With this change, the message is `CheckSorted: could not parse output
of verify_sorted_test.dart`, followed by the full stdout and stderr
from the attempt.

This should make this sort of failure a lot easier to debug.

Note: I've made this same fix before to
`pkg/_fe_analyzer_shared/PRESUBMIT.py` (see
https://dart-review.googlesource.com/c/sdk/+/485601). I didn't realize
at the time that the code was duplicated.

Note: This should make it easier to debug
https://github.com/dart-lang/sdk/issues/63464.
Change-Id: I4892dcff7ad6969ca40564c1fd7e62e36a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506605
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-05-27 14:34:26 -07:00
Konstantin Shcheglov d3a8da96a0 Augment. Rename two tests in augmentation_return_type_mismatch_test.dart
Change-Id: I1a694006a2f34951298eb6d8846c44d88a0ef391
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506502
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-27 14:13:43 -07:00
Alexander Aprelev 52fc4ee1eb [vm/fuchsia] Skip new test on fuchsia.
The test requires experimental shared data flag, which can't be passed to gen_snapshot on fuchsia at the moment.

Fixes https://github.com/dart-lang/sdk/issues/63462
TEST=ci

Change-Id: I96c5847b17625b874027e468d99a1f492fa5d17f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506701
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-05-27 14:08:42 -07:00
Konstantin Shcheglov 5252e5e3d3 CQ. Remove assertErrorsInFile2(), use resolveFilesWithDiagnostics().
Add helpers that resolve non-test files using the same inline diagnostic
expectation format as resolveTestCodeWithDiagnostics.
resolveFileWithDiagnostics handles a single file, while
resolveFilesWithDiagnostics writes all related files before resolving
any of them.

Add multi-file diagnostic expectation generation so context messages in
one file can be referenced from diagnostics reported in another. Teach
expectation updating how to target values in a files-to-code map using
per-entry intra-invocation ids.

Remove assertErrorsInFile2 and migrate diagnostics tests from
hand-written ExpectedError offsets to inline markers. This keeps the
diagnostic range, code, message, and cross-file context next to the code
under test, and makes expectation updates reusable for library and part
tests.

Initialize strong-mode type assertions from resolveFile so callers that
resolve files other than testFile get the same setup.

Change-Id: Ie492155b046c28a535faf21fa9a2e47797caffb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506180
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-27 14:05:36 -07:00
Robert Nystrom 2cd3ec552c Fix "Convert to a primary constructor" on generic classes.
It would incorrectly put the primary constructor parameter list before
the type's type parameter list, like:

```dart
// Before:
class C<T> {
  C();
}

// After:
class C()<T> {
}
```

This fixes it to follow the type parameter list if there is one.

Change-Id: Ib49c7df7923e9feed11f87579fefc8300c56c4a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2026-05-27 13:59:34 -07:00
Paul Berry 9bd89a769d Work around issue with -r in presubmit scripts.
For some reason, when a `CheckSorted` presubmit invokes
`verify_sorted_test.dart`, the `-r` flag is preventing the compiler
from picking up the proper language version from
`.dart_tool/package_config.json`. This is interfering with my ability
to run presubmits for
https://dart-review.googlesource.com/c/sdk/+/505046.

See https://github.com/dart-lang/sdk/issues/63464 for additional
details.

As a temporary workaround, this CL removes the `-r` flag. It should be
reverted once https://github.com/dart-lang/sdk/issues/63464 has been
fixed (and the pre-built SDK has been updated to include the fix).

Change-Id: Ibc48eec4ef382d6afe17d73454f07dcd6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506700
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-05-27 13:49:54 -07:00
Sam Rawlins d0f27293ce DAS plugins: Respect the analysis roots set by "dart analyze"
Work towards https://github.com/dart-lang/sdk/issues/62686

`dart analyze` uses an 'analysis.setAnalysisRoots' "command" to let
the analysis server know that the user requested, for example,
`dart analyze foo` or `dart analyze foo/bar.dart`. This was not conveyed
to analyzer plugins, so analyzer plugins will always analyze the entire
context collection.

(For some reason, only files in the "analysis roots" were reported in
stdout; maybe DAS or dartdev does its own filtering on diagnostics.)

This change forwards the `setAnalysisRoots` request to DAS plugins using
a new protocol message that mirrors the one for the server.

We should not change the behavior of `analysis.setContextRoots` for
legacy plugins, so we keep sending that request as per usual. Then
we send `analysis.setAnalysisRoots` at the same time.

If we receive an `analysis.setAnalysisRoots` message, dispose and
delete references to the existing context collection, and instantiate
a new one, with the specified `included` and `excluded` paths.

Change-Id: I53627da1c30351a22b5e5410a557bf486620a7aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505041
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-27 13:47:02 -07:00
Ryan Macnak e991ffd37b [vm] Fix HashBytes to work with unaligned inputs.
TEST=ubsan
Bug: https://github.com/dart-lang/sdk/issues/63452
Change-Id: I112b26c08b5ae186dc5264d99edbed9e6e60368d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506660
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-27 12:55:21 -07:00
Robert Nystrom 81059a1b79 Migrate pkg/scrape to the new constructor syntax.
Change-Id: I45dcedb1ce90d7a9700a57767ae01fff5721ccfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506602
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2026-05-27 12:21:23 -07:00
Alexander Aprelev 488ba69e41 [vm/shared] Introduce isolate event loop handling dart api.
Implement api methods to create and shutdown isolates from IsolateGroup-bound callbacks (normally invoked from native code), run dart code on such isolates.
The rest of the api is not implemented yet.

TEST=tests/ffi/threading_test.dart
BUG=https://github.com/dart-lang/sdk/issues/62407
CoreLibraryReviewExempt: vm-only change to isolate library
Change-Id: I0271ead8ba011dfe9d7953769415d6a88a962854
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486522
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-05-27 11:31:11 -07:00
Konstantin Shcheglov ba760c36a4 Augment. Report augmentationInducedGetterAlreadyComplete and augmentationInducedSetterAlreadyComplete.
Change-Id: I87ba9c5b6c489417173a387bded700f52b52e7ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506501
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-27 11:17:44 -07:00
Sam Rawlins 19ca914f74 Remove redundant lint rules
use_null_aware_elements is included in the lints package analysis
options.

Change-Id: I01222fc7e84be32da657f04b16e15af7d5861433
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-27 10:26:22 -07:00
Paul Berry 49597f85d9 [front_end,kernel] Add ignores for codegen to prepare for new syntax.
(Part of https://github.com/dart-lang/sdk/issues/63288)

Updates various code generators in the `front_end` and `kernel`
packages to output `ignore_for_file` comments to ignore the
`unnecessary_type_name_in_constructor` lint.

This is a first step towards migrating the `front_end` and `kernel`
packages to use the new constructor declaration syntax, since it will
allow the `unnecessary_type_name_in_constructor` lint to be enabled
without breaking generated code.

Once all the packages have had their SDK constraints bumped to a
language version that supports the new syntax, I'll update the code
generator to use the new syntax, and remove the ignores.

For more information about the new constructor declaration syntax, see
https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md#abbreviations-of-in-body-constructor-declarations.

Change-Id: I73fd960a7eea2a1a59316602c49d56816a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-05-27 10:11:50 -07:00
Sam Rawlins 0fa39c9649 linter: Switch cascade_invocations to report once for a set of cascadable statements
Fixes https://github.com/dart-lang/sdk/issues/58688

Change-Id: I022b58109deedfbd6e57e6aa5159942081e6d8fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-27 08:58:12 -07:00
Tess Strickland 7cd8fda37e [vm] Use Uint32Arrays for coverage arrays.
Also load/store canonical hashes in the heap for non-empty TypedData
instances in the same manner as canonical hashes for Arrays.

TEST=ci (refactoring only)

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: I54274b558fa9f0c8e304198b18cb3f0e9c3e0dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504600
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-05-27 08:18:27 -07:00
Daco Harkes da40aec0bb [deps] Roll dart-lang/native
Pass in the entry-points and OS to the link hook when the record_use
file is provided. So that different target OSes and different entry-
points are cached separately.

Also, commit skill to rev `native_rev` in DEPS. (The new agent
IDE ignores gemini.md that contained it and prefers using skills.)

Change-Id: Ic77e3ccd5915736081c01f8b75901f626f688f19
Cq-Include-Trybots: luci.dart.try:dart2wasm-asserts-linux-chrome-try,dart2wasm-asserts-minified-linux-d8-try,dart2wasm-linux-chrome-try,dart2wasm-linux-d8-try,dart2wasm-linux-firefox-try,dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-optimized-jsc-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try,dart2js-canary-linux-try,dart2js-hostasserts-linux-d8-try,dart2js-linux-chrome-try,dart2js-linux-firefox-try,dart2js-mac-chrome-try,dart2js-mac-safari-try,dart2js-minified-csp-linux-chrome-try,dart2js-minified-linux-d8-try,dart2js-unit-linux-x64-release-try,dart2js-win-chrome-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506580
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
2026-05-27 07:31:46 -07:00
Sam Rawlins 37197070f8 DevTools: Run "flutter clean" after building
Fixes https://github.com/flutter/devtools/issues/9837

Change-Id: Ib770caf7409ea19970d4ff65cea7fe849a6a730c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505381
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-27 07:27:20 -07:00
Ryan Macnak 0ff42aac19 [vm] Fix poor hash performance of CodeSet.
Observed this taking ~2% of debug gen_snapshot time.

TEST=ci
Change-Id: I657148904fe2b5a8f3dfbd006c3d1327aa3866ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506261
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-27 07:21:32 -07:00
Ryan Macnak b0a82e98d5 [build, mac] Sign shared libraries and fix incremental build for changes to signing script or entitlement files.
TEST=ci
Change-Id: Ied90ee7b81a23de266d6f7dc5e642a820dac9248
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506341
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-27 06:34:31 -07:00
Erik Ernst 3263555dc5 Start implementation of anonymous block methods
This CL introduces support for anonymous block methods (that is,
`e.{ print(this); }` as opposed to `e.=> print(this);`). It introduces
the notion of a `ReturnContext` which is used to change the semantics
of a return statement when it returns from an anonymous method (where
it works like a `break` that terminates the execution of the block
which is the body of the enclosing anonymous method), but keeps the
semantics of return statements returning from a function (including
function literals) still have the same semantics as today.

Change-Id: I404459361fbb7c2e495e46d1bd29924063f3aac4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503800
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2026-05-27 06:04:46 -07:00
Simon Binder 656ff46efd [dart2wasm] Restructure patches and internal libraries
The dart2wasm compiler can use three different SDK platforms depending
on compiler options: The default one, a JS compatibility target and a
standalone target.

Code for these platforms used to be in `_internal/` subdirectories, but
parts of `_internal/wasm/lib` were also used by the other targets.
To make it clearer which patches/internal libraries belong to which
target, this restructures `_internal/wasm` as follows: Files only
relevant for one target are in `js`, `js_compatibility` and
`standalone`. Files used by all targets are in `common`, files used in
the default and the JS compatibility target are in `js_common`.

TEST=Refactor, covered by existing tests

Change-Id: I2c63c04a5fd5ca88cd640889aa295bd1fb8cfc95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505441
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
2026-05-27 03:16:22 -07:00
Jens Johansen b59608241f [CFE] Scope calculator handles parameters and initializing formals special
* The VM stops at the last parameter at which point the last parameter
   should also (pretend) to be in scope.
 * We should have initializing (super) formals in scope in the parameter
   list and in the initializer list but not in the body.

Small step towards https://github.com/dart-lang/sdk/issues/62645

Change-Id: I94442e1709a2e14613d81617f8153d9e2b11d889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500460
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-05-27 02:49:19 -07:00
Jens Johansen b69989fa35 [CFE] Incremental suite: Do more equality testing
Change-Id: I2e4ebf9d12a8cae0481bf2a7022d4fa801fcf4fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505821
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-27 01:33:47 -07:00
Johnni Winther a04691a8a8 [kernel][Contexts] Serialize new local variables
This adds serialization of the new local variables, VariableStatement and VariableDeclaration. This prepares for replacing LegacyVariable with the new variables in all backends.

TEST=existing

Change-Id: I9bbebfbfd372042d6b7027f0fabd24c165699832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506240
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2026-05-27 00:41:34 -07:00
Johnni Winther 5111553828 [kernel][Contexts] Add LateVariable
This adds a separate node for late variables, allowing for specializing its interface.

Change-Id: Id83308ce8bb2e36e5fe23adb201859af1275897f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505840
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-05-27 00:41:34 -07:00
Johnni Winther f9fadc80da [cfe][Contexts] Remove constant evaluator work-around
Closes #63414

Change-Id: Iac2cd204d70138676ece9d8d438f1a5f01c1bad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505820
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-05-27 00:41:34 -07:00
Johnni Winther 6b693e00bc [kernel][Contexts] Add VariableDeclaration
This adds a VariableDeclaration node which is used in ForStatement instead of VariableStatement.

This is a step towards removing the initializer from Variable. Long term, VariableDeclaration will own the initializer expression for variables and function parameters will have a defaultValue property instead of using the initializer property for the default value.

TEST=existing

Change-Id: I4a663eeb6006a0f9f098fb2b3e3b502d2ae583b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505681
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2026-05-27 00:41:34 -07:00
Jens Johansen 7e348949c1 [CFE] Incremental compiler can load additionalDillModules
Change-Id: I8de4c703377eabacd4e423d5a2045f9411da11a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505301
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-05-26 23:58:20 -07:00
Jens Johansen a1a881b49f [CFE] Refactor incremental suite
This was done while trying to implement loading additional dill modules
via the incremental compiler, but I believe I've removed all that and
only left the refactoring in this CL.

Change-Id: I047940b5dfe526ddfbc11627a29fc80eb82c3049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505260
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-05-26 23:24:56 -07:00