Commit Graph

110772 Commits

Author SHA1 Message Date
Ryan Macnak 3fbd3ab070 [infra] Clean-up debugging temp file quarantine issue.
Change-Id: I8004c07ce0a60ac5134ac9c871cca2a9300b3583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467381
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-16 13:34:00 -08:00
Jake Macdonald db06bb7f13 Initialize SDK and regular projects on creation
Runs either `dart pub get` or `gclient sync`, based on project type.

For the SDK, copies the .gclient and .gclient_entries files as well
into the parent dir.

Also adds a `--timeout` argument, controls how long to wait for analyzer messages.

Change-Id: Id2c28e6d0251e94914bb0650be104c1f90a66651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2025-12-16 12:30:25 -08:00
Ryan Macnak ee4ec6c84d [vm] Maintain W^X when mapping snapshots on Windows.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62249
Change-Id: I4ee4e7420527907d20217916acbc4162d9a53800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468441
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-16 09:22:52 -08:00
FMorschel 275581bca1 [DAS] Fixes completion for switch expression pattern after when
Fixes: https://github.com/dart-lang/sdk/issues/62210
Change-Id: I42a3d6f3f93a8ecc8f4b866d89119a6cc49bd3e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467160
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2025-12-16 09:07:37 -08:00
Nate Biggs 5458ba73e5 [dart2wasm] Improve module self-reference.
Use a (mutable) global rather than a function to get the externref to
the appropriate module for exported function wrappers. This way we don't
have to make a slow JS interop call to get the module.

Recovers regression in golem "FunctionToJs.Convert.*.*" benchmarks seen
from introducing these functions.

Change-Id: Ie05d803a3d9992dce3dda89e6ae5af83d3f34383
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468220
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-12-16 09:06:27 -08:00
Brian Wilkerson 4dd879a477 Stop suggesting final in parameter lists
This stops completion from suggesting `final` outisde a primary
constructor's parameter list when the feature is enabled. When the
feature is not enabled, it won't be suggested anywhere. I did that
because in the same release this CL is for we'll produce a warning if
`final` is used, and it seems unhelpful to suggest adding code that will
have a diagnostic associated with it.

Change-Id: I2f8ad2d92ea0641e2212c89d01aa23921b39b3e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468401
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-12-16 07:17:29 -08:00
Slava Egorov c058785219 [dartdev] Add info record-performance subcommand
This subcommand uses perf_witness recording functionality to record
performance timelines of all processes that opted into the recording.

Change-Id: I37fd9fc88e38853a77a105370e2020fc6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459745
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-12-16 06:19:25 -08:00
Chloe Stefantsova e1d5dc8c35 [cfe] Assign captured contexts to FunctionNodes
Part of https://github.com/dart-lang/sdk/issues/61572

Change-Id: Id6293f6300436d252a52e973cba6cd52cda48758
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468281
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-12-16 05:14:41 -08:00
Jens Johansen c56e94630e [vm] Allow Before/After GC to signal perf
This CL makes it possible for the Dart VM to start or stop `perf` while
doing GC, which gives a significantly more stable output.

Example usage:

Bash script that creates the correct file handles and calls dart under
`perf stat` based on the arguments given to the script:

```
DART=$1
shift
AOTSNAPSHOT=$1
shift

ctl_dir=/tmp/

ctl_fifo=${ctl_dir}perf_ctl.fifo
test -p ${ctl_fifo} && unlink ${ctl_fifo}
mkfifo ${ctl_fifo}
exec {ctl_fd}<>${ctl_fifo}

ctl_ack_fifo=${ctl_dir}perf_ctl_ack.fifo
test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo}
mkfifo ${ctl_ack_fifo}
exec {ctl_fd_ack}<>${ctl_ack_fifo}

perf_ctl_fd=$ctl_fd perf_ctl_fd_ack=$ctl_fd_ack perf stat --delay=-1 --control fd:${ctl_fd},${ctl_fd_ack} -B -e "task-clock:u,context-switches:u,cpu-migrations:u,page-faults:u,cycles:u,instructions:u,branch-misses:u" $DART --perf_ctl_fd=${ctl_fd} --perf_ctl_fd_ack=${ctl_fd_ack} --perf_ctl_usage=1 --deterministic $AOTSNAPSHOT $@

exec {ctl_fd_ack}>&-
unlink ${ctl_ack_fifo}

exec {ctl_fd}>&-
unlink ${ctl_fifo}
```

This will start `perf stat` paused (which would require the run dart
aot-compiled script to start it when it wants to) and where the VM
pauses `perf` while doing GC.

In practise, looking at instruction counts reported by `perf stat`, I've
seen the difference between runs go from 2+ mio (and in some instances
23+ mio) to around 30,000 (!) on runs of the analyzer (tool
"stable_analysis").

TEST=manually

Change-Id: Iab955a5dd35e47f22c4f693ae50effc8ee633897
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468260
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-12-16 04:16:15 -08:00
Martin Kustermann d4531a418d [dart2wasm] Allow cross module function inlining
This reduces main wasm module a bit (<1%) as it avoids the main module
from having to define and export simple accessor (e.g. field accessor)
functions.

There's two scenarios to consider:

Deferred module calls function from main module
=> No issues

Main module calls function from deferred module
=> This call must have been preceded by a CheckLibraryIsLoaded
=> The wasm modules of the deferred import must have been loaded
=> No issues.

We also change the inlining to be a little more conservative on static
field getters, as a static field may need to do a lazy initialized check
and call initializer function.

We also give the initializer function a better name.

Change-Id: I5d9b138c9fcb41f8580602fd1ba9ec5aa4af5341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467820
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-12-16 03:09:19 -08:00
Martin Kustermann b0e18fa40b [dart2wasm] Fix bug in @pragma('wasm:static-dispatch') & remove corresponding dispatch table entries
There was a bug in `CallTarget.signature` which triggers if there's only
one entry that's statically dispatched against, which causes us to
inline the polymorphic dispatcher, which relies on this (previously
incorrect) signature.

The CL also changes the dispatch table building logic to not allocate
table entries for the statically dispatched regions (as they would
never be used).

Change-Id: Ic2d0c387e8863e89ef811e1892642fe81df9189a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468000
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-12-16 01:42:00 -08:00
Martin Kustermann 368cde8f27 [dart2wasm] Do not hold onto sources in Kernel AST
This removes 400+ MB of RAM usage when compiling big apps.

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

Change-Id: Ia98395a7d3498a677dc6202fd56b4f7ecbf6c930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468301
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-12-16 01:41:31 -08:00
Sam Rawlins 7cad5f5e52 analyzer: Improve names of unused_element parameter tests
We don't have a strict rule set for naming test methods, but the general
idea of grouping terms with underscores (and breaking an otherwise
rather universal rule of using camelCase) is to help to group like
test cases (aided by our alphabetical sorting enforcement).

There were examples in this file that really broke the grouping
mechanism by not using consistent grouping. Here are the broad strokes
of what I changed; no test bodies were changed, _only names_, but the
CL is hard to review because of sorting.

* `test_classGetterSetter_...` and `test_classSetter_...` were renamed
  to use `class` as a group (`test_class_getterSetter_...` and
  `test_setter_...`) consistently.
* `test_factoryConstructor_...` were renamed to use `constructor` as
  the group base (`test_constructorFactory...`).
* `test_optionalParameter_...` were renamed to use `parameter` as the
  group base (`test_paramter_...`). This is the bulk of the change.
  There were previously dozens of tests starting with
  `test_optionalParameter_` _and_ dozens of tests starting with
  `test_parameter_`. However, `unused_element` only concerns itself
  with optional parameters, so that can be the default meaning of
  `test_parameter_`. (Similar to classes; we don't report any public
  classes as unused, but we don't need to write `private` in every
  test case.)
* In the parameter tests, there was an inconsistent placement of the
  group `isUsed` or `notUsed`. It seems like the bulk of tests place
  the `isUsed` or `notUsed` grouping earlier rather than at the end of
  the test name, so I went with that for this consistency CL.

Change-Id: I54be6591615d015ae9cf87ee4c9726ed7cfee209
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468180
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-12-15 20:33:10 -08:00
Sam Rawlins 3761de3441 analyzer: Update the "new language feature" task list for warnings
I won't claim that this list is perfectly complete, but I will claim
that it's _more_ complete. :D

Change-Id: If0b2a4e32b10ef0c140f3cbf77d6e5abfcb918b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-15 20:15:01 -08:00
Paul Berry fb19233ff8 [messages] Use lowerCaseName in verify_docs.
Change the `verify_docs` package's use of `DiagnosticCode.name` to
`DiagnosticCode.lowerCaseName`. There is no functional change since
all diagnostic codes generated by the analyzer are already in lower
case.

This helps pave the way for eventually deprecating and removing
`DiagnosticCode.name`, which will help ensure that analyzer clients
treat diagnostic codes in a case-insensitive fashion.

Change-Id: I6a6a69645300e89b1bed342804d5e89ae9cf556b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468141
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-12-15 17:45:52 -08:00
Ryan Macnak 583fbe5962 [vm] Symbolize more Windows errors.
TEST=build
Bug: https://github.com/dart-lang/sdk/issues/62249
Change-Id: I66e5cff2c965c1078ee59338bf5f0c4d061cec95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468400
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-15 15:45:21 -08:00
Sam Rawlins c034cacd41 analyzer: Update comment in NullSafeApiVerifier
It doesn't make sense to say "when null-safety is enabled" any longer.

Also add a TODO note referring to a GitHub issue.

Change-Id: Ib27ea9a8054fee5fa663ed85c7fec6a72fb01961
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468140
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-12-15 14:40:44 -08:00
DEPS Autoroller c7f4fd8a4b Roll Fuchsia SDK from 30.20251211.4.1 to 30.20251212.4.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: I2947c1e2b0bc059bf3fdc635a823b6901b8a5e0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467960
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-12-15 14:31:06 -08:00
Sam Rawlins 74a5794887 analyzer: Rename "error" variables to be "diagnostics"
This is cleanup from renaming types like `DiagnosticCode`. I found these
variables which also need to be renamed.

Change-Id: I0e6d0633009c9c2b5d719f4c911295f9ded4e257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468160
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-12-15 14:24:16 -08:00
Jake Macdonald 42e7de8f6c add the ability to run a single scenario, fix results getter
Change-Id: I74e0e0ddb20a2182d4dc4f5e37ffb6c1925ee4f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468360
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-12-15 13:51:30 -08:00
DEPS Autoroller 47243fb633 Roll BoringSSL from 29e2ef6cc121 to 53844eb8bb2a (8 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/29e2ef6cc121..53844eb8bb2a

2025-12-12 rpolzer@google.com EVP_AEAD: implement sealv/openv for AES-CCM.
2025-12-12 rpolzer@google.com EVP_AEAD: implement sealv/openv for AES-EAX.
2025-12-12 rpolzer@google.com EVP_AEAD: add a helper to process iovecs on a per-block basis.
2025-12-12 rpolzer@google.com Move `err_data.cc` symbols into the `bssl` namespace.
2025-12-11 dimitri.ledkov@surgut.co.uk Link to CMVP certificate for 20240407
2025-12-11 rpolzer@google.com Fix a missing incldue in `aead.cc.inc`.
2025-12-11 rpolzer@google.com Revert "Revert the initial seal/openv implementations"
2025-12-11 rpolzer@google.com AEAD tests: fix accidental bit overlap.

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@grotations.appspotmail.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@grotations.appspotmail.com
Change-Id: I35d374753e1a5d185f225d9a46a2ae47faaec8cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467940
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-12-15 13:42:50 -08:00
Brian Quinlan 5eecbb5a27 Revert "Roll Clang from f77ce52b56d0 to 9a5fa3075ac6"
This reverts commit 65f16e3269.

Reason for revert: Causes TSAN failures

Original change's description:
> Roll Clang from f77ce52b56d0 to 9a5fa3075ac6
>
> If this roll has caused a breakage, revert this CL and stop the roller
> using the controls here:
> https://autoroll.skia.org/r/clang-dart-sdk
> Please CC dart-engprod@google.com,dart-vm-gardener@grotations.appspotmail.com,dart-vm-team@google.com on the revert to ensure that a human
> is aware of the problem.
>
> To file a bug in Clang: https://bugs.fuchsia.dev/p/fuchsia/issues/list?q=component%3AToolchain
> 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;luci.dart.try:vm-asan-mac-release-arm64-try
> Change-Id: Ia893f84d6979e722f5c293087f866c40707f868a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467760
> Commit-Queue: Alexander Aprelev <aam@google.com>
> Reviewed-by: Brian Quinlan <bquinlan@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

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;luci.dart.try:vm-asan-mac-release-arm64-try
Change-Id: I881b0e7cda4e7aa2990527851926984c84299034
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468321
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-12-15 12:38:41 -08:00
Brian Wilkerson ba35276ae2 Add completion support for primary constructors
This adds completion support in the class header. Support for completion
in the body will be added in a separate CL.

Please look carefully at the tests to ensure that there aren't holes in
the coverage.

Change-Id: I189f25fbb90f43b4d8993622d5eb025d3160bef1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467920
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-12-15 11:31:17 -08:00
Paul Berry 277cee68a4 [messages] Convert bodyMightCompleteNormally checks to use literate diagnostic API.
Converts the code that reports diagnostic codes
`bodyMightCompleteNormally` and `bodyMightCompleteNormallyNullable` to
use the literate diagnostic reporting API.

This was not a straightforward conversion because the code for
reporting these diagnostics
(`ResolverVisitor.checkForBodyMayCompleteNormally`) made use of the
`DiagnosticReporter.atConstructorDeclaration` method, which doesn't
have a direct analogue in the literate diagnostic API. The equivalent
formulation in the literate diagnostic API is to call
`ConstructorDeclarationExtension.errorRange` to compute the offset and
length for the constructor name, and then pass the result to
`LocatableDiagnostic.at`.

Note that the previous version of
`ResolverVisitor.checkForBodyMayCompleteNormally` used an `if`/`else`
chain to handle three possible types for `errorNode`:
`ConstructorDeclaration`, `Token`, or `BlockFunctionBody`. But the
call sites might pass in any sort of `FunctionBody`. So it appeared
that the diagnostic would be accidentally dropped in the case where
`errorNode` was some other type of `FunctionBody`. However, it turns
out that there was a tricky reason why the diagnostic was never
accidentally dropped: the call site that passes in a `FunctionBody`
also passes the same `FunctionBody` for the `body` parameter, and
`ResolverVisitor.checkForBodyMayCompleteNormally` only checks for
`bodyMightCompleteNormally...` errors if `body` is of type
`BlockFunctionBody`.

In the new code, a `switch` expression is used to compute the range
over which the diagnostic should be reported, so it is manifestly
clear that the diagnostic is never accidentally dropped.

Change-Id: I6a6a69647a8fd1928d935ec8b5cb0c733ad2412f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-12-15 10:36:40 -08:00
Sam Rawlins 13119ed91c DAS plugins: Fix race condition between plugin startup and a change in overlays
Fixes https://github.com/dart-lang/sdk/issues/62214

Danny describes the problem at a high level in https://github.com/dart-lang/sdk/issues/62214.

At a lower level, the issue is that we add the new `PluginIsolate` to
the `_pluginMap` as soon as we instantiate it! Before we've even made
the request to start it up. The `_pluginMap` is how PluginManager sends
out various requests, like watch events, priority files, and update
content.

The fix is easy enough: we wait to add the PluginIsolate to the `_pluginMap` until after we've awaited `PluginIsolate.start`.

Change-Id: I05e6314fde10fbaf4cf25b38b526c5cf96bd65ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467923
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-12-15 10:33:38 -08:00
Nicholas Shahan 03bb1c75d6 [ddc] Use correct async timing on deferred imports
The correct async timing is now always enabled by default.

Change-Id: Ic7489668af14e1acd6069019121e0ff381f0c8a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467442
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2025-12-15 10:08:39 -08:00
Ben Konyi 262d9eb262 [ DDS ] Remove x-frame-options=SAMEORIGIN from default response headers
This response header entry prevents DevTools from being embedded in
iframes, which is needed to embed the DevTools inspector within the
Flutter widget preview environment.

TEST=Manually verified with `flutter widget-preview start`

Change-Id: Ic4ec3cf0e23509a6c0cbc94ab636a18c6abf733f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468020
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2025-12-15 10:08:02 -08:00
Paul Berry 8600df906e [messages] Add SyntacticEntity.sourceRange getter.
This will allow diagnostic reporting code in the analyzer to be more
easily converted to the new literate diagnostic reporting API, because
it will make it possible to use `SourceRange` as the common
denominator for situations where the location where a diagnostic needs
to be reported might come from either a `SyntacticEntity` or a
`SourceRange`.

Change-Id: I6a6a6964f3ec2ea33e8900d93b5abe714c9e1dcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-12-15 09:02:26 -08:00
Nate Biggs 774c454ffa [dart2js] Fix duplication of code after for..in loop containing a break.
`builder.current` at the time of creating the labelGraph is the block
after the body. So setting that as the end node of the subGraph was
including all the code after loop into the body of the labeled
statement.

Instead we use the `bodyBlock` as the end of the labelGraph as this is
the last block in the body of the loop. If no such body exists, we use
the `conditionEndBlock` which is the block right before the body (and
still includes the logic to exit the loop).

Also changes codegen to not emit a labelStatement if it has no body.
AFAICT we don't do DCE on flow blocks so codegen is the best time to
avoid emitting this code.

Bug: https://github.com/dart-lang/sdk/issues/62185
Change-Id: Ia80cc7d3b44782c6193a67e8adbbc66f00b8f133
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468060
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2025-12-15 08:55:50 -08:00
Alexander Aprelev 011f0259f9 [vm/shared] Ensure that shared fields initialization is mutex-guarded even without experimental flag.
Shared fields have to be properly initialized even when experiment is not enabled.

TEST=shared_finalthreadlocal_init_test on a loop
BUG=https://github.com/dart-lang/sdk/issues/62238

Change-Id: Ib8d32bd2553cdcbefeea657e4dd2b75db18d31d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467921
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-12-15 08:22:10 -08:00
Alexander Markov 3c99ae9b68 [vm] Fix incorrect assumption about co-location of leaf and non-leaf runtime entries in Thread
Thread::OffsetFromThread from runtime_api.cc assumed that all fields
between leaf and non-leaf runtime entries in Thread have word size,
so the delta between runtime entries can be translated from host to
target by multiplying by the ratio between target and host word size.

Since leaf and non-leaf runtime entries are not co-located in Thread,
this assumption is incorrect. It is now fixed by using separate
bases when calculating offsets of leaf and non-leaf runtime entries.

Also, add FatalError runtime entry which is useful for
bootstrapping of the new compiler.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Iea4762b21285aa6423876b34328c863227ee1434
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467900
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-12-15 08:00:53 -08:00
Alexander Markov cb2b871706 [cfg] Fix handling of unreachable AST in TryCatch and field initializers
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I189d7d3704c29b1350df23bca174990608b052ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467880
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-12-15 07:17:46 -08:00
Paul Berry dee306bdf8 [messages] Use lowerCaseName in dart2wasm.
Change the `dart2wasm` package's use of `DiagnosticCode.name` to
`DiagnosticCode.lowerCaseName`. There is no functional change since
all diagnostic codes generated by the analyzer are already in lower
case.

This helps pave the way for eventually deprecating and removing
`DiagnosticCode.name`, which will help ensure that analyzer clients
treat diagnostic codes in a case-insensitive fashion.

Change-Id: I6a6a696490fe3ecf945d1c1544ea7eb20c12e995
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468120
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-12-15 07:14:03 -08:00
Martin Kustermann d38e30d65a [dart2wasm] Fix bug in JS typed data .sublist() implementations
Issue https://github.com/flutter/flutter/issues/179853

Change-Id: I97ce8d7177dfdd612714fafbc2a6b13555d9bba1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468300
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-12-15 06:46:18 -08:00
Daco Harkes 10373c30e8 [dartdev] Run remote empty version
Fixes: https://github.com/dart-lang/sdk/issues/62122
Change-Id: Id8331c58d968b6c92cfe7c1ae9be75d80260e772
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-linux-release-try,pkg-linux-debug-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467803
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-12-15 06:39:16 -08:00
Martin Kustermann 27f26e5189 [dart2wasm] Optimize initialization of dispatch table
This reduces essentials main module by 8.3% (-730 KB)

The dispatch table contains displaced selector rows. Each selector row
contains an entry for each class that provides the selector.

This can lead to very large dispatch tables with repeated elements:
Especially common is a base class with selectors that get inherited
by many subclasses where few subclasses override the selector.

This is common e.g. for `Object.{hashCode,operator==,noSuchMethod}` but
also for user defined base classes that have many subclasses.

This led to the element section being very large: It often contains
large consecutive sub-ranges which refer to the same target function.

To shrink the element size we instead move the initialization of those
large regions homogenious regions to the module init function: We can
utilize the `table.fill` instruction which can initialize a large range
of the table with the same value.

Change-Id: I9fc308969264f4855a514e7d36c761891bb0cb52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467843
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-12-15 06:25:41 -08:00
Paul Berry 4cd737824c [messages] Use lower case name for accessing customized codes.
Changes the logic for accessing the maps `customizedCorrections` and
`customizedMessages` so that it looks up messages by
`lowerCaseUniqueName` rather than `uniqueName`.

These maps are used by the google3 import of the analyzer, so that
error messages can be customized for internal use without having to
patch analyzer sources. This change is a no-op because all diagnostic
codes currently have lower case names.

This paves the way for deprecating (and eventually removing) the
`DiagnosticCode.uniqueName` getter.

Change-Id: I6a6a69646e7e131976ef3ac708f83b1e82b47ead
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/466128
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-12-15 05:40:13 -08:00
Sigurd Meldgaard eaac59bcf3 Bump pub to b21ac685bc64f6e81050ec0093aa83543d66e2fd
Changes:
```
> git log --format="%C(auto) %h %s" b297f1f..b21ac68
 https://dart.googlesource.com/pub.git/+/b21ac685b Bump actions/checkout from 5.0.0 to 6.0.0 in the github-actions group (4719)
 https://dart.googlesource.com/pub.git/+/65e289b95 Tag pattern: use hash of referenced commit not of tag itself (4707)

```

Diff: https://dart.googlesource.com/pub.git/+/b297f1f5e42f2569f15a98548f44b4b9a48487c1..b21ac685bc64f6e81050ec0093aa83543d66e2fd/
Change-Id: Iea51fe54d4bb7e3bb888483417b68f4175c1ddb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468280
Reviewed-by: Sarah Zakarias <zarah@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Auto-Submit: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Sarah Zakarias <zarah@google.com>
2025-12-15 02:41:13 -08:00
Slava Egorov 9bf1f2529a [vm/io] Fix crashes in Socket.setOption
Don't call native methods on a socket which is closed
or in process of being closed. On some OSes this will
crash the VM because underlying FD is actually a malloc
allocated handle object which will be destroyed by 
the event handler once it receives and processes close
request.

BUG=b/335437875
TEST=standalone/io/abrupt_close_test

Change-Id: I557d725a6cce020a6a1e3df0bd3e2c836a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467841
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-12-15 02:31:18 -08:00
Sigurd Meldgaard a22f4d3924 Hide remote run behind flag (until aligned)
Prevent introducing a breaking change later by removing the current incantation
of remote run before it goes into stable.

See: https://github.com/dart-lang/sdk/issues/62123 for details.
Change-Id: I53e0ba84a9317bd16d1249d2bcf1b07a0467a49d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467021
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2025-12-15 01:55:31 -08:00
Sam Rawlins 04753f6565 analyzer: Deprecate the avoid_null_checks_in_equality_operators lint rule
Work towards https://github.com/dart-lang/sdk/issues/59514

We introduced a new Warning called NON_NULLABLE_EQUALS_PARAMETER a few releases ago. It warns when the parameter of an `operator ==` override has a nullable type:

> The parameter type of '==' operators should be non-nullable.

I didn't realize it at the time, but that new warning, plus null safety, basically replace the `avoid_null_checks_in_equality_operators` lint rule. This rule reports doing any null-check work on a nullable parameter of an `operator ==` override.

Change-Id: Ibd8139cd5804a9ccb6cc07d2187c9305a336c7cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-12 19:06:29 -08:00
Sam Rawlins 6c0ae6015d analyzer: use displayName in nonAbstractClassInheritsAbstractMember args
Fixes https://github.com/dart-lang/sdk/issues/62224

`displayName` is a much better choice when joining an enclosing
element's "name" with a child element, via a period.

Change-Id: Ib79e31abf352c60903754326b6ed6686ec3d7824
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-12-12 11:46:59 -08:00
DEPS Autoroller 089da155d1 Roll Fuchsia SDK from 30.20251205.6.1 to 30.20251211.4.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: I3d8f9d039f5c69699a20a6c4e99107a9e2005162
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467620
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-12-12 11:00:26 -08:00
Martin Kustermann 8aeadb38b9 [dart2wasm] Optimize fine grained partitioning for deferred loading
This saves around 730 KB (-7.7%) on essentials main module.

The existing fine grained partitioning of code into wasm modules
operates on static elements. That means as soon as a constructor is
called, all instance methods of a class are included as well.

This CL improves upon this using the insight that some instance methods
are always accessed via direct calls (i.e. all call sites to the
instance member are devirtualized).

For those methods that are never called indirectly, the partitioning
algorithm can avoid enquing those instance methods when the class is
enqueued and instead enqueue them when the devirtualized call site is
hit.

An example where this can happen is e.g. main module allocates a proto
class but doesn't access field X. Currently when hitting the constructor
we'll enqueue all instance members. Now we don't enqueue X (as all uses
of X are direct calls to the X getter). That means if X is only used in
a deferred module, then we can move the X getter to that deferred
module.

Change-Id: Ib45edb6e658a62aaeb15ed7c40745733ec619ff0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467700
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-12-12 10:41:39 -08:00
DEPS Autoroller c01e5d2c76 Roll BoringSSL from 20b18aef7c1a to 29e2ef6cc121 (29 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/20b18aef7c1a..29e2ef6cc121

2025-12-11 davidben@google.com Deduplicate some code to compute test vector paths
2025-12-11 davidben@google.com Skip iovec tests for NIST CAVP vectors
2025-12-11 davidben@google.com Split sealv, openv, and openv_detached into separate tests
2025-12-11 davidben@google.com Recreate the TestIOVecs on every test call
2025-12-10 rpolzer@google.com When testing AEADs, don't split both the AAD and the plaintext.
2025-12-10 davidben@google.com Revert the initial seal/openv implementations
2025-12-10 rpolzer@google.com EVP_AEAD: implement sealv/openv for AES-GCM.
2025-12-10 rpolzer@google.com EVP_AEAD: implement sealv/openv for AES-CTR-HMAC-SHA256.
2025-12-10 divVerent@gmail.com EVP_AEAD: declare CRYPTO_IOVEC based APIs to support zero copy I/O.
2025-12-09 davidben@google.com infra: Remove seemingly unused win_toolchain cache
2025-12-09 davidben@google.com Check in .bazelversion and MODULE.bazel.lock in util/bazel-example
2025-12-09 davidben@google.com infra: Prefix all of BoringSSL's caches
2025-12-09 davidben@google.com Make third_party/benchmark's configure script less noisy
2025-12-09 chlily@google.com Format *.bzl, *.bazel files using buildifier
2025-12-09 chlily@google.com Add a try builder to run boringssl presubmits
2025-12-09 rpolzer@google.com Fix minor benchmark issues:
2025-12-08 davidben@google.com Retire RSA blinding support
2025-12-08 davidben@google.com Benchmark long-lived vs newly-imported RSA keys for both sign and verify
2025-12-08 xfding@google.com Use google/benchmark for performance tracking
2025-12-08 rpolzer@google.com Make the benchmark timeout a floating point, not integer, flag.
2025-12-08 rpolzer@google.com Add a utility to extract identifiers from public headers.
2025-12-08 davidben@google.com Remove non-CBC codepaths from e_tls.cc
2025-12-08 davidben@google.com Don't condition BORINGSSL_self_test on !_MSC_VER
2025-12-08 davidben@google.com Inject the custom libc++ globally
2025-12-08 davidben@google.com Don't build third-party deps with our warnings
2025-12-08 davidben@google.com infra: Bump android-21 to android-24 on CI
2025-12-08 davidben@google.com infra: Disable mac_arm64_bazel builder again
2025-12-08 davidben@google.com Simply warnings config slightly
2025-12-08 davidben@google.com Stop setting -fmsc-version in our build

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@grotations.appspotmail.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@grotations.appspotmail.com
Change-Id: I637f5c08dfb51817aac6d93f00a97279963864f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467600
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-12-12 10:11:14 -08:00
Paul Berry 608265c794 [messages] Convert ...WithAbstractMember to use literate diagnostic API.
Converts the code that reports the diagnostic codes
`concreteClassWithAbstractMember` and `enumWithAbstractMember` to use
the literate diagnostic reporting API.

Change-Id: I6a6a696407c7623250e08d5cc361e36762269d53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467722
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-12-12 09:51:26 -08:00
Paul Berry a093843e6d [messages] Convert classInstantiationAccessTo(Static|Instance)Member to use literate diagnostic API.
Converts the code that reports the diagnostic codes
`classInstantiationAccessToStaticMember` and
`classInstantiationAccessToInstanceMember` to use the literate
diagnostic reporting API.

Change-Id: I6a6a6964690435bde5e4c39bc6a95c2a3d01104f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467741
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-12-12 09:44:25 -08:00
Paul Berry 5d445b7b7d [messages] Migrate shared_type_analyzer.dart to literate diagnostic reporting.
For all the diagnostic messages used by `shared_type_analyzer.dart`,
replaces the placeholder parameter names `p0`, `p1`, `p2`, etc. with
descriptive parameter names, and updates the call sites that use those
diagnostic messages to use the new literate diagnostic reporting API.

The changes to `dart` code had to be done manually, since the types
substituted into the diagnostic messages needed to be converted from
`SharedTypeView` to `TypeImpl` by calling
`.unwrapTypeView<TypeImpl>()`.

Change-Id: I6a6a6964147dbb304cb21b3fed427ab0d5ed1e6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-12-12 09:43:22 -08:00
DEPS Autoroller 65f16e3269 Roll Clang from f77ce52b56d0 to 9a5fa3075ac6
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/clang-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@grotations.appspotmail.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Clang: https://bugs.fuchsia.dev/p/fuchsia/issues/list?q=component%3AToolchain
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;luci.dart.try:vm-asan-mac-release-arm64-try
Change-Id: Ia893f84d6979e722f5c293087f866c40707f868a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467760
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-12-12 09:36:21 -08:00
Moritz 0ccb213c8f Fix new lines in build.dart
Fixes errors of the sort

```
mosum@mosum2:~/projects/i18n/pkgs/intl4x/example$ dart --enable-experiment=record-use build cli example.dart
There are multiple possible targets in the `bin/` directory, and the 'target' argument wasn't specified.mosum@mosum2
```

Change-Id: I7ed6dbd21838506c1fe60b6d69d6066406d3b7c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467842
Auto-Submit: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-12-12 09:35:19 -08:00