Commit Graph

113253 Commits

Author SHA1 Message Date
Keerti Parthasarathy c4ce9dbdfd Add a skill for finding obsolete issues in the Analysis Server open issues.
This is an initial commit. Plan to add
- if repro is available, agent to test it out
- add failing tests where possible


Change-Id: I35c63a0e4183b7609643fb7d851f1b25a2025c74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-05-19 08:06:14 -07:00
Sigurd Meldgaard e1c29b6381 Bump pub to ec276d10a7fa0f6c6ec005340fb9ad29f3b012d0
Changes:
```
> git log --format="%C(auto) %h %s" 7440821..ec276d1
 https://dart.googlesource.com/pub.git/+/ec276d10 Remove unintended `-v` flag from binstub template (4821)
 https://dart.googlesource.com/pub.git/+/d5fca3ae Quiet warning instead of stack trace when failing to parse advisories (4817)
 https://dart.googlesource.com/pub.git/+/b5263b3f Separate state for sources (4811)
 https://dart.googlesource.com/pub.git/+/764c4b3e add: when no descriptor given, use descriptor from existing resolution if present (4801)
 https://dart.googlesource.com/pub.git/+/1bceb7ac Bump test from 1.29.0 to 1.31.0 (4799)
 https://dart.googlesource.com/pub.git/+/64f18711 Add dependency constraints natively to `pub deps --json` (4797)
 https://dart.googlesource.com/pub.git/+/5ebb0f11 `outdated` Include replacement text in --json output (4793)
 https://dart.googlesource.com/pub.git/+/c5275713 Avoid flaky replacements when filtering for goldens (4794)
 https://dart.googlesource.com/pub.git/+/2dda3a3e Bump analyzer from 10.0.2 to 10.2.0 (4777)
 https://dart.googlesource.com/pub.git/+/03d73494 Bump source_span from 1.10.1 to 1.10.2 (4753)
 https://dart.googlesource.com/pub.git/+/1ec99bf1 Bump checks from 0.3.0 to 0.3.1 (4618)
 https://dart.googlesource.com/pub.git/+/b00da1e0 Use kernel to compile tests (4795)
 https://dart.googlesource.com/pub.git/+/7bd9ac74 Don't download via the cache in `pub unpack` (4785)
 https://dart.googlesource.com/pub.git/+/72d16f60 Support safe.bareRepository=explicit (4776)

```

Diff: https://dart.googlesource.com/pub.git/+/74408212b5348003381bc63f3b59274aaa23cfa3..ec276d10a7fa0f6c6ec005340fb9ad29f3b012d0/
Change-Id: I4682a8de2bdb2bec8cfabe9e64957bba90ccc2e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504640
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Auto-Submit: Sigurd Meldgaard <sigurdm@google.com>
2026-05-19 07:54:41 -07:00
Ryan Macnak a8419fb546 [build] Fix building the Debian package on Resolute.
dpkg-buildpackage now wants a timestamp in the changelog.

Also remove --git-revision-file and --git-timestamp-file, which were part of the previous way to build Debian packages.

Change-Id: Idbcf418571889ad7588424e6d8ae6e81ec79942b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504280
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-19 07:18:47 -07:00
Ryan Macnak 6613ac694e [infra] Fix wasted parent machine time on vm-mac-{debug,release}-arm64.
A test shard will run on the parent only if the tests are the last step.

Change-Id: Ib251abe84c631330432b1cdd75897cb0f540a6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504281
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
2026-05-19 07:17:52 -07:00
Chloe Stefantsova 10dd51ee4c [cfe] Verify new variables have contexts
Part of https://github.com/dart-lang/sdk/issues/61572

Change-Id: I01295904c8fd5f76574e8979eb40e4cd174f9e09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504202
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2026-05-19 04:29:29 -07:00
Tess Strickland 52cfd29cbb [vm,dynamic_modules] Add RecordCoverage instruction.
The RecordCoverage instruction has an A/E encoding. The A argument
is the type of coverage being recorded, whereas the E argument is
the logical index into the coverage array for updating whether that
source position has been hit.

Also adds new metadata to the bytecode component for the coverage
arrays associated with bytecode containing RecordCoverage instructions
and a new runtime entry for lazily allocate the coverage array for
an interpreted function when needed.

The type of coverage is encoded in the RecordCoverage instruction,
despite being redundant with the information in the coverage array, so that checking whether that type of coverage is currently enabled at
runtime doesn't require either accessing the coverage array (which may
be lazily allocated), forcing allocation of the coverage array just to
discover that type of coverage is currently disabled, or reading the
serialized bytecode component to avoid that forced allocation.

------

Other changes:

Source reporting now treats unexecuted interpreted functions when
not forcing compilation as if they were uncompiled native functions,
so that the source report from running the same code gives the same
result whether using the interpreter or the native compiler.

Bytecode closures are no longer skipped in source reports. Previously
any closure without a context scope was skipped, but bytecode closures
don't have those.

TEST=vm/cc/SourceReport_Coverage

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try
Change-Id: I7557e5dd4c98331c7ca2f5c867dd5f6d03e9d756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501520
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-05-19 04:27:39 -07:00
dependabot[bot] d2b5c1a81e Bump the github-actions group with 2 updates
Closes https://github.com/dart-lang/sdk/pull/63297

GitOrigin-RevId: ad81d11f023ab9dd49b7a67f893631372c29e723
Change-Id: Ib6059e1bb9e73ba0b49d31306f66de8c1892a1a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499900
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2026-05-18 23:59:33 -07:00
Sam Rawlins dffae54f02 linter: Treat index assignment as setter in many lint rules
Work towards https://github.com/dart-lang/sdk/issues/62621

Change-Id: Ic8669042da9b159698849a627f84a050751ffdcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504000
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-18 19:44:41 -07:00
Konstantin Shcheglov 76011f9fe0 Augment. Report augmentationWithoutGetterDeclaration or augmentationWithoutSetterDeclaration.
Add diagnostics for augmenting fields and top-level variables when the
augmentation induces an accessor that has no corresponding declaration
to augment.

Report these errors on each variable name rather than on the augment
keyword, so multi-variable declarations can report missing augmentation
targets independently. Include context pointing to the matching declared
or induced accessor when only one side of the getter/setter pair exists.

Register the getter- and setter-specific diagnostics in the generated
diagnostic tables and correction status metadata.

Change-Id: I78393a6e8bffe8748eb0fbc5182a0d01770771d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-18 18:42:53 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com 86aa98d815 Roll BoringSSL from d03dbc3e5d7d to f92821595453 (3 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/d03dbc3e5d7d..f92821595453

2026-05-14 xfding@google.com crypto/evp: Eliminate `operator delete` from EVP_PKEY_CTX destructor
2026-05-13 davidben@google.com Correctly handle max_early_data_size over 2^16
2026-05-13 chlily@google.com Alert on ClientHello with only one of key_share and supported_groups

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: I5e748b03597a3a48f1d4c1749200d01b5d8a8347
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503640
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2026-05-18 18:23:24 -07:00
Kallen Tu 7ca32bdbbf [migrate] Refactor version bumping from update_sdk_constraints to a util file.
This is a prerequisite CL to the next one that will add version bumping
to the dart migrate tool: https://dart-review.googlesource.com/c/sdk/+/504381

Refactoring the version bumping logic out of `update_sdk_constraints` so
it can be shared between the correction producer and the migrate tool.

`PubspecEdit` also contains the old and new versions so the migrate tool
can refer to those in its summary text.

Bug: https://github.com/dart-lang/sdk/issues/63268
Change-Id: I488cf10694b89df1ed770ee0f27f13a00d1dd3be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504340
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-18 14:40:27 -07:00
Ryan Macnak d36adbacaf [vm] Remove the VM isolate.
The former contents of the VM isolate are now included into each isolate group. This makes each isolate group's heap independent, and in particular allows each heap to be allocated to a separate pointer cage (not done in this CL).

The duplicated stubs that allowed PC relative calls are removed, since the originals can now be the target of PC relative calls.

The bootstrapping needing to load an AppJIT or AppAOT snapshot is reduced to allocating the oddballs. The code is entirely dropped in the AOT runtime, but the JIT runtime still has it to allow for flags to affect the compilation of the stub code. Further refactoring might be able to remove this for the JIT runtime too, with only gen_snapshot knowing how to bootstrap.

Class serialization no longer distinguishes predefined classes.

The page containing null is marked as never-evacuate. null, false and true must not move because the compiler relies on their low bits having certain patterns for some optimizations. (Previously, the entire VM isolate heap never moved.)

Compaction is disabled for IA32. Due to register pressure, some stub calls must not use a scratch register and embed the address of Code.

The page containing the call-through-safepoint stub is frozen when running with --write-protect-code and the stub is created at runtime (instead of loaded from an AppJIT or AppAOT snapshot). This stub must remain executable even during a safepoint, as a foreign call might during return during a safepoint and only block after the stub directs it to the runtime.

The snapshot symbols are renamed to kDartSnapshotData and kDartSnapshotText. There is no need to distinguish the VM isolate's snapshot, and snaphots are per isolate group not per isolate. Aliases with the old names are added to ease migration.

Some global flags that were automatically set based on the VM isolate's snapshot are now isolate group flags and automatically set by the isolate group's snapshot.

TEST=ci
Change-Id: Iee82016057d609112e9b021d178fc3d4d18b5044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500621
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-18 11:35:03 -07:00
Alexander Markov ca9c12f1b6 [modular_aot] Support more cases of parallel moves and double immediates
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I8b167ea819d4247ca748f5200b5509e99a68d56e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503560
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-18 10:10:21 -07:00
Kallen Tu 2edcad4892 [tests] Primary constructors: Format and generate errors for all tests.
Cleaned up and formatted the tests, regenerated some errors where they were "unspecified", and removed the experiment flag enabling in each test.

Bug: https://github.com/dart-lang/sdk/issues/61687
Change-Id: Ic5b652af660cbc4f71731b1547c7a58c7726faca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503500
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2026-05-18 10:00:37 -07:00
Adil Burak Şen a93e065e54 fix: prevent path traversal in sourceMapViewer /file endpoint
Closes https://github.com/dart-lang/sdk/pull/63389

GitOrigin-RevId: 882cfd8dcdbd2d615bd0f7da40d3d83105924fbc
Change-Id: If510820433729765a09c9784f0364bbb52e703c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504020
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2026-05-18 08:42:05 -07:00
Danny Tuppeny 9a48747a61 [analysis_server] Fix hover on enum constant declaration
Fixes https://github.com/dart-lang/sdk/issues/63223

Change-Id: I42c75520ce11932bd1c894783cbfc27ac3c8ebd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504260
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-05-18 08:37:16 -07:00
Konstantin Shcheglov 57eb6d720c CQ. Migrate resolution tests to resolveTestCodeWithDiagnostics. NY.
Change-Id: I715ca29fa7110a2094dca16ce57e8687c392f49f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504080
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-18 08:28:13 -07:00
Konstantin Shcheglov 8a7276fb4d CQ. Migrate resolution tests to resolveTestCodeWithDiagnostics. CD.
Change-Id: I621af89bafde3fc8b3e492482cfe33ece11ad844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503702
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-18 08:27:45 -07:00
Konstantin Shcheglov 948e52a768 Augment. Build accessors induced by variable augmentations.
Property-inducing augmentations were linked to the existing field or
top-level variable element before creating the getter and setter
fragments that the augmentation itself induces. This left augmentation
fragments without their corresponding accessor fragments.

Create induced getter and setter fragments for every field and top-level
variable fragment, including augmentations. When an accessor element
already exists, append the new fragment to it; otherwise, create the
accessor element independently so that augmenting getter-only and
setter-only properties works correctly.

Track the relationship at the fragment level in both directions, from
each property-inducing fragment to its induced accessors and from each
accessor fragment back to its inducing variable. Serialize these links
in summaries, expose them through the analyzer element API, and bump the
summary data version for the format change.

Change-Id: Iede43515564326182d8195bd872abf83345bbd72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-18 08:20:07 -07:00
Alexander Markov 9f3a2222fa [modular_aot] Fix reading nullability of types from module snapshots
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Id2b0504cf4b02ee8a2086e18901f182f2730ba5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503960
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-18 08:19:41 -07:00
Alexander Markov a99020a90b [modular_aot] Revise canBeSmi predicate
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I423814f5ca1ebe57cdcd980a0844e9feaf7e57e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503900
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-18 08:12:02 -07:00
Ryan Macnak 350163cc25 [vm] Per-group callback thunks.
With no VM isolate, the lifetime of the template stub will be the lifetime of the group instead of the VM.

TEST=ci
Change-Id: I4ed2f5e5c6e8f4c92c430898dc38355a227d4057
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500620
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-18 08:11:36 -07:00
Alexander Markov 45503a1a3e [modular_aot] Instance method closurization
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I5e8993936b55c7cb8b581c64fd7ce8a38c9f9ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503682
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-05-18 08:03:55 -07:00
Alexander Markov ccbcd76265 [modular_aot] Records
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ie6ba4148ca9193b5b28de3d90efa7bb55427ef53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498660
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-18 08:03:32 -07:00
Konstantin Shcheglov 5ed538a532 Bug fix: implement missing diagnostic implementsSuperClassConstraint.
It is disabled when augmentations feature is enabled.

This is not a breaking change, because CFE did report this error.

The relevant reason is indirect, not a single sentence saying “on A
implements A is forbidden”.

Spec chain:

1. In dartLangSpec.tex:6019, a mixin declaration is modeled as:

`mixin N<T...> on T1, ..., Tn implements I1, ..., Ik { ... }`

2. In dartLangSpec.tex:6065, the mixin interface M_I is defined as if
by:

`abstract class N<T...> implements T1, ..., Tn, I1, ..., Ik { ... }`

and dartLangSpec.tex:6078 says it is a compile-time error for the mixin
if that synthetic class declaration would be a compile-time error.

3. In dartLangSpec.tex:5189, class superinterfaces say:

It is a compile-time error if two elements in the type list of the
IMPLEMENTS clause of a class C specifies the same type T.

So:

`mixin M on A implements A {}`

is checked like:

`abstract class M implements A, A {}`

which violates the duplicate implements type rule.

Change-Id: I29e5fa17c47d111346ef6a6e321ab5dbab985ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-18 07:55:50 -07:00
Sam Rawlins b8b1e01173 DAS plugins: Fix cmdline where plugin diagnostics are never reported
In the recent change,
https://dart-review.googlesource.com/c/sdk/+/503040, the asynchronous
nature of the change required adding _new_ hooks to track that the
plugin isolate is analyzing or not. I missed removing the old hooks.

The result is that an invocation of `dart analyze` will get a notification from the plugin isolate that it is analyzing, and then
_immediately_ a notification indicating that it is not.

So this change removes the old hooks.

Change-Id: Idc871d25c043ee1be94030729a1fd8226bdc753f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-18 07:55:28 -07:00
Konstantin Shcheglov 13fc97fc6c CQ. Migrate resolution/type_inference tests to resolveTestCodeWithDiagnostics.
Change-Id: I0794a6a56586b54fba8aa049f2c4b4011aac9e92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-18 07:47:46 -07:00
Konstantin Shcheglov 033ba8dca8 CQ. Migrate resolution tests to resolveTestCodeWithDiagnostics. EM.
Change-Id: Ib12b8c4745578c003a5dbc408a4d3081e9ecffde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504060
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-18 07:47:22 -07:00
Brian Wilkerson 069849df14 Update the presubmit script to stop running a removed test
The test was removed in https://dart-review.googlesource.com/c/sdk/+/503620.

Change-Id: I271fbff176816c526d8221e0e8cbd3f52dcfbef8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503666
Reviewed-by: Paul Berry <paulberry@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-05-18 07:13:11 -07:00
Johnni Winther e30cd0322c [cfe][Contexts] Split VariableDeclaration and VariableStatement
This separates VariableDeclaration from Statement. VariableDeclaration no longer implements Statement and variable declared in a block or in a for-statement are now wrapped by a VariableStatement.

Currently there are two VariableStatement implementations; LegacyVariableStatement for variables in the current model, called LegacyVariable, and VariableInitialization for variables used in the new, still experimental, encoding that supports scope computation.

This CL is a step towards realigning the AST nodes to the new model in which each kind of variable has its own distinct subclass. (LocalVariable, PositionalParameter, NamedParameter, SyntheticVariable, etc.)

Note that it is not the intent to use VariableStatement in ForStatement going forward but that will be handled in a follow-up.

TEST=existing.

Change-Id: I5b309cd62c9b138f95b74fb054686edffa49a393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/502681
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2026-05-18 05:49:28 -07:00
Nourhan Hasan 046d473d5e [vm/service]: use a map for service ID zones to avoid ID reuse and unbounded growth (#62205)
Replace the growable array with a hash map so that zones are truly
removed on deletion and IDs are never reused.

TEST=Manually tested with test_zones.dart (IDs increase, map size
toggles); existing service tests pass

Fixes: https://github.com/dart-lang/sdk/issues/62205
Change-Id: I0bbec4a0fc0aef9ed8679a3aa5ce832fea9bfde8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489720
Commit-Queue: Slava Egorov <vegorov@google.com>
Auto-Submit: Nourhan Hasan <nourhan.m.hasan@gmail.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2026-05-18 03:57:44 -07:00
Modestas Valauskas ace4bb1ad6 [benchmarks] Add BitArray benchmark
Adds a benchmark exercising int.oneBitCount and int.trailingZeroBitCount
(landed in CL 498041) and a representative set of Int32x4 SIMD bitwise
kernels, through a small bit-array implementation built on a Uint32List
word store.

Kernels:
- cardinality: popcount across the array.
- forEachSetBit: Brian-Kernighan iteration via ctz.
- select(k): position of the k-th set bit using popcount + ctz.
- complementCardinality: popcount of bitwise-NOT per word.
- totalBitLength: sum of int.bitLength per word.
- intersection / union / xor / difference: pair-op bitwise kernels using
  Int32x4 SIMD with a scalar tail.
- complement: single-input bitwise NOT via Int32x4 XOR-with-all-ones.

Each kernel has a Swar baseline using portable bit-twiddle code and an
Accelerated variant that uses the new int getters or Int32x4 SIMD, so
the speedup attributable to the hardware/intrinsic path is visible
directly. main() first runs a correctness check that asserts both
implementations agree across a representative range of sizes and bit
densities, then reports timings via the standard BenchmarkBase harness.

Work towards https://github.com/dart-lang/sdk/issues/1053 (efficient
BitSet implementation).

Bug: https://github.com/dart-lang/sdk/issues/52673
Change-Id: I5ae5bc0b9d07f6de3e11907ac1fae80f02e77119
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503020
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-18 03:21:30 -07:00
Tess Strickland 181f581345 [vm,dyn_modules] Drop initializing formals/wildcards from local vars info.
Also don't emit source positions for every StoreFieldTOS instruction,
instead explicitly emit them where appropriate in the BytecodeGenerator.

TEST=co19/VM/primary_constructors_t07

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

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: Ic34cd27ca57791e8bd69c0e46e3777bfe5dcfe27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503340
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2026-05-18 03:13:30 -07:00
Martin Kustermann 5ae8a02eec [dart2wasm/infra] Add dart2wasm-linux-mac builder to tools/bots/test_matrix.json
The configuration was already added long ago in [0]

[0] https://dart-review.googlesource.com/c/sdk/+/426461

Change-Id: If78a1d40311bda1ed3d2c1325cbc3063685ab9c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501501
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-05-18 01:26:32 -07:00
Konstantin Shcheglov 6c76594af1 Augment. Skip field augmentations when checking for duplicate members.
Treat field fragments marked as augmentations like other augmented
members when collecting local member names. Do not add their getter and
setter fragments to the instance or static duplicate scopes, because
they augment existing declarations rather than introduce new local
members.

This avoids secondary duplicateDefinition and conflicting member
diagnostics when a field augmentation targets an existing declaration.
Non-augmenting declarations in augmentation blocks are still checked as
new declarations, so real duplicates continue to be reported.

We don't have yet checks for completed getter / setter from fields and
variables, so tests miss several errors.

Change-Id: I6901aea1770891917c966c11b59cb647aaf4ed86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503840
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-16 07:53:18 -07:00
Sam Rawlins d12a4095a4 linter: flutter_style_todos: add test for multiple series of slashes
Fixes https://github.com/dart-lang/sdk/issues/59342

Change-Id: Ia633769c51131ca1cb258826cc6cddbebc85253f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2026-05-15 18:25:40 -07:00
Parker Lougheed 5883c3559a [changelog] Clean up and fixes for 3.12 and 3.13 entries
Change-Id: Ib065e2abf76f36cc9223edbb01c613eeea0a7083
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503920
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2026-05-15 16:50:03 -07:00
Sam Rawlins 8f07aef955 linter: always_specify_types: add test with type parameter with bound
Fixes https://github.com/dart-lang/sdk/issues/57665

Change-Id: Idced0de7de239de8f46712dc8d48025caa88a7a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503621
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-15 11:36:25 -07:00
Ben Konyi 0aa709e8cc [dds] Update expected DevTools title in path strategy test
DevTools recently updated their index.html to include "The Flutter Authors" in the copyright header instead of "Dart DevTools" in the body. This updates the test expectation to match.

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

TEST=pkg/dds/test/devtools_server/devtools_server_path_strategy_test.dart

Fixed: 63375
Change-Id: I83b8fc4101501ffbbf1e3a84ca797c7b18c0d9b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503820
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-05-15 10:32:53 -07:00
Konstantin Shcheglov 7b4ca03c82 CQ. Migrate resolution tests to resolveTestCodeWithDiagnostics. AB.
Change-Id: I7aaed1e340ab7a3086f1b5ca78019b811e06c56e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503720
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-15 09:33:46 -07:00
Keerti Parthasarathy 98c3699f32 Add test for inlining a getter.
This test confirms that https://github.com/dart-lang/sdk/issues/45997 is fixed.

Change-Id: Iafdd8be922a770d2bc11260a94237845df336d4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503660
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-15 09:28:17 -07:00
Keerti Parthasarathy 001a3ba29b [data-driven]Support for replacing a deprecated library.
Bug: https://github.com/dart-lang/sdk/issues/62849


Change-Id: I2eb323319264ded024acf3b3ede2460eae974a83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-05-15 08:55:14 -07:00
Paul Berry aaa48e2247 [deps] Roll prebuilt Dart SDK to 3.13.0-103.1.beta.
This will allow use of Dart 3.13 features (such as primary
constructors) within the SDK itself.

Note that some generated files required benign updates due to
formatter behavior changes.

Change-Id: I595554e9cff3dbaa3f11da407d6c26036a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503662
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-15 08:23:09 -07:00
Konstantin Shcheglov 56706b715d Augment. Report incomplete augmented executable declarations.
Report new diagnostics when an introductory function, member, or factory
constructor is still incomplete after applying all augmentations.

Keep the existing missing-body diagnostics for declarations that have no
augmentations, but report augmentation-specific diagnostics when an
augmentation chain exists and none of the fragments provides a body or
factory redirection.

Move the checks into error verification so that extension and extension
type members can participate in augmentation completion before reporting
the existing abstract-member diagnostics. Also suppress the
corresponding shared parser diagnostic when it is reported by the
verifier.

Consolidate body-related tests by declaration shape instead of by
individual diagnostic. This keeps missing bodies, external bodies,
augmentation completion, and already-complete checks side by side,
making the interaction between these rules easier to review and extend.

Move the constructorAlreadyComplete coverage from its dedicated test
file into constructor_body_test.dart, and add the factory body
completeness cases there as well. Add executable_body_test.dart for
function and member body coverage, including top-level declarations,
static members, extension members, and extension type members.

Add diagnostic definitions and fix-status entries for the new
diagnostics.

Change-Id: I9ee803c1e767ff47a608c86413ef7ffc71518cfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503540
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-14 15:08:39 -07:00
Sam Rawlins 433b4fa3c8 analyzer: Consider "Immutable" annotations the same as "immutable"
Fixes https://github.com/dart-lang/sdk/issues/57670

Change-Id: I5a9ecd153c4e4de21e00860a7743f946096b0849
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503680
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-05-14 13:36:58 -07:00
Konstantin Shcheglov 61a266f8dc CQ. Index and search '// [diag.fooBar]' inside analyzer tests.
Teach the analysis index and referenced-name computation to recognize
`// [diag.foo]` expectation comments embedded in string literals in
analyzer tests. Resolve `foo` through the analyzer diagnostic library
and record it as a qualified reference to the diagnostic variable.

This lets reference search find diagnostics that are used only in test
expectation strings, when developing analyzer itself.

Change-Id: I91fa020ccd2cfe49fa6e890c8f6796a5b8ca4d1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-14 12:59:18 -07:00
Brian Wilkerson a667cde7c1 Add a fix for initialize_in_field_declaration
The correction producer implements a fix. Pending discussion we might
choose to extend it to produce an assist, either in addition to the fix
(if we keep the lint) or instead of a fix (if we drop the lint).
Whatever we choose, I'd like to do that in a separate CL because I want
this to be available for testing purposes as soon as possible.

Change-Id: Icdd17ba0130149fc785c196be69e9ef990529800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503520
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-14 12:11:59 -07:00
Sam Rawlins f35be6757d analyzer: Remove unused imports
I'm honestly unsure why this is not reported by my IDE, or CI. But it
is reported internally in Google. I'm sure it has to do with the SDK
starting to add some extension methods in the core libs, which were
previously only available in package:collection. But this is still safe,
as analyzer's minimum SDK is Dart 3.11.0.

Change-Id: Ibbb0078e463df03b31749296e1d2f474afb183ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503582
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-14 11:40:36 -07:00
FMorschel 058b623fb7 [analyzer] Adds warning for missng await in return in try block
Bug: https://github.com/dart-lang/sdk/issues/62555
Change-Id: Ic152d89e94739aefd79f71972691722d4cdd0946
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486920
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: FMorschel <git@fmorschel.dev>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-05-14 10:23:47 -07:00
Sam Rawlins cbd61d792e DAS plugins: Make better use of the analysis driver
Fixes https://github.com/dart-lang/sdk/issues/62649

This change overhauls what the PluginServer does when it receives requests from DAS like watch events, overlay changes, setting context roots, and setting priority files, to use the AnalysisDriver APIs. These APIs provide a much smarter, more fine-grained mechanism for determining which files need to be re-analyzed.

This requires a lot of changes that really don't seem obvious (or just,
to me, they are not intuitive), because they relate to Streams being
processed, drained, read, etc. So I'll summarize as much as I can:

* In order to track that results coming from AnalysisDriver are
  definitely for the same AnalysisSession we are concerned with, at
  any given time, we add `_filesBeingAnalyzed` and
  `_filesBeingResolved`. These two maps are cleared any time the plugin
  isolate is notified of changes, so there is not a memory concern.
* We add a `waitForIdle` method which is just used by tests
  occasionally, in order to ensure analysis is complete.
* We tackle a related bug mentioned in the issue thread regarding
  adding or removing overlays without changing the source contents.
  There are now a few checks that old-content is not equal to
  new-content.
* Due to the more async nature of reading events off of the analysis
  driver, we have to be more particular in tests about sending
  `AnalysisSetContextRootsParams` and reading from the notification
  stream, so there are a lot of changes in tests to re-position these
  calls.

This results in massive savings in re-analysis time. Using the example in https://github.com/dart-lang/sdk/issues/62649, typing in the
`build_runner/lib/src/logging/build_log_logger.dart` file, I see the
following:

* Before this fix, every keystroke results in 183 files being
  re-analyzed by the plugin (always 183).
* After this fix:
  * keystrokes that do not result in a summary change (or maybe
    fine-grained deps analysis), like whitespace, results in 1 file
    being re-analyzed (the file I'm editing).
  * A keystroke that results in slightly changed summary, like changing
    an import to something invalid, results 2 or 4 files being
    re-analyzed.
  * A keystroke that changes the name of class BuildLogLogger (large
    change to summary) results in 9-10 files being re-analyzed.

Change-Id: Ie35053b0d90457b5b4b53bc8803188def0308d2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-14 09:57:59 -07:00