Commit Graph

113371 Commits

Author SHA1 Message Date
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
Paul Berry 3fd2becefd Reformat some files owned by the developer experience team.
This will avoid some merge conflicts in a follow-up CL I'm working on
that will enable the lints `unnecessary_type_name_in_constructor` and
`unnecessary_const_in_enum_constructor` (and will fix declarations
accordingly).

Change-Id: Ib8be02dc241732a0eb50727618bb2dda6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505043
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-22 10:33:08 -07:00
Paul Berry 643733b42e [analyzer etc] Add ignores for codegen to prepare for new syntax.
(Part of https://github.com/dart-lang/sdk/issues/63288)

Updates the `CodeGenerator` mixin so that it outputs `ignore_for_file`
comments to ignore the following lints:
- unnecessary_type_name_in_constructor
- unnecessary_ignore
- duplicate_ignore

This mixin is used by the code generators that produce the Dart
wrappers for the analysis server and analyzer plugin wire protocols.

This is a first step towards migrating the packages `analysis_server`,
`analysis_server_client`, and `analyzer_plugin` 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: Ied17e3ea772546675aad48efc324f6f16a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505521
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-22 10:30:17 -07:00
Brian Wilkerson 1e1ecd8b41 Fix code completion before keyword in constructor
This fixes an exeception when code completing before the `new` or
`factory` keyword in a constructor and the type name is not explicitly
used. The exception prevents any suggestions from being returned, so
it's fairly serious.

Change-Id: I2f5028812ee1945ac9635f55953fb800b19a48c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505620
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-22 10:25:06 -07:00
Alexander Markov d7d723327f [modular_aot] Serialization of type parameter declarations in module snapshots
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ia5646ec6e2133a2232ffbbdb4926d94296bcd690
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505522
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-22 10:10:19 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com 7d93f44c17 Roll BoringSSL from f92821595453 to beddb582d9e8 (9 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/f92821595453..beddb582d9e8

2026-05-15 davidben@google.com Expand on infra/config/README.md a bit
2026-05-15 hchao@chromium.org [Server Padding] Don't pad on resumption handshake.
2026-05-15 xfding@google.com build: Do not list .inc as compile unit
2026-05-15 rpolzer@google.com Revert "CI/CQ: in debug builds, enable lots of libc++ checks."
2026-05-15 rpolzer@google.com CI/CQ: in debug builds, enable lots of libc++ checks.
2026-05-15 rpolzer@google.com Minor optimizations to ML-DSA: marking some internal functions inline.
2026-05-14 davidben@google.com Switch STACK_OF(T) back to std::sort from std::stable_sort
2026-05-14 davidben@google.com Use the certificate issuer in CMS/PKCS7 signer IDs
2026-05-14 xfding@google.com rust: bssl-macros: Do not depend on std

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: Ic8802e99ebe5ac7e6495a7a18a78b25e6974b15b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504440
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-05-22 09:44:15 -07:00
Konstantin Shcheglov 809d8a778a CQ. Start removing resolution state from ResolutionTest.
We still have `late ResolvedUnitResultImpl result` for now, but many
tests migrated to explicit `TestResolvedUnitResult` and its getters.

Start migrating analyzer resolution tests away from the implicit
ResolutionTest state. Store the TestResolvedUnitResult returned by
resolve helpers in local variables, then read nodes and elements through
that result.

Update helper methods to take the resolved result explicitly when they
need access to findNode or findElement. Also return resolved results
from small wrapper helpers so their callers do not have to depend on
shared state.

This keeps each test tied to the unit it resolved and prepares the test
harness for removing the remaining stored resolution result.

Change-Id: I5e9331fb574d962473e5d36922107f674d7340cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505621
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-22 09:39:40 -07:00
Konstantin Shcheglov d6c87cc934 Always verify constants in LspEnum.
Change-Id: I4d62eacbf97c5f83e0eab378bc7d239ab934e6b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-22 08:59:05 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com dfa4478902 Roll gn from 068dd892acb2 to e44942b445d9
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-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 gn: https://bugs.chromium.org/p/gn/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:dart-sdk-linux-try;luci.dart.try:dart-sdk-linux-arm64-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: Iafb067fb2d76a298bf3fd30f94e6a8e2d04a0cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505720
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-05-22 08:56:36 -07:00
Lasse R.H. Nielsen 01ee1880aa Fix use of ExperimentalFeature.featureFlag! as feature name.
The `featureFlag` becomes `null` when the feature is expired,
the `featureString` is still available.

Code was added by https://dart-review.googlesource.com/c/sdk/+/470920 .

Change-Id: I5f19718d9431ff409907e82b2849d76415b739bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505440
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-05-22 08:40:52 -07:00
Paul Berry 7df8468b52 Reformat some files in the heap_snapshot package.
This will avoid some merge conflicts in a follow-up CL I'm working on
that will enable the lints `unnecessary_type_name_in_constructor` and
`unnecessary_const_in_enum_constructor` (and will fix declarations
accordingly).

Change-Id: I0a8f660c3c4d722dbeda440009e565f96a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505047
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-05-22 08:37:53 -07:00
Sam Rawlins f46967d5c4 analyzer_testing: Fix some flutter mocks
Fixes https://github.com/dart-lang/sdk/issues/62559

Change-Id: I3866dd488132faf9946ca36fc32f38aa335cce3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-22 08:32:49 -07:00
Danny Tuppeny 5a40aaaecc [analysis_server] Fix isAvailable check for "Remove constructor name" on unnamed constructor invocations
This code was checking the name of the type instead of the name of the constructor.

Fixes https://github.com/Dart-Code/Dart-Code/issues/6061

Change-Id: I180940162aa7ff12e4ec19aa002a188961d7aad5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-22 08:26:51 -07:00
Daco Harkes 70b8a7f49d [dartdev] Invoke build hooks with sanitizer argument
Makes `dart build cli --target-sanitizer` invoke build hooks with the
right sanitizer argument.

Follow up of https://dart-review.googlesource.com/c/sdk/+/504880.

TEST=pkg/dartdev/test/native_assets/build_test.dart

Change-Id: I51a042403f3da10a90a1ebc71b7ebc82207df7d7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505680
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2026-05-22 08:24:45 -07:00
Konstantin Shcheglov 63893e2645 CQ. Remove AnalyzerErrorGroup and AnalyzerError.
Change-Id: I8ca41d616d19330e2a28a895c4bead93e05eb078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505660
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-22 08:12:13 -07:00
Danny Tuppeny fc43f03f67 [analysis_server] Support sealed classes in LSP codegen
This will make it easier to switch() on these fields and ensure we cover them all.

Change-Id: I9078838bb461ea9bdca268857fb8ad327dda2d11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505460
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-22 08:08:35 -07:00
Paul Berry 4b88e5ab0f Bump package:expect version in standalone package tests.
The tests in `tests/standalone/package/` don't use the top level
`package_config.json` file; they use their own internal file, which
apparently hasn't been updated recently. This change bumps the version
of `package:expect` in that file to version 3.13, which will allow
`package:expect` to start using Dart language 3.13 features without
breaking tests.

Change-Id: Ia2975d540aa503e8f69944e0e1c275c56a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505580
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-22 08:04:08 -07:00
Jens Johansen b149fe9587 [CFE] Rename and move things in incremental suite
This only renames and moves procedures.
Attempt to make refactor CL smaller (part 2).

Change-Id: Id46b86f6af09eb8b25ea5c5c20e547dcb65ed2b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505222
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-05-22 07:28:33 -07:00
Jens Johansen 1d863d8ce7 [CFE] Sort incremental suite
This is only sorted via "Dart: Sort Members".
Attempt to make refactor CL smaller (part 1).

Change-Id: Id1ba5669ddb3f9390ab95f8f83a943125ebbd9d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505300
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-05-22 07:17:42 -07:00
Brian Wilkerson 291730c940 Fix the windows bot
The CL https://dart-review.git.corp.google.com/c/sdk/+/505045 broke the
windows bot because the file path is different. It's different by more
than just the path separator, and given that the point of the test isn't
to ensure that the right file path is being printed, I decided to
remove the file path check from the expectations.

Change-Id: Ie5aef4beddb2051c63b2d1686664afb8841297fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505383
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-22 07:00:21 -07:00
Modestas Valauskas 0bef837817 [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>
2026-05-22 05:58:10 -07:00
Simon Binder 3196571c9b [dart2wasm] Move wasm-js interop to dart:_js_interop_wasm
Some features in `dart:_wasm` are relevant for all WebAssembly targets
(like interop types or memory intrinsics). Others, in particular the
helper methods to convert between `WasmExternRef` and `JSAny`, don't
make sense for the standalone target.

To be able to remove the `js_interop` library from the standalone
target, we need to stop importing it from `dart:_wasm`. To prepare that
step, this moves the helpers to a new library (`dart:_js_interop_wasm`)
and re-exports them from `dart:_wasm`.

Once Flutter has migrated to the new import, the export can be removed.

Bug: https://github.com/dart-lang/sdk/issues/63166
Change-Id: I13fe875e509a13d16c48d420a5927d3130b90736
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505080
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Simon Binder <oss@simonbinder.eu>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-05-22 04:06:27 -07:00
Modestas Valauskas 1d61eecafa [vm/compiler] Dedup blocks in WBE worklist.
Generalize DefinitionWorklist into a Worklist<T, E> template and use a
new BlockEntryWorklist (keyed by preorder_number) to drive the WBE
dataflow. The bitvector-backed membership set prevents the same block
from being enqueued many times, which is what caused compile time to
blow up on large generated programs.

Measured on a naive 49 KLOC generated lexer with --huge_method_cutoff
gates lifted and with synchronous compilation: AOT compile drops from
~42s to ~19s.

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

Fixes https://github.com/dart-lang/sdk/issues/63426

TEST=ci

Change-Id: I56c5dc40f534e4b28fe6b608a3b7f49e14957ef7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505461
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-22 03:53:47 -07:00