Commit Graph

108649 Commits

Author SHA1 Message Date
asiva 6fcb3d394e Fix for https://github.com/dart-lang/sdk/issues/61206
Ensure Platform.executable is not resolved.

TEST=new test case added

Bug: 61206
Change-Id: I0522869f57d519168542b453dc2e827d9d5e6486
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442942
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2025-08-01 11:11:18 -07:00
Nate Biggs aa8f15fe48 [dart2wasm] Reland br_table change.
Dedupes all the logic that was being copied between the int and enum case by adding helpers into the BrTableInfo class.

Reverts: https://dart-review.googlesource.com/c/sdk/+/443082?tab=comments
Fixes: https://github.com/dart-lang/sdk/issues/61223

Change-Id: I861d4b878059d9c633789ce1a09e0e69a2ad925f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443220
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-08-01 10:10:05 -07:00
Konstantin Shcheglov e21caf82b3 Fine. Move loadBundle() out of load(), tweaks for logging and measuring.
We use performance operations now for better instrumentation, and
detailed logging does not seem useful to me.

Change-Id: I87a16a8de37ec3696cc33f981007569ee67c491a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443184
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-08-01 09:28:09 -07:00
FMorschel 61b1447705 [DAS] Fixes "Add await" quick-fix offset bug and "Add async" false-positive
Fixes: https://github.com/dart-lang/sdk/issues/61086
Change-Id: Ie405a4a0182b51c5b92cc07b289c719344b2c18a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442509
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-08-01 09:18:41 -07:00
Konstantin Shcheglov 16abf9565d Fine. Move 'withFineDependencies' flag into instance fields.
Using global flag did not give me enough confidence anymore.

Change-Id: I079b2b05bd7c16f853512a9d023518fc380940a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443145
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-08-01 09:13:26 -07:00
Konstantin Shcheglov 6311478193 Elements. Add documentationComment and metadata to Element and Fragment.
Bug: https://github.com/dart-lang/sdk/issues/61216
Change-Id: I46ee0dfe2a720d61b3b4576634cf623b8817d0ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443149
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-08-01 09:04:47 -07:00
Fedor Shcheglov 64875e4944 Add generators for RuleVisitorRegistry, and RuleVisitorRegistryImpl
To see what changed in generated versions, compare base vs PS4.

Change-Id: If37a0e10b1ff581b739527964bbd10d1601f9138
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443186
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-08-01 08:56:40 -07:00
Ben Konyi 2550dadaa2 [ dart:io ] Breaking change: mark IOOverrides as abstract base
Fixes https://github.com/dart-lang/sdk/issues/56468

CoreLibraryReviewExempt: Only impacts dart:io
Change-Id: I529ac7bbb50640cb1a0fba967cf0bcc6e3bb52aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389520
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2025-08-01 08:19:40 -07:00
Lasse R.H. Nielsen 15973032fb Make VM int parsing not use static global non-constant tables.
In anticipation of isolate-group code execution.

While there, made it skip leading zeros before doing length-based
choices for parsing.

Tested: Refactoring, not change in behavior.
Bug: https://dartbug.com/61030
Change-Id: I4b27b3b85b263c67fe0066eff85172a20f0fed5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442680
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-08-01 05:33:34 -07:00
Martin Kustermann db36ab27f6 [dart2wasm] Make pkg/dart2wasm/tool/run_benchmark work on MacOS
It seems `realpath` isn't available on stock MacOS always (and
may require `homebrew install coreutils`). So we switch to using
a custom version.

Closes https://github.com/dart-lang/sdk/issues/61226

Change-Id: I8f9fe990346a0d8b93903b02688b704273212ee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443260
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-08-01 02:01:14 -07:00
Alexander Aprelev fc16a52f2d [vm/shared] Replace static final _emptyList with getter.
static final _emptyList can't be used in isolategroup mutator code, so the code that uses lists didn't work in that setting neither.
Having natively-implemented _emptyList getter fixes this issue.

TEST=run_isolate_group_run_test

Change-Id: Iad422231829d1dc0994863632521f50f2f8247ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443146
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-07-31 18:03:22 -07:00
Brian Wilkerson a483a5a261 Add imports to the summary produced by the server
This only includes the imports from the first fragment. We'll eventually
need to decide what to do about imports in part files, preferably before
that feature has shipped, but the lack of support won't impact users
today.

Change-Id: Ia38149f619dc22085ed02a90892e0af13eb188dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443143
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-07-31 17:40:09 -07:00
FMorschel ebed8dd0e7 [DAS] Fixes todo of using computeSuggestions instead of addTestFile
Change-Id: I5acd99d8a6e27d65db77f69d88f2610f3503679e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442726
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-07-31 15:48:01 -07:00
Sam Rawlins c1c62259e7 DAS plugins: Support configurable severity
This introduces a concept of a "configured severity," based on the
design at https://github.com/dart-lang/sdk/issues/57034, such that
an analysis rule can be configured in analysis options to be one of:
"disable," "enable," "info," "warning," or "error."

We actually don't have any validation of what is inside a plugin
section in analysis options; that should come next.

Closes https://github.com/dart-lang/sdk/issues/59644

Change-Id: I56f1f51ef01adee7e6c042d8df9a974e7e5a11a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-07-31 15:07:24 -07:00
Sam Rawlins 0ffd2849e4 analyzer: Move analysis options-validating code out of "task"
* OptionsValidator was defined in the `src/plugin/` directory (the only
  file in there), which I found confusing. Moved it to
  `src/analysis_options/`.
* OptionsFileValidator, and a few related classes, were defined in the
  `src/task/` (the last file in there!), so I moved it to the same
  place.

There is more to tidy in here, but this is a simple file-move.

Change-Id: I8f4c5cc0ae4e76eb6c17249457c50ab69c82590d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443147
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-07-31 15:05:31 -07:00
FMorschel 1dffc4a24c [DAS] Fixes nested pattern keyword completion
Fixes: https://github.com/dart-lang/sdk/issues/60917
Change-Id: I711dd50383f73f5a59eea5ebf659dcef72e3c76f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435400
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-07-31 14:11:31 -07:00
FMorschel 70b691ebad [DAS] Fixes Wrap in unawaited quick-fix for nullable futures
Fixes: https://github.com/dart-lang/sdk/issues/61144
Change-Id: Ib9e2e80295fe92e258f923aa959818f639329728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442508
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-07-31 14:10:28 -07:00
Fedor Shcheglov a520e1fc0c Re-add special case for FunctionDeclaration visitor to generator.
Bug: https://github.com/dart-lang/sdk/issues/61224

Change-Id: I9cac55b5aa9c30f46875b057749368aca37571ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443181
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-07-31 13:41:21 -07:00
Kallen Tu 4e432bd60c [analysis_server] Dot shorthands: Update CreateMethod fix.
Refactored `CreateMethod` to handle both method invocations and dot shorthand invocations. The code overlaps so a lot of the CL is just re-organizing them into helpers.

Added unit tests.

Bug: https://github.com/dart-lang/sdk/issues/60994
Change-Id: Ie06005b67f0fe5f066ab57a2f0dbc06095597897
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442729
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-07-31 13:09:32 -07:00
FMorschel 6a534c662a [DAS] Fixes when clause cases on 'Convert to switch expression' assist
Fixes: https://github.com/dart-lang/sdk/issues/60966
Change-Id: I68187c06528f7328a832bdb6d11170f233ab5e2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-07-31 13:01:38 -07:00
Stephen Adams fdc6829891 Test for #61222
Bug: #61222
Change-Id: I589c5f804bb24fe0c2983e637ba6e40422a194c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442941
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-07-31 12:23:29 -07:00
FMorschel 10569cbcd0 [DAS] Adds fixes for required named parameters
Bug: https://github.com/dart-lang/sdk/issues/53707
Fixes: https://github.com/dart-lang/sdk/issues/60783

Change-Id: I62646bd1ac5805fb9030eda712064ec7d8c253b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422369
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-07-31 11:03:47 -07:00
Martin Kustermann b2766ec981 [dart2wasm] Add self-compile dart2wasm benchmark.
We make the core of dart2wasm independent of dart:io and add a
`pkg/dart2wasm/benchmark/self_compile_benchmark.dart` file.

We can compile it with

  * `dart compile exe` and measure
  * `dart compile wasm` and masure on various JS engines

The current results (assuming I measured correctly) are:

            | Time | Memory
    -----------------------
    VM AOT  |  32s | 0.8 GB
    -----------------------
    D8      |  32s | 1.3 GB
    ----------------------
    JSShell |  87s | 2.8 GB
    -----------------------
    JSC     |  70s | 4.4 GB

Measured via something like
```
% dart compile exe -o selfcompile.exe \
    pkg/dart2wasm/benchmark/self_compile_benchmark.dart
% dart compile wasm --no-minify --no-strip-wasm -O2 \
    -o selfcompile.wasm \
    pkg/dart2wasm/benchmark/self_compile_benchmark.dart

% alias measure="/usr/bin/time -f '%M peak KB, %e seconds'"

% measure ./selfcompile.exe
% measure pkg/dart2wasm/tool/run_benchmark --d8 selfcompile.wasm
% measure pkg/dart2wasm/tool/run_benchmark --jsc selfcompile.wasm
% measure pkg/dart2wasm/tool/run_benchmark --jsshell selfcompile.wasm
```

The added test can be run via
```
% python3 tools/test.py -n unittest-mac pkg/dart2wasm/test/self_compile_test
...
```

Change-Id: I9a3eeb5e8a7867f0e3ec7729cec57f10da221ae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442860
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-07-31 10:01:01 -07:00
asiva d417da5ed5 [VM/Runtime] Cleanup TimelineEventArgument state when it is reused so that there is no stale state when TimelineEventArgument::Free is called.
TEST=ci

Change-Id: Ia7d7712a4e014b5a330477eac88a61521c19ca25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310777
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-07-31 09:26:40 -07:00
Daco Harkes 6d53c630f7 [deps] Roll dart-lang/native
Change-Id: I6df10c98c0e47ced4716d587b674900e6fcccb0b
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443120
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2025-07-31 09:16:45 -07:00
FMorschel 1215f53586 [DAS] Adds tests for go-to-import at extension override members
Bug: https://github.com/dart-lang/sdk/issues/61200
Change-Id: Ie775682a6a5bd72b03cd722944137e29cdaecddc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443004
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-07-31 07:47:57 -07:00
Tess Strickland 7b70797304 [dartdev] Limit signed executable check in compile_test to ARM64 macOS.
On X64, executables are not required to be signed, and we only sign the
appended executable if the original dartaotruntime used for appending
was signed.

TEST=pkg/dartdev/test/commands/compile_test

Issue: https://github.com/dart-lang/sdk/issues/55455
Change-Id: Iec8f866423a76b93bb3a3cb9befce009bbdc78ef
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-arm64-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443100
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2025-07-31 06:56:00 -07:00
Martin Kustermann 21f7ffc699 [dart2wasm] Revert switch-case optimizations that introduced a bug.
This reverts commit b65435017d
  This reverts commit 2254755d65

The switch-case optimizations introduced a bug that is surfaced when
running the dart2wasm self-compilation test in [0]. With that test
running

```
% python3 tools/test.py -n unittest-mac pkg/dart2wasm/test/self_compile_test
```
will fail with
```
...
Exception in StaticInvocation at file:///FakeSdkRoot/sdk/lib/_internal/wasm/lib/boxed_double.dart:346:29
Bad state: Unhandled WasmArray intrinsic: StaticIntrinsic.wasmArrayIndex
    at module0.Error._throwWithCurrentStackTrace (wasm://wasm/module0-0121906a:wasm-function[160]:0xd0d76)
    at module0.AstCodeGenerator.visitStaticInvocation (checked entry) (wasm://wasm/module0-0121906a:wasm-function[6304]:0x1668e5)
    at module0._TreeVisitor1Default&Object&TreeVisitor1DefaultMixin&ExpressionVisitor1DefaultMixin.visitStaticInvocation (checked entry) (wasm://wasm/module0-0121906a:wasm-function[6306]:0x167b61)
    at module0.StaticInvocation.accept1 (wasm://wasm/module0-0121906a:wasm-function[6297]:0x165f5f)
    at module0.AstCodeGenerator.translateExpression (wasm://wasm/module0-0121906a:wasm-function[1742]:0xfcd1b)
    at module0.AstCodeGenerator.visitEqualsCall (checked entry) (wasm://wasm/module0-0121906a:wasm-function[6960]:0x1777e4)
    at module0.EqualsCall.accept1 (wasm://wasm/module0-0121906a:wasm-function[6944]:0x1773b4)
    at module0.AstCodeGenerator.translateExpression (wasm://wasm/module0-0121906a:wasm-function[1742]:0xfcd1b)
/Users/kustermann/src/dart-sdk/sdk/pkg/dart2wasm/bin/run_wasm.js:346: [object WebAssembly.Exception]
```

The switch-case in the intrinsifier seems to be miscompiled.

Change-Id: I3bfe8887fa133573379c32d52e15769a4e6db43e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443082
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-07-31 06:13:38 -07:00
Jens Johansen bd0fa88e0b [parser] Inline first part of _tryRewriteNewToIdentifier
pkg/analyzer/lib/src/dart/ast/ast.dart:

JIT (tokens per microsecond):
1.3425% +/- 1.0526% (0.33 +/- 0.26) (24.64 -> 24.98)

AOT (tokens per microsecond):
1.1587% +/- 0.7860% (0.38 +/- 0.26) (32.45 -> 32.83)

Benchmarker (AOT):
```
instructions:u: -1.9853% +/- 0.0000% (-439384607.18 +/- 518.28) (22131742462.46 -> 21692357855.28)
```

pkg/front_end/lib/src/type_inference/inference_visitor.dart:

JIT (tokens per microsecond):
1.4245% +/- 0.7653% (0.28 +/- 0.15) (19.90 -> 20.18)

AOT (tokens per microsecond):
1.7105% +/- 0.8890% (0.45 +/- 0.23) (26.25 -> 26.70)

Benchmarker (AOT):
```
msec task-clock:u: -1.3071% +/- 0.8717% (-30.64 +/- 20.44) (2344.53 -> 2313.89)

page-faults:u: -0.0097% +/- 0.0084% (-0.96 +/- 0.84) (9945.42 -> 9944.46)
cycles:u: -1.4071% +/- 0.8701% (-143026423.34 +/- 88437058.62) (10164329405.06 -> 10021302981.72)
instructions:u: -2.2650% +/- 0.0000% (-488077498.12 +/- 960.50) (21548947043.38 -> 21060869545.26)
branch-misses:u: -3.7824% +/- 3.3800% (-1316798.12 +/- 1176704.41) (34813893.88 -> 33497095.76)
seconds time elapsed: -1.3039% +/- 0.8711% (-0.03 +/- 0.02) (2.35 -> 2.32)
seconds user: -1.3918% +/- 0.8962% (-0.03 +/- 0.02) (2.32 -> 2.29)
```
Change-Id: Ide847121b70db8564f1ea7f9d77ea5d63da1d6ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443081
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-07-31 05:44:50 -07:00
Jens Johansen d337376f5c [parser] Cheaper recovery for List<Foo>[ and Map<Foo, Bar>{}
Recovery for erroneous literals like `Map<int, int>{}` was added in
https://dart-review.googlesource.com/c/sdk/+/190022. This CL makes it
cheaper.

pkg/analyzer/lib/src/dart/ast/ast.dart:

JIT (tokens per microsecond):
No change.

AOT (tokens per microsecond):
7.9552% +/- 2.1091% (2.41 +/- 0.64) (30.27 -> 32.67)

Benchmarker (AOT):
```
msec task-clock:u: -2.1591% +/- 0.8194% (-55.46 +/- 21.05) (2568.82 -> 2513.36)
page-faults:u: 0.2247% +/- 0.0145% (23.00 +/- 1.49) (10235.92 -> 10258.92)
cycles:u: -2.2243% +/- 0.8087% (-248083632.76 +/- 90197190.45) (11153502206.48 -> 10905418573.72)
instructions:u: -3.6023% +/- 0.0000% (-827054283.92 +/- 721.20) (22958796659.48 -> 22131742375.56)
seconds time elapsed: -2.1582% +/- 0.8241% (-0.06 +/- 0.02) (2.57 -> 2.51)
seconds user: -2.2825% +/- 0.8882% (-0.06 +/- 0.02) (2.55 -> 2.49)
```

pkg/front_end/lib/src/type_inference/inference_visitor.dart:

JIT (tokens per microsecond):
4.3711% +/- 1.3011% (0.84 +/- 0.25) (19.11 -> 19.94)

AOT (tokens per microsecond):
5.3025% +/- 1.0032% (1.32 +/- 0.25) (24.95 -> 26.27)

Benchmarker (AOT):
```
msec task-clock:u: -4.2295% +/- 1.0942% (-104.20 +/- 26.96) (2463.65 -> 2359.45)
page-faults:u: 0.0773% +/- 0.0141% (7.68 +/- 1.40) (9937.76 -> 9945.44)
cycles:u: -4.3497% +/- 1.0959% (-465492322.32 +/- 117280203.19) (10701783151.44 -> 10236290829.12)
instructions:u: -5.0470% +/- 0.0000% (-1145391707.84 +/- 802.85) (22694337726.36 -> 21548946018.52)
seconds time elapsed: -4.2224% +/- 1.0991% (-0.10 +/- 0.03) (2.47 -> 2.36)
seconds user: -4.2597% +/- 1.1024% (-0.10 +/- 0.03) (2.44 -> 2.34)
```
Change-Id: I77b865c455d80557646b77921f0b808383c67bdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443060
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-07-31 04:22:31 -07:00
Tess Strickland 77850b7ae1 [dartdev] Remove signed dartaotruntime test.
Now that more of dartdev (e.g., generating kernel) uses dartaotruntime,
modifying the built dartaotruntime with a adhoc non-linker-signed
signature causes this test and other tests following it to fail.

Instead, remove this test and just check that the binary generated
by `dart compile exe` is signed on MacOS.

TEST=pkg/dartdev/test/commands/compile_test

Fixes: https://github.com/dart-lang/sdk/issues/55455
Change-Id: If8f645aeccac617a550db7740343327ca8cd1e4a
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442840
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-07-31 04:06:52 -07:00
Martin Kustermann 8f3da55410 [deps] Roll flute to newer version
Change-Id: I1eb96c822f64770bc3ec7ab3c7eba53ac3fcb718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443040
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-07-31 03:57:01 -07:00
Devon Carew 3d0ec7e450 Bump protobuf to 44ecd7424fa0a9e023ecac0d894f50926ed111cf
Changes:
```
> git log --format="%C(auto) %h %s" 4916e6f..44ecd74
 https://dart.googlesource.com/protobuf.git/+/44ecd74 Sync JSON web decoders (1028)
 https://dart.googlesource.com/protobuf.git/+/f7f65d4 CI: Also run plugin tests on Chrome, with dart2js and dart2wasm (1031)
 https://dart.googlesource.com/protobuf.git/+/048fdc5 CI: Run all of the checks on every change (1032)
 https://dart.googlesource.com/protobuf.git/+/33b782f Remove monorepo (1030)
 https://dart.googlesource.com/protobuf.git/+/4c842a7 Make PbFieldType members public (1027)
 https://dart.googlesource.com/protobuf.git/+/7f7d776 Split protobuf package into libraries (1026)

```

Diff: https://dart.googlesource.com/protobuf.git/+/4916e6f7d34443869c27d997749d4362870fd7ce..44ecd7424fa0a9e023ecac0d894f50926ed111cf/
Tested: test expectations updated for the new protobuf version
Change-Id: I85adf2631f171545394e429b174007c26ec52340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442920
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-07-31 02:15:59 -07:00
Johnni Winther 9404899248 [parser] Split handleEndingBinaryExpression into handleDotAccess and handleCascadeAccess
This splits handleEndingBinaryExpression into two new listeners handleDotAccess for `.` and `?.` access and handleCascadeAccess for `..` and `?..`, both with an explicit `isNullAware` flag.

This is a step towards handling `a.b` different from `a + b` in the parser such that listeners don't have to create a value for `b` the works in both use cases; in the first is just a named operation performed on the receiver, whereas in the second case it is a full expression in its own right.

Change-Id: I04ec80401f8f2dbb8dffa86543c434e530b18cf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442821
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2025-07-31 02:02:28 -07:00
Jens Johansen dfba8a7ca9 [CFE] Remove more allocation from iterators
These are from `_Array.iterator` whereas the previous ones was from,
iirc, `List.iterator`.

* 7.41mb Import.finalizeImports
* 1.13mb FindTypeVisitor.visitInterfaceType
* 856.39kb new NamedTypeBuilderImpl
* 815.92kb BodyBuilder.createSuperParametersAsArguments

(values from uprobe)

When compiling the CFE with the CFE I get this:

```
msec task-clock:u: -5.6347% +/- 0.5257% (-321.96 +/- 30.04) (5713.89 -> 5391.92)
page-faults:u: 5.9842% +/- 0.0970% (6310.26 +/- 102.33) (105449.48 -> 111759.74)
cycles:u: -6.0829% +/- 0.5338% (-1447602857.06 +/- 127036484.81) (23797839542.02 -> 22350236684.96)
instructions:u: -4.9550% +/- 0.0008% (-1364113249.40 +/- 214444.14) (27529935457.16 -> 26165822207.76)
branch-misses:u: -5.7909% +/- 2.2880% (-5395643.76 +/- 2131857.44) (93173948.12 -> 87778304.36)
seconds time elapsed: -5.6275% +/- 0.5257% (-0.32 +/- 0.03) (5.72 -> 5.40)
seconds user: -6.0582% +/- 0.5861% (-0.33 +/- 0.03) (5.47 -> 5.13)
Scavenge(   new space) goes from 63 to 61
Evacuate(store buffer) goes from 2 to 3
MarkSweep(   old space) goes from 1 to 0
```

As before the changes here are mostly "bogus" and likely caused by the
GC being weird, see also
https://dart-review.googlesource.com/c/sdk/+/438722 and
https://dart-review.googlesource.com/c/sdk/+/438681.

It does seem to consistently change the number of new space GCs though
(65 -> 63 -> (here) 61).

Change-Id: I18ef712394c1d98b8ed15c7fe6c4ac32fa9bc2e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438682
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-07-31 01:52:02 -07:00
LYK f3d278ba81 [docs] Change the output path on macOS
R=athom@google.com

Change-Id: I7a4c65e651b88f7882eba9512adbe4e14b3fdefd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442900
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Michael Goderbauer <goderbauer@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
Auto-Submit: Leonardo YongUk Kim <dalinaum@gmail.com>
2025-07-31 01:06:36 -07:00
Jens Johansen 04096b9891 [parser] Shortcut more common cases in parseArgumentsRest
A few more common cases: "<identifier> <period> <identifier> <comma>",
"<identifier> <period> <identifier> <end parens>", "<string> <comma">
and "<string> <end parens>".

pkg/analyzer/lib/src/dart/ast/ast.dart:

JIT (tokens per microsecond):
4.8482% +/- 1.4622% (1.11 +/- 0.34) (22.92 -> 24.03)

AOT (tokens per microsecond):
4.5974% +/- 1.6421% (1.40 +/- 0.50) (30.53 -> 31.94)

Benchmarker (AOT):
```
msec task-clock:u: -4.7108% +/- 2.0520% (-124.92 +/- 54.41) (2651.72 -> 2526.80)
cycles:u: -4.7512% +/- 2.0346% (-546787446.10 +/- 234152251.09) (11508497283.00 -> 10961709836.90)
instructions:u: -4.5849% +/- 0.0000% (-1115885935.90 +/- 1109.34) (24338242436.20 -> 23222356500.30)
seconds time elapsed: -4.7090% +/- 2.0523% (-0.12 +/- 0.05) (2.65 -> 2.53)
seconds user: -4.8217% +/- 2.0991% (-0.13 +/- 0.06) (2.63 -> 2.51)
```


pkg/front_end/lib/src/type_inference/inference_visitor.dart:

JIT (tokens per microsecond):
11.5950% +/- 3.4217% (1.96 +/- 0.58) (16.91 -> 18.87)

AOT (tokens per microsecond):
11.7128% +/- 1.4863% (2.61 +/- 0.33) (22.32 -> 24.94)

Benchmarker (AOT):
```
msec task-clock:u: -8.9523% +/- 0.8309% (-244.45 +/- 22.69) (2730.57 -> 2486.12)

page-faults:u: 0.0503% +/- 0.0216% (5.00 +/- 2.14) (9933.10 -> 9938.10)
cycles:u: -9.0605% +/- 0.8306% (-1075717286.20 +/- 98615789.63) (11872662784.50 -> 10796945498.30)
instructions:u: -13.7568% +/- 0.0000% (-3608232664.50 +/- 836.10) (26228691068.30 -> 22620458403.80)
branch-misses:u: 6.9875% +/- 4.6549% (2539140.50 +/- 1691509.92) (36338407.60 -> 38877548.10)
seconds time elapsed: -8.9450% +/- 0.8300% (-0.24 +/- 0.02) (2.73 -> 2.49)
seconds user: -8.9919% +/- 0.8899% (-0.24 +/- 0.02) (2.71 -> 2.47)
```
Change-Id: I207a35d8107ba1604646e387e590aa19a4ccd996
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-07-31 00:41:31 -07:00
Jens Johansen 59f19d8771 [parser] Shortcut common case in parseArgumentsRest
Observation: Often when about to call parseExpression in
parseArgumentsRest we see either "<identifier> <comma>" (say, we're
passing a variable) or "<identifier> <end parens>" (same case, but last
argument).

This CL allows us to shortcut such cases avoiding a lot of calls where
we check if it's other cases which it isn't.

pkg/analyzer/lib/src/dart/ast/ast.dart:

JIT (tokens per microsecond):
5.5605% +/- 4.0086% (1.16 +/- 0.84) (20.94 -> 22.10)

AOT (tokens per microsecond):
7.1788% +/- 2.5682% (2.04 +/- 0.73) (28.44 -> 30.48)

Benchmarker (AOT):
```
msec task-clock:u: -4.4173% +/- 1.7793% (-124.29 +/- 50.07) (2813.81 -> 2689.52)
page-faults:u: 0.1064% +/- 0.0131% (10.90 +/- 1.35) (10246.00 -> 10256.90)
cycles:u: -4.4718% +/- 1.7882% (-546472914.30 +/- 218528412.28) (12220314431.60 -> 11673841517.30)
instructions:u: -10.0011% +/- 0.0000% (-2704578213.40 +/- 1611.58) (27042820700.90 -> 24338242487.50)
seconds time elapsed: -4.4160% +/- 1.7779% (-0.12 +/- 0.05) (2.82 -> 2.69)
seconds user: -4.6324% +/- 1.8285% (-0.13 +/- 0.05) (2.80 -> 2.67)
```


pkg/front_end/lib/src/type_inference/inference_visitor.dart:

JIT (tokens per microsecond):
10.1981% +/- 1.2476% (1.58 +/- 0.19) (15.46 -> 17.04)

AOT (tokens per microsecond):
8.7843% +/- 1.5781% (1.79 +/- 0.32) (20.42 -> 22.22)

Benchmarker (AOT):
```
msec task-clock:u: -5.9322% +/- 2.7532% (-181.01 +/- 84.01) (3051.38 -> 2870.37)

page-faults:u: 0.0352% +/- 0.0261% (3.50 +/- 2.59) (9930.90 -> 9934.40)
cycles:u: -6.0726% +/- 2.7273% (-805818237.40 +/- 361907438.70) (13269703092.60 -> 12463884855.20)
instructions:u: -11.9540% +/- 0.0000% (-3561054138.90 +/- 1016.14) (29789745342.80 -> 26228691203.90)
seconds time elapsed: -5.9310% +/- 2.7520% (-0.18 +/- 0.08) (3.05 -> 2.87)
seconds user: -6.1531% +/- 2.7477% (-0.19 +/- 0.08) (3.03 -> 2.85)
```
Change-Id: Ia4fbdcbd438a38a0c07b3f4423812ef3507b626c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439880
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-07-31 00:41:03 -07:00
Fedor Shcheglov d73f7bdb43 Generate GeneralizingAstVisitor, TimedAstVisitor, AnalysisRuleVisitor and AstVisitor.
Fixed an incorrect name `_forRecordLiterals` in
`RuleVisitorRegistryImpl`.

Refactored existing generators to reduce code duplication, extracted
_Node class and made helper extensions.

For context I am currently reading Crafting Interpreters by Robert
Nystrom and was inspired to use the code generation shown in the book.

Change-Id: Ia26aa2f697b98dae89903648758c2ca47d1823ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-07-30 16:18:19 -07:00
Nate Biggs 3c53e3ef5c [dart2wasm] Remove extra noisy type check warnings from WASM dry run.
These were producing false positives that could mislead users.

We will cherrypick this to beta and then reimplement these in a different way for the next Dart release.

Change-Id: I495135bbed6ca0b194ea84aaef3ec8e571fc2e98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442960
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-07-30 16:05:12 -07:00
FMorschel df45313259 [Linter] Fixes no_literal_bool_comparisons scope and CONVERT_TO_BOOL_EXPRESSION fix
Fixes: https://github.com/dart-lang/sdk/issues/60614
Change-Id: I8c880d16c21f35a096c3d9def08c0588ae17a40d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442440
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-07-30 15:06:34 -07:00
FMorschel 4564d148b3 [DAS] Fixes Go to import on extension getter/setter
Fixes: https://github.com/dart-lang/sdk/issues/61200
Change-Id: I10c64d4aff472c0f219e2b1af79520fbacbb2ea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442460
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-07-30 14:51:42 -07:00
Ryan Macnak 6f69ee309c [test] Don't rely on try-catch to prevent inlining.
Change-Id: I21926e63c226196c92acf5e32515ce5b1ada8eb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397482
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-07-30 13:56:40 -07:00
Nate Biggs 7f44c726a4 [dart2wasm] Add natebiggs@ as wasm owner.
Change-Id: I37f541c6455b8f12018994b08d333c0069d1cc4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442961
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-07-30 13:52:55 -07:00
Paul Berry 7ac80be476 [front end] Remove type argument from class Code.
This type argument was never used. Removing it should make it easier
to make changes to the front end error message logic (and associated
code generator), which I intend to do as part of a long term plan to
make the analyzer and front end error reporting systems more
consistent, and eventually merge them.

Change-Id: I994cd2a74c5fd77df192f6a1f2dde46ba8a31883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442723
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-07-30 12:38:27 -07:00
Konstantin Shcheglov 206e10a050 Elements. Remove useless constructor comments.
Change-Id: If374b60b601ed10c5dd414224b35517360113b73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442707
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-07-30 09:18:00 -07:00
Konstantin Shcheglov 013c1343dd Elements. Rename XyzMember into SubstitutedXyzElementImpl.
New names better represent what these classes are.

The `element_printer.dart` utility is updated to produce the old `*Member` names for the new `Substituted*ElementImpl` classes. This is a temporary measure to avoid updating a large number of test expectations in this CL. The expectations will be updated and the temporary code in `element_printer.dart` will be removed in a follow-up CL.

Change-Id: Ic203600d6c1a0b686323df8bd2f8f086769309ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-07-30 09:12:51 -07:00
Konstantin Shcheglov e9b8dd9cb5 Elements. Rename all Xyz2OrMember into InternalXyzElement.
First, the character `2` has no meaning anymore.

Second, saying "Internal" better represents what this interface is: an
internal interface, with more precise types and additional methods.

Move InternalConstructorElement into 'with' in ConstructorElementImpl.

Change-Id: I22b04b4b6e786c50429359a656a8d6ca5e2fb492
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442701
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-07-30 09:05:12 -07:00
Kallen Tu 1cf0dea80f [analysis_server] Dot shorthands: Update RemoveTypeAnnotation fix and assist.
Similar to https://dart-review.googlesource.com/c/sdk/+/441320
(ReplaceWithVar fix and assist)

Update the fix to remove the type annotation, but insert the declared type elsewhere so we can keep the context type for resolving a dot shorthand.

Bug: https://github.com/dart-lang/sdk/issues/60957, https://github.com/dart-lang/sdk/issues/60994
Change-Id: Ib1af91090b49b10f4b866588c0837687bc901cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2025-07-30 08:58:51 -07:00
Chloe Stefantsova 9a9166e30c [model] Share constraint solving for one type variable Analyzer/CFE
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Iff6d8b2cf058328cacae307c27fc7d0e63a51227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442201
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-07-30 08:53:43 -07:00