Commit Graph

113393 Commits

Author SHA1 Message Date
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
dart-autoroll@skia-public.iam.gserviceaccount.com 9c359e2317 Roll Fuchsia SDK from 32.20260521.3.1 to 32.20260522.6.1
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-sdk-dart-sdk
Please CC fuchsia-3p-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Fuchsia SDK: https://bugs.fuchsia.dev/p/fuchsia/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try;luci.dart.try:vm-fuchsia-release-arm64-try
Change-Id: I03c019c17f1a6b23b48460a5637f980bb597c619
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505882
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 19:16:32 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com 360bf1cb59 Roll BoringSSL from beddb582d9e8 to 5ee9407bc28d (6 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/beddb582d9e8..5ee9407bc28d

2026-05-21 rpolzer@google.com Fix off-by-one allowing an unauthenticated handshake abort.
2026-05-21 rpolzer@google.com bio_read_all: bail out on every error.
2026-05-20 rpolzer@google.com RSA: handle gracefully when a SSL_PRIVATE_KEY_METHOD has NULL methods.
2026-05-20 rpolzer@google.com X509_VERIFY_PARAM_inherit/_set1: refuse if either params are poisoned.
2026-05-19 agl@imperialviolet.org RSA_generate_key_ex: tighten up code a bit.
2026-05-19 rpolzer@google.com RSA_generate_key_ex: reject invalid values of e.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/boringssl-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@rotations.google.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in BoringSSL: https://crbug.com/boringssl/new
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-vm-gardener@rotations.google.com
Change-Id: I69524e6ebfe8aadcfae105189ffb0108c69cfa3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505881
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 18:28:52 -07:00
Ryan Macnak feab749acb [build] Make the build more reproducible.
On Mac and Linux, the makes the output of non-RBE, RBE local and RBE remote builds identical, and also independent of the build directories path.  On Windows, non-RBE and RBE builds still disagree because paths are rewritten from \ to / to run on the Linux workers.

Bug: b/316893839
Change-Id: I5935785489c73445e4c6ca275020e6cf7464433d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506281
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 15:35:21 -07:00
Ryan Macnak 84bd4ea759 [build] Remove dead tools.
TEST=ci
Change-Id: I535527098d08b3ecbf1ae731497750a43f478196
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506460
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 14:40:09 -07:00
Ryan Macnak d080a5defd [build] Remove dead configs.
TEST=ci
Change-Id: Ibfff85b97d607fffb8aae49bd56e688ba292ff6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506461
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-26 14:38:25 -07:00
Alexander Aprelev 276cace231 [vm/mac] Fix WorkSet name confusion on flutter mac.
On mac with two WorkSet classes, WorkSet destructor from lib/isolate.cc is invoked instead of WorkSet destructor from vm/object.cc. This results in consistent assertion failures on flutter dart-debug builds on mac.

Might help with https://github.com/flutter/flutter/issues/186134

TEST=flutter test with dart-debug build

Change-Id: I9a0a0c9d02ee013da900807b8726df26a3660cc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505661
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-05-26 11:21:44 -07:00
Paul Berry 3e195c913f Ignore TODOs in analysis_server_client package.
Some time ago, the analyzer team decided to adopt the convention of
using `TODO` comments to document long term issues that should persist
in the codebase, and `FIXME` comments to document short term issues
that need immediate attention.

Accordingly, it makes sense to suppress `TODO` comments from being
surfaced to the IDE "problems" view (since there can be a lot of them,
and they're not immediately actionable).  This makes VSCode's
"problems" view much more usable in "tree" mode.

Previous CLs that have made this change in other packages:
- https://dart-review.googlesource.com/c/sdk/+/295662
- https://dart-review.googlesource.com/c/sdk/+/325121
- https://dart-review.googlesource.com/c/sdk/+/358980
- https://dart-review.googlesource.com/c/sdk/+/410060
- https://dart-review.googlesource.com/c/sdk/+/440546
- https://dart-review.googlesource.com/c/sdk/+/442167
- https://dart-review.googlesource.com/c/sdk/+/443633

Change-Id: Ia7c7ce5e0ab0ac32d61d8a93319c363c6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506321
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-26 10:40:55 -07:00
Konstantin Shcheglov 53c69a614e Augment. When moving enum 'values' constants from augmentation to the introductory declaration, skip 'values' fragment of the augmentation.
This `values` fragment is a purely synthetic construct.

Change-Id: I795e6b2a92d8d5809c8107b41522e0d41c7d03bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506220
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-26 10:39:42 -07:00
Brian Wilkerson a527b4d9b0 Remove a null check from completion metrics
This CL replaces a null check with a null-aware collection element.

Change-Id: Ib5630db2d72f822e640aec796de8d56b604e1511
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506360
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-26 10:29:40 -07:00
Ryan Macnak b5c7496c02 Handle ARM64 in Debian package testing.
Change-Id: Iaff121c9a97fa5418a32efdc2550421796b70109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506160
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-26 10:27:44 -07:00
Ryan Macnak a43ef7db89 [build] Set mnemonics.
Change-Id: Ib8729ebde2ae58c20afdc879336c3ad2a4a67b38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506282
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 10:21:37 -07:00
Ryan Macnak d907fbb72b [build] Fix more invocations to use relative paths.
Change-Id: I417ff793567a8adbbc4cc4fd4f77792c9a451f89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506280
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-26 10:19:40 -07:00
Sam Rawlins c4d1c3a3e8 DAS plugins: Fix entrypoint deletion bug
I recently introduced this deletion logic but was deleting the wrong
file; this was deleting the `plugin.dart` file that `plugin.aot` is
compiled from. Over the weekend I found this issue with manual testing.
I've also verified this fix with manual testing.

Change-Id: I3f570368068117e6bb952ada0707a09ee97b765c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506320
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-26 10:13:34 -07:00
Brian Wilkerson 35f6ce7bb0 Update OpType to work with primary constructors
This prevents a null exception that could otherwise occur during code
completion. I think that this only impacts internal users.

It's not ideal. As you can see from the tests OpType is deciding that
we should be suggesting type names in places where they can't exist,
but I think that's a theoretic issue because I believe that the code
completion code won't access the OpType in these situations.

If I'm wrong, then the failure mode will be to suggest type names
that shouldn't be suggested in a couple of situations. If users do
notice this behavior it should be relatively easy to tighted up the
computation to only suggest the valid completions.

Change-Id: I6ceb9615384371f9dcc4fd30d914c7574ed6e304
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506340
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-26 10:11:37 -07:00
Konstantin Shcheglov 8c6366e66e Augment. Deprecate ExtensionTypeDeclaration.primaryConstructor, use namePart instead.
Extension type augmentations do not have representation declarations, so
an `ExtensionTypeDeclaration` can no longer always expose its name
through a primary constructor. Add `ExtensionTypeDeclaration.namePart`
as the canonical API for the declared name and type parameters, and keep
`primaryConstructor` as a deprecated compatibility API for introductory
declarations.

Report `extensionTypeAugmentationHasRepresentation` when an augmentation
writes representation syntax. This keeps the parser recovery explicit:
the augmentation still gets a plain `namePart`, while the invalid
representation is diagnosed instead of being modeled as the
declaration's primary constructor.

Synthesize recovery representation and primary constructor fragments
only for the element model when an extension type has no introductory
declaration.

Migrate analyzer, analysis server, analyzer plugin, and linter clients
to read extension type names and type parameters from `namePart`.

Change-Id: I59dd957ac38f087c861b993caf246986dcdac713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505067
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-26 10:05:28 -07:00
Ryan Macnak cf5494aa89 [build] Make generating the VM's version strings work with Ninja's restat feature.
If the version is unchanged, don't write to the file. Ninja will notice the modification time is unchanged and avoid rebuilding the target's dependents.

In particular, this means merely adding or amending a commit will no longer make the VM and all SDK snapshots dirty.

Change-Id: I25617c6c584d1d1094a339fe14716d18b28c688f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506101
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 10:03:28 -07:00
Ryan Macnak e04d2179a1 [vm] Fix quadratic cost of SNAPSHOT_BACKTRACE.
Observed this taking ~16% of debug gen_snapshot time.
Observed this taking ~52% of debug AppJIT training time.

TEST=ci
Change-Id: I945e4f3a8794e607e1402150a10f0d328fa1e677
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506260
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-26 09:40:40 -07:00
Modestas Valauskas c5d547fdb8 [vm/compiler] Preset far_branch_level for huge JIT-optimized functions.
When the unoptimized code of a function exceeds 1 MB, start its
optimized compile with far_branch_level=1 instead of 0. Without this,
the assembler fails on out-of-range conditional branches at level=0,
longjmps out of the optimizing pipeline, and the whole pipeline reruns
at level=1 from scratch.

Measured on a naive 49 KLOC generated lexer with --huge_method_cutoff
gates lifted: JIT compile drops from ~26.6s to ~13.2s (about 50%).

Work towards https://github.com/dart-lang/sdk/issues/63230

TEST=ci

Change-Id: I2608a23ef899603a46b401b71be7322b7a8dd44b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506120
Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-05-26 08:10:15 -07:00
Ryan Macnak 0bf1b50875 [build] Clean up aot_compile_using_prebuilt_sdk.
Change-Id: I8fae6e701b97a01ab4fa3f68d8fc3c39c6d00761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506141
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 08:03:40 -07:00
Ryan Macnak 53733077b2 Revert "[standalone] Remove the fallback root certificates."
This reverts commit 039aef728a.

Reason for revert: b/515601247

Original change's description:
> [standalone] Remove the fallback root certificates.
>
> The discovery of the system root certificates is more robust after 2142d8e148.
>
> TEST=ci
> Change-Id: I8215cb92f98e620b82f21261c13e061a2b488b5d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433923
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TEST=ci
Change-Id: Ib07de221ff1160461d930f7165a7cd8179b4e3f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506100
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-26 07:49:52 -07:00
Ryan Macnak 58ea063ca8 [vm, compiler] Fix high hash collision rate in a large run of sequential double values.
TEST=many_double_literals_test
Change-Id: Ieddaa44ddc0cc67eb8913a62daab44b5579123a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506140
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 06:42:00 -07:00
Sergey G. Grekhov 0124cf29fe [co19] Roll co19 to 8a302a4666a9adae63b52fb49f37e7407935f13c
2026-05-22 sgrekhov22@gmail.com Fixes dart-lang/co19#3810. Fix typos in static_member_and_instance_member_t06.dart (dart-lang/co19#3811)
2026-05-21 sgrekhov22@gmail.com dart-lang/co19#2303. Add missing `Directory.create(Sync)` tests (dart-lang/co19#3806)
2026-05-21 sgrekhov22@gmail.com dart-lang/co19#2303. Make `Link.create()` tests stronger (dart-lang/co19#3809)
2026-05-21 sgrekhov22@gmail.com dart-lang/co19#2303. Make `Link.createSync()` tests stronger (dart-lang/co19#3808)
2026-05-21 sgrekhov22@gmail.com dart-lang/co19#2119. Remove unused imports (dart-lang/co19#3807)
2026-05-20 sgrekhov22@gmail.com Fixes dart-lang/co19#3803. Updated tests for abstract variable augmenting a getter/setter (dart-lang/co19#3804)
2026-05-20 sgrekhov22@gmail.com dart-lang/co19#2119. Remove invalid test attributeChanged_A01_t01.dart (dart-lang/co19#3805)
2026-05-19 sgrekhov22@gmail.com dart-lang/co19#2303. Refactoring. Make names of auxiliary functions more clear (dart-lang/co19#3802)
2026-05-18 sgrekhov22@gmail.com dart-lang/co19#2303. Add more tests for File.create(Sync) method (dart-lang/co19#3797)
2026-05-18 sgrekhov22@gmail.com Fixes dart-lang/co19#3799. Update expected errors in applying_augmentations_A04_t03.dart (dart-lang/co19#3801)
2026-05-12 sgrekhov22@gmail.com Fixes dart-lang/co19#2162. Add more member conflict tests and test cases. (dart-lang/co19#3796)
2026-05-12 sgrekhov22@gmail.com Add tests for LUB calculation (dart-lang/co19#3790)
2026-05-12 sgrekhov22@gmail.com Add flow analysis test for `await Never` (dart-lang/co19#3795)
2026-05-11 sgrekhov22@gmail.com Fixes dart-lang/co19#3791. Update error expectations in initializers_t04.dart (dart-lang/co19#3793)
2026-05-08 sgrekhov22@gmail.com Fixes dart-lang/co19#3788. App tests for `FileSystemEntity.parentOf()` (dart-lang/co19#3789)

R=athom@google.com, eernst@google.com

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,dart2js-minified-linux-d8-try
Change-Id: I50c3d1b1cb62b4cd7b370591c9131a3ff6b61d38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505780
Auto-Submit: Sergey Grekhov <sgrekhov22@gmail.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2026-05-26 02:13:45 -07:00
Modestas Valauskas 0a2f2ceacf [vm/compiler] Stop ConstantPropagator phi join at NonConstant.
Short-circuit the per-predecessor Join loop in
ConstantPropagator::VisitPhi once the running join has reached top.

Measured on a naive 49 KLOC generated lexer with --huge_method_cutoff
gates lifted: AOT compile drops from ~21s to ~11s (about 47%).

Work towards https://github.com/dart-lang/sdk/issues/63230

TEST=ci

Change-Id: I3103253bdba93252d4b7abcb25819a52f75b2058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505402
Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-05-26 00:56:04 -07:00
Chloe Stefantsova fb4752caaf [cfe] Account for initializer positioning during context allocation
This is a follow-up to the following:
https://dart-review.googlesource.com/c/sdk/+/496620/comment/4657bd83_ae92ec84/,
https://dart-review.googlesource.com/c/sdk/+/504202/comment/0b351223_6256c5d5/,
https://dart-review.googlesource.com/c/sdk/+/504202/comment/cd735d7c_7aa7970a/,
https://dart-review.googlesource.com/c/sdk/+/496620/comment/4e4662bc_e3ad4617/.

Part of https://github.com/dart-lang/sdk/issues/61572

Change-Id: I2849e58e5e6a7cd502eaa214b7835d564e5e4549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505682
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2026-05-25 23:51:47 -07:00
Konstantin Shcheglov 4629bff7e9 Augment. Report extensionTypeAugmentationSpecifiesRepresentationField.
Add a syntactic diagnostic for extension type augmentations that declare
representation fields. Extension type augmentations may augment the
declaration, but they must not redeclare the representation.

Thread an explicit parser option through primary constructor parsing so
extension type augmentations can omit a representation without producing
the usual missing-primary-constructor diagnostics, while still reporting
an error when a representation is present.

Register the new diagnostic in the shared and analyzer generated
diagnostic tables and add it to fix status tracking.

Change-Id: I84815bb0669a76126564e590760e93096a3af046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-22 17:36:54 -07:00
Brian Wilkerson ec40ebcd23 Fix a bug in textDocument/definition for primary constructors
Change-Id: Id24cdfda1c84322b5fa77cca0c87df0784482ec6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506080
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-22 17:05:29 -07:00
Alexander Aprelev 8765d80177 Revert "[vm] Recognize int.trailingZeroBitCount/oneBitCount as graph-inlinable"
This reverts commit 0bef837817.

Reason for revert: simarm, xarm bot failures https://github.com/dart-lang/sdk/issues/63436

Original change's description:
> [vm] Recognize int.trailingZeroBitCount/oneBitCount as graph-inlinable
>
> Stacks on top of the int.{trailingZeroBitCount,oneBitCount} API CL
> (commit 754239b077). Both getters route through OTHER_RECOGNIZED_LIST
> when a hardware fast path is available; otherwise the newly added
> Dart bodies inline at call sites via vm:prefer-inline. The C++
> natives are removed.
>
> Backend codegen
> ---------------
> ARM64:     NEON CNT + UADDLV (popcount); RBIT + CLZ (ctz).
> ARM:       NEON CNT + VPADDL chain (popcount); RBIT + CLZ on the
>            register pair (ctz).
> x64:       popcntq when TargetCPUFeatures::popcnt_supported();
>            LoadImmediate(64) + rep_bsfq for ctz (decodes as tzcnt
>            on BMI1+, preserves dest on zero otherwise).
> RISC-V 64: cpop / ctz when RV_baseline includes Zbb.
>
> Per-arch availability is encapsulated in
> UnaryInt64OpInstr::IsSupported(Token::Kind).
>
> Apple M-series ARM64, AOT (us/iter, lower is better):
>   cardinality.swar              371
>   cardinality.accelerated       154    (2.4x)
>   forEachSetBit.swar          19031
>   forEachSetBit.accelerated    4988    (3.8x)
>   select.swar                   199
>   select.accelerated             77    (2.6x)
>   complementCardinality.swar    399
>   complementCardinality.accel   152    (2.6x)
>
> Work towards https://github.com/dart-lang/sdk/issues/6486 (popcount
> and ctz intrinsification).
>
> Work towards https://github.com/dart-lang/sdk/issues/1053 (efficient
> BitSet implementation).
>
> Fixes https://github.com/dart-lang/sdk/issues/52673
> Fixes https://github.com/dart-lang/sdk/issues/38346
> Issue https://github.com/dart-lang/sdk/issues/10212
> Issue https://github.com/dart-lang/sdk/issues/5798
> TEST=tests/corelib/int_bit_count_test
>
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-simarm_x64-try,dart-sdk-linux-riscv64-try
> Change-Id: I9c2c4225fd63d54e190398a0fb6649366317dd17
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504221
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-simarm_x64-try,dart-sdk-linux-riscv64-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I4eaca9e25a919ba494f2e7e9819f1ea7d5a13078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505941
Auto-Submit: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
2026-05-22 14:22:30 -07:00
Konstantin Shcheglov ca15e2cdd9 CQ. Remove shallow abstractions in DeprecatedMemberUse_PackageConfigWorkspaceTest and ExperimentalMemberUseTest.
Change-Id: I7314f16e7b05316d9c2f47bbcb2805d41a9359a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506000
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-22 14:16:27 -07:00
Nate Bosch b162f6717d [io] Fix FileSystemEntity.type and Link.exists with IOOverrides
Fixes #63418

When IOOverrides are active, `fseGetType` and `fseGetTypeSync` used
`utf8.encode(path)` which does not null-terminate the path. Native
APIs require null-terminated paths. Through luck the sync path worked
but the async path failed with `notFound`.

Update them to use `FileSystemEntity._toUtf8Array(path)` which correctly
null-terminates the path.

Tested: added a regression test to tests/standalone/io/io_override_test.dart

TAG=agy
CONV=ab6af504-d536-4a8d-88be-bc487b60e24d
R=bkonyi@google.com

CoreLibraryReviewExempt: No API changes.
Change-Id: I24e31efdcbecc703800b96a144e41a095a445cff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505201
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2026-05-22 14:13:35 -07:00
Konstantin Shcheglov 1121b4041f CQ. Consistently use 'var node =' before assertResolvedNodeText().
Change-Id: I2363c3fb724780ef31fa97b2d76988e21ef6c6ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505922
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-22 13:29:01 -07:00
Brian Wilkerson 03a05b52d8 Fix a primary-constructors bug in ElementMatcher
The element matcher threw a null check exception when getting a matcher
in the argument list of a constructor redirect in a secondary
constructor declaration with no explicit type name. This fixes it so
that no exception will be thrown.

That said, it isn't clear to me that this code could ever be reached
outside of the tests. There might be a lot of unreachable code in
ElementMatcher. I just can't prove that this particular bug would never
have occurred.

Change-Id: I5adf9ab5d4f79686110099054902a28535483f4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505921
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-22 13:23:38 -07:00
Konstantin Shcheglov fc7c531253 CQ. Remove result state from ResolutionTest.
Stop storing the most recently resolved unit in ResolutionTest. Make
test helpers operate on explicit result objects instead, so each
assertion uses the diagnostics, type provider, type system, and
inheritance manager from the result it is checking.

This makes the tests less order-dependent and easier to reason about. A
test can now resolve more than one file or unit without later assertions
implicitly depending on whichever result happened to be stored last. It
also makes helper APIs more local: the data needed by an assertion is
passed directly, rather than recovered from mutable test state.

Update tests to keep the returned result when they need access to the
resolved AST or result-derived utilities. Add convenience accessors on
the result wrappers to preserve common lookup patterns without
reintroducing shared mutable state.

Change-Id: Ib45c52f8fd104b668f9fdd1ec6b1442927cd7e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505920
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-22 13:05:47 -07:00
Brian Wilkerson 739826d041 Update ImportedElementsComputer for primary constructors
This CL is to resolve a TODO. I couldn't find a way to trigger any bugs
in the code, but I did add a test. I believe that the reason I couldn't
trigger a bug is because any constructor that has a null `typeName`
will not have a simple identifier in a place that would allow
`_isConstructorDeclarationReturnType` to be invoked.

I realized, while looking at the code, that the type check is
unnecessary. If the type name is null, then the test will somply return
`false`, which is what we'd expect it to do. Given that it isn't needed,
I decided to remove it.

Change-Id: Ib36aaf16475db0db5817e65a8b8bfbb8aa834dbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505501
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-22 12:53:51 -07:00
Danny Tuppeny c8a74e71ef [analysis_server] Add classes for processing interactive forms
This adds some classes for processing interactive forms (I'm splitting this from the CL that updates refactorings to simplify reviewing).

The `InteractiveForm` class managers a whole form (all fields), and processes a set of fields/answers that come back from the client (which may be the full set, or a subset). It produces a list of the outstanding fields (which need to be go back to the client) as well as maintaining the full set of answers for the master field list (to use as arguments for a command, for example).

I've also commented out enums/lists from the protocol code for now, because I made the field kinds `sealed` so we get exhaustiveness checking in the validation, but want to delay fully implementing those for now.

See https://github.com/dart-lang/sdk/issues/63371

Change-Id: Icc4dcea8c9eab20ffbdd19ebbc69e1285464f7ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505683
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-22 12:44:58 -07:00
kevmoo 1e8a9d5d45 [api_summary] Include mixins in textual API summaries
Fixes an issue where with mixin clauses were omitted when generating textual API summaries for class and interface declarations.

Regenerates api.txt for analyzer and analyzer_plugin.

Change-Id: Ic33d76955cefb31709e265ec4ea9d5df9a065f7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503701
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-22 11:35:09 -07:00
Konstantin Shcheglov 19f0f72d9e CQ. Merge test classes in AssignmentOfDoNotStoreTest and ReturnOfDoNotStoreTest.
We can do this now, with more precise test directory identification.

Change-Id: I690753c9d9676ed0f60cb4c662df04d853180351
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505520
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-22 11:25:50 -07:00
kevmoo 7679be813f [dart2wasm] cleanup owners
Change-Id: I63e9b69a07471641aaf32f7d0cdbbc4cd73877ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/502260
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2026-05-22 11:06:09 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com db8ee607ee Roll Fuchsia SDK from 32.20260514.4.1 to 32.20260521.3.1
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-sdk-dart-sdk
Please CC fuchsia-3p-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Fuchsia SDK: https://bugs.fuchsia.dev/p/fuchsia/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try;luci.dart.try:vm-fuchsia-release-arm64-try
Change-Id: Ic93803fa6aa7dafed6046f0f16bcaf2667cfe8af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505420
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-22 10:43:27 -07:00
Konstantin Shcheglov 57cac82bb6 CQ. Remove ResolutionTest type convenience getters.
Stop exposing common type and element shortcuts from ResolutionTest so
tests use the resolved unit's TypeProvider and library state directly.
This keeps the shared resolution test mixin focused on resolution
utilities instead of duplicating accessors for analyzer internals.

Move the affected flatten coverage out of StaticTypeAnalyzerTest and
into the dedicated built-type tests. This keeps flatten, futureType, and
unionFreeType behavior together in FlattenTypeTest and related test
classes, including coverage for recursive hierarchies and conflicting
Future interfaces.

Update remaining callers to read the library feature set from the
resolved result, and remove assertions that depended on the deleted
ResolutionTest element shortcuts.

Change-Id: I714aec736636500b293b547972a64dc0541172a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505500
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-22 10:38:21 -07:00