Commit Graph

107454 Commits

Author SHA1 Message Date
Martin Kustermann 6e71aa8769 [dart2wasm] Move benchmarks/WasmJSInterop/{,dart/}WasmJSInterop.dart
This will put it into a place where the benchmarking system will find it.

Change-Id: I0ae3762ada89b4b4b71932eb565853a291935fcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429300
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-05-19 03:50:29 -07:00
Chloe Stefantsova 617d0a8e96 [model] Remove more nullability-related assignability error messages
This is a preparation for removing the subtype checking procedure that
ignores the nullability in the input types.

Change-Id: I3c1db55abde0433e9059d949f1c98aaeb61e210c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428980
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-05-19 00:18:57 -07:00
Alexander Aprelev 4a63257e4c [gardening] Fix ffi\native_assets\infer_native_assets_yaml_dart_kernel_snapshot_test.dart on Windows.
When running the test from Powershell Platform.executable is absolute path, rather than relative when invoked from Command shell. That breaks the test when running from Powershell.

This change fixes the test to always use Platform.resolvedExecutable.

```
PS C:\src\d\sdk> out\DebugX64\dart.exe  tests\ffi\native_assets\infer_native_assets_yaml_dart_kernel_snapshot_test.dart
invoke helper with --package=...
File copied to file:///C:/Users/aam/AppData/Local/Temp/tests_ffi_native_assets_b0de5819/infer_native_assets_yaml_dart_kernel_snapshot_helper.dart.
Unhandled exception:
Unsupported operation: Cannot extract a file path from a c URI
<asynchronous suspension>
<asynchronous suspension>
<asynchronous suspension>
<asynchronous suspension>
<asynchronous suspension>
PS C:\src\d\sdk>
```

after

```
PS C:\src\d\sdk> out\DebugX64\dart.exe  tests\ffi\native_assets\infer_native_assets_yaml_dart_kernel_snapshot_test.dart
invoke helper with --package=...
File copied to file:///C:/Users/aam/AppData/Local/Temp/tests_ffi_native_assets_3dfd90fc/infer_native_assets_yaml_dart_kernel_snapshot_helper.dart.
File native_assets.yaml written to file:///C:/Users/aam/AppData/Local/Temp/tests_ffi_native_assets_3dfd90fc/.dart_tool/native_assets.yaml.
dill file created: file:///C:/Users/aam/AppData/Local/Temp/tests_ffi_native_assets_3dfd90fc/infer_native_assets_yaml_dart_kernel_snapshot_helper.dart.dill
invoke helper with --package=... done
invoke helper in working dir
File copied to file:///C:/Users/aam/AppData/Local/Temp/tests_ffi_native_assets_c7f57eac/infer_native_assets_yaml_dart_kernel_snapshot_helper.dart.
File native_assets.yaml written to file:///C:/Users/aam/AppData/Local/Temp/tests_ffi_native_assets_c7f57eac/.dart_tool/native_assets.yaml.
dill file created: infer_native_assets_yaml_dart_kernel_snapshot_helper.dart.dill
invoke helper in working dir done
```

TEST=ci, manually from powershell.

Change-Id: Ie0d6cdb2ecdd69bb44a8ea820ce71405344c1307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429080
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-05-18 23:51:52 -07:00
Brian Wilkerson 75d640458b Add hasPublishedDocs to every diagnostic code
This makes it easier for me to find diagnostics that still need to be
documented because I can search for 'hasPublishedDocs: false'. It's
hard to search for places where it isn't specified.

In case you're interested, we currently have documentation for 70% of
the diagnostics represented in this file.

In almost every case the value is `false`, but there are two codes whose
documentation has already been published but which were not marked as
such. This means that we weren't associating a URL with the diagnostic,
but that's now been fixed.

Change-Id: I4e17671e319ec8e8887aacb6758594d7962bfc85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429202
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-05-18 13:38:57 -07:00
Sam Rawlins 750ecda6b3 Remove two underused methods from ResourceProviderMixin
Change-Id: I41f288f216e7db5a744d10a38074e104321e49f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-17 10:39:12 -07:00
DEPS Autoroller 6b6ccf9fe0 Roll BoringSSL from 136284f8548b to a934ee9e1fe4 (11 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/136284f8548b..a934ee9e1fe4

2025-05-16 davidben@google.com Remove the need for scratch space when squaring
2025-05-16 davidben@google.com Fix some theoretical missing earlyclobber markers in inline assembly
2025-05-16 guillaumee@google.com Introduce an opaque in-memory object to manage xwing private keys.
2025-05-16 guillaumee@google.com Implement the X-Wing KEM as drafted in
2025-05-15 davidben@google.com Suppress -Wcast-qual in STACK_OF implementation
2025-05-15 davidben@google.com Unexport <openssl/service_indicator.h>
2025-05-15 davidben@google.com Add missing newlines and section headers to sha.h
2025-05-14 davidben@google.com Update most deps and bump version
2025-05-14 dimitri.ledkov@surgut.co.uk Increase default salt length from 8 to 16 bytes in PKCS#8 and PKCS#12
2025-05-13 davidben@google.com Tidy up some comments and #defines around salt lengths
2025-05-12 agl@chromium.org Expose ML-DSA-87 in the public headers.

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: Ib5f177f2961668c4735bcdfc934d3eb0e0a7f7af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428801
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-05-17 08:58:50 -07:00
Sam Rawlins 0e5f60e80a linter: enforce unnecessary_async
Change-Id: If5d025ccf2d1a6d80256579bee7a7b3a4d039dde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429061
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-17 07:21:41 -07:00
Sam Rawlins 53f21134d7 linter: add isEnabled to LinterContext directly
This was previously available as an extension on this class, but we
control the class quite directly. Seems like it should just be an API
of LinterContext.

Change-Id: I9fb61ab4471e859c39d9fa963eed2a3839fca617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428925
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-17 06:42:54 -07:00
Sam Rawlins bc3e0ad5a8 Remove deprecated elements of AnalysisRule
* All callers are migrated off of `AbstractAnalysisRule.lintCodes`
  and `.reporter`.
* All callers are migrated off of `AnalysisRule.lintCode`.

Change-Id: I4123250c33ff1d0a488bd4457cfe5fc13160e829
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-16 20:17:16 -07:00
Sam Rawlins ac26e94fff linter: remove unused State.getDescription
Change-Id: Ia241ed01ad81cfdc399cf3011e3b4f6d43113950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428926
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 17:32:00 -07:00
FMorschel 261f8199af [DAS] Trigger incompatible lint for included rules
Fixes: https://github.com/dart-lang/sdk/issues/60125
Change-Id: Icc0b8efda0e7e915d7315a1c2e70c1a7a5093057
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419982
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 17:31:21 -07:00
Devon Carew f5a9c0ac67 [deps] rev dartdoc, protobuf, test, vector_math, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/95f4208..e38f392):
  e38f3921  2025-05-16  Sigurd Meldgaard  Remove analyzer_use_new_elements from analysis_options.yaml (dart-lang/dartdoc#4050)

protobuf (https://github.com/dart-lang/protobuf/compare/9bd149b..b7753f6):
  b7753f6  2025-05-16  Devon Carew  rev package:protobuf version (dart-lang/protobuf#994)
  b5d20ff  2025-05-16  Ömer Sinan Ağacan  Update protobuf changelog with `#981` (dart-lang/protobuf#995)

test (https://github.com/dart-lang/test/compare/55d1f9e..b9c59ea):
  b9c59ea0  2025-05-13  Liam Appelbe  Set a debug name for test isolates (dart-lang/test#2494)
  a1e295b4  2025-05-13  Liam Appelbe  Fix CI
  3c3878af  2025-05-13  Liam Appelbe  Include the test URI in the debug name
  90e64ec2  2025-05-13  Nate Bosch  Bump version
  d67c897b  2025-05-13  Liam Appelbe  Merge branch 'master' into isolate_debug_name
  e6d4877e  2025-05-12  Jacob MacDonald  release test packages (dart-lang/test#2495)
  4097e1be  2025-05-07  Liam Appelbe  revert workflow debugging
  7800c010  2025-05-07  Liam Appelbe  fmt
  455483b5  2025-05-07  Liam Appelbe  changelog
  c9b5b6fa  2025-05-07  Liam Appelbe  fmt
  39c4b31d  2025-05-07  Liam Appelbe  Set a debug name for test isolates

vector_math (https://github.com/google/vector_math.dart/compare/0279cb8..13f185f):
  13f185f  2025-05-16  Kevin Moore  Remove prefer-inline for non-trivial Matrix functions (google/vector_math.dart#347)

webdev (https://github.com/dart-lang/webdev/compare/1ea8462..5dbb30e):
  5dbb30eb  2025-05-12  Jessy Yameogo  Support hot reload over websocket (dart-lang/webdev#2616)

Change-Id: I85b001857d0864bd50390d82aa142938a4c530d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428927
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2025-05-16 17:03:12 -07:00
FMorschel 83eb816e51 [linter] Adds new switch_on_type lint
Fixes: https://github.com/dart-lang/sdk/issues/59546
Change-Id: Ib78714e03c1487376c961214910d10c24ec9f8ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-05-16 16:00:54 -07:00
FMorschel 46348af8ab [DAS] Fixes Removes unused local variable with awaited expressions
Fixes: https://github.com/dart-lang/sdk/issues/60663

Change-Id: I290f29c3a07e2f20cfd6e78e87b5543fa8131a9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426380
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-16 15:54:59 -07:00
FMorschel 3c6af25d4a [DAS] Fixes auto-complete import combinator update for enum constants
Fixes: https://github.com/dart-lang/sdk/issues/60565

Change-Id: I9bd4740b48569afe86c4a7f02412f5e50e654bfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423621
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-16 15:52:51 -07:00
Sam Rawlins dfaf1514ea linter: discarded_futures: do not report on await-in-synchronous function
When a synchronous function body has an `await` expression, we report
an error. We don't need to _also_ report a lint.

The noted error, `CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT`, already
is associated with the "add async" fix. Reporting a lint when an error
is also definitely reported is just double reporting.

Change-Id: If6d260a01cc654c87897480996d3f6f4b61373dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-16 15:34:20 -07:00
FMorschel 5b4dc61717 [DAS] Fixes coloring for record fields access in extension
Fixes: https://github.com/dart-lang/sdk/issues/60625

Change-Id: Idce84fbdc9b58b2e91c2e40a058bf466e8d5fb65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426342
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-16 14:57:15 -07:00
Kenzie Davisson 07680e9603 Add --disable-cors flag to DevTools server.
Required to fix https://github.com/flutter/devtools/issues/9176.

Change-Id: I6648a797a6ff4c22073ab49af5d584d2df52036a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429064
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2025-05-16 14:53:13 -07:00
DEPS Autoroller 2edd1064dc Roll Fuchsia Test Scripts from m6LxGKnUnAWW9p1s1... to L6SMsr0eTyQlN6KR4...
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-test-scripts-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 Test Scripts: 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: Ib1e801e9489041352cf7fb8743f32c2e46cb4be5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428440
Reviewed-by: Zijie He <zijiehe@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-05-16 14:49:11 -07:00
FMorschel 52dc876ebf [DAS] Fixes extension instance member occurrences
Fixes: https://github.com/dart-lang/sdk/issues/60626
Change-Id: Ia1050fe54f9c2ff208092b00ecccce678b7e616a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424688
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-16 13:58:19 -07:00
Sam Rawlins 08c541aa9c analyzer_plugin: support library_private_types_in_public_api lint rule
Luckily, the two cases which were reported could both be remedied by
making more things private.

* `DartFileEditBuilderImpl.librariesToImport` exposed `_LibraryImport`,
  but could be made private anyhow. Also, it's package-private code,
  so this is not a breaking change.
* `CodegenVisitor.generateConstant` accepted a private type as an
  argument, but the whole class can be made private.

Change-Id: I8613812385ed0e9a7e36922d86889dad4cedf3cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428924
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-16 13:45:57 -07:00
FMorschel ade4bf824a [DAS] Fixes record extension field completion
Bug: https://github.com/dart-lang/sdk/issues/60625
Change-Id: I23e4a5a85dc15059c9b1e658fb2fc3f868fa91a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-05-16 13:43:09 -07:00
Sam Rawlins b40b806bee DAS: enforce unnecessary_async lint rule
Change-Id: I05c6fbcc5ea7dea37bb7a01a3492e5cd842d11ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428923
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-16 13:37:53 -07:00
Konstantin Shcheglov 93504c7e00 CodeGen. Support for DoNotGenerate.
Change-Id: I899322ce78ea68de27b6dc6e1bcfeb92fb925657
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428904
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-16 13:35:06 -07:00
Konstantin Shcheglov eb823d7e56 Fine. Separate requestedXyz in test expectations.
This was initially in https://dart-review.googlesource.com/c/sdk/+/428562,
but partially reverted to ease review of test expectations.

Change-Id: Ib13936042b7a24a33aec22846b1d01999016481a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429120
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-16 13:29:49 -07:00
Konstantin Shcheglov ca885680aa Elements. Update a few remained enclosingElement2 name references.
After: https://dart-review.googlesource.com/c/sdk/+/428860
Change-Id: I7183e3fcdf36241a183a0d2a988db86fe091f2ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428922
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 13:27:03 -07:00
Alexander Markov 02c465b580 [tfa,dyn_modules] Avoid adding abstract classes to the set of allocated classes
When constructor is annotated with an entry point pragma (including
pragmas coming from dynamic interface annotator), its enclosing class
should not be marked as allocated if it is abstract.

TEST=pkg/dynamic_modules with assertions enabled

Bug: https://github.com/dart-lang/sdk/issues/60743
Change-Id: I6bc5cd64ba4b74b12ad74917df5249f4671f1576
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428921
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-05-16 12:16:10 -07:00
DEPS Autoroller dd20de6044 Roll Fuchsia SDK from 28.20250506.3.1 to 28.20250512.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: Icf2296ccd50ffbd5f6735d0c609eaaa03ad39411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428140
Commit-Queue: Zijie He <zijiehe@google.com>
Reviewed-by: Zijie He <zijiehe@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-05-16 11:56:51 -07:00
DEPS Autoroller b1c1597be4 Roll BoringSSL from 45cab558a838 to 136284f8548b (1 revision)
https://boringssl.googlesource.com/boringssl.git/+log/45cab558a838..136284f8548b

2025-05-09 nharper@chromium.org Fix EVP verify documentation.

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: I10611b0537fda30d35d063944f38af6a4ef74fa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428141
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-05-16 11:06:11 -07:00
Paul Berry b700e36974 [analyzer] Don't panic if dart:core removed but not dart:async.
In VSCode, when the user hovers over a reference to `dart:core`
(e.g. an instance of a core type such as `String`), this triggers
VSCode to briefly open, and then close, one of the core files defining
the SDK; this in turn causes it to send notifications to the analysis
server to create and then destroy an overlay for the core SDK file.

This leads to a somewhat rare race condition: if the analyzer pumps
its event queue between receiving the notifications to create and
destroy the overlay, and there isn't adequate time in between these
two events for all active analysis drivers to re-build their library
readers, then what will happen is that
`LinkedElementFactory.removeLibraries` will get passed a `uriSet` that
contains `dart:core` but not `dart:async`. (The reason is because the
driver hasn't yet rebuilt the library cycles, so it doesn't know that
`dart:core` and `dart:async` are in the same cycle).

Before this change, `LinkedElementFactory.removeLibraries` contained a
safety check that would throw an exception if the `uriSet` ever
contained `dart:core` but not `dart:async`. Due to the race condition,
this safety check would occasionally fire, crashing the analyzer. (On
my machine, the crash would occur about once per day on average).

This safety check was incorrect (since it checked for a condition that
was thought never to occur, but in fact does occur). Also, it was not
necessary; since the only way for the race condition to occur is if
the driver hasn't yet rebuilt its library cycles, there is no harm in
removing just `dart:core` and not `dart:async`, as both have
previously been removed. And, indeed, the incorrect safety check has
always been followed by a (correct) safety check making sure that if
`dart:core` is ever removed, then after the removal, the set of
library readers is empty.

For the last month, I've been running a local build of the analyzer
with the incorrect safety check removed, and I haven't observed any
crashes.

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

Bug: https://github.com/dart-lang/sdk/issues/48051
Change-Id: I611269ea7596cc63af5eb77d5baf641454a9d315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428902
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-05-16 10:32:30 -07:00
Konstantin Shcheglov adb4a8a559 Elements. Deprecate InstanceFragment.xyz2, use 'xyz' instead.
Change-Id: I18331cc6a2cd0c9f01de79d8d5ea0178cd39dc16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-16 10:29:02 -07:00
Konstantin Shcheglov 78bc6da66c Elements. Deprecate InstanceElement.xyz2, use 'xyz' instead.
Change-Id: Ie12b7596b70c77fd2f08520a423eeaf3b6978326
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 10:24:25 -07:00
Konstantin Shcheglov 146f362c68 CodeGen. Generate AST resolveExpression()
Change-Id: Idc36c6c5b3b1b0791ab76b1b8bccb4da3bd74bb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-16 10:20:59 -07:00
Konstantin Shcheglov 07fe6950bb Elements. LibraryElementImpl extends ElementImpl2, not FragmentImpl.
Change-Id: Ibdadbd13238551b8ec70061bc0c24615831b1973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427305
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 10:12:42 -07:00
Sam Rawlins aa5f130ce8 linter: Remove analyzer impl export
This reduce's linter's exposure of private analyzer API, which will
help with making LintRule public API.

Change-Id: I5af1961cf6e7e6c8554962d055a2f311256e3895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428901
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-16 07:14:11 -07:00
Johnni Winther d56cabaf1f [cfe] Remove member/constructor iterators from NameSpace
This remove the iterators from the NameSpace interface and instead
collects the list of builders belonging to a library or declaration
directly inside these builders.

Adds ComputedNameSpace for import, export and prefix name spaces. This
allows for replacing a member and has a filteredIterator function. These name spaces are computed from import/exports and therefore need to be iterated through directly and replace builder when two builders collide.

Change-Id: Iec974656c5331498aa1cfca7973300ac6e044994
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428820
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-05-16 05:07:01 -07:00
Sergey G. Grekhov 843a9363b1 [co19] Roll co19 to 0486b097e09b1761d3d28317671e21496dd401c0
2025-05-15 sgrekhov22@gmail.com dart-lang/co19#3057. Add more promotion tests for extension types (dart-lang/co19#3184)
2025-05-14 sgrekhov22@gmail.com dart-lang/co19#3057. Add some promotion tests for extension types (dart-lang/co19#3183)
2025-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#3177. Ignore static warnings in non_ambiguity_A02_t01.dart (dart-lang/co19#3181)
2025-05-13 sgrekhov22@gmail.com dart-lang/co19#3057. Add promotion via assignment tests. Check top types. (dart-lang/co19#3167)
2025-05-13 sgrekhov22@gmail.com Fixes dart-lang/co19#3177. Fix typos, add issue number (dart-lang/co19#3178)
2025-05-12 sgrekhov22@gmail.com dart-lang/co19#3057. Add more reachability tests for `switch` (dart-lang/co19#3173)

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try
Change-Id: Id5da975045bc2205ca470c5e429b37bcb822f18b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428960
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2025-05-16 03:48:43 -07:00
Jens Johansen 57eea4fdcc [analyzer] Don't utf8-encode needlessly in ApiSignature.addString
Comparing a before and an after aot-compiled analysis server,
running each 25 times, via `pkg/front_end/tool/benchmarker.dart`:

```
out/ReleaseX64/dart pkg/front_end/tool/benchmarker.dart \
  --iterations=25 \
  --snapshot=pkg/analysis_server/bin/server.aot.2 \
  --snapshot=pkg/analysis_server/bin/server.aot.3 \
  --arguments="--disable-file-byte-store" \
  --arguments="--train-using" \
  --arguments="pkg/front_end/lib/"
```

(where `server.aot.2` is an aot-compile of the parent CL and
`server.aot.3` is an aot-compile with this CL) gets this result:

```
msec task-clock:u: -1.5762% +/- 0.7803% (-131.97 +/- 65.33) (8372.91 -> 8240.93)
page-faults:u: 0.7490% +/- 0.1986% (1161.20 +/- 307.82) (155028.84 -> 156190.04)
cycles:u: -1.6791% +/- 0.8074% (-586734139.48 +/- 282150958.07) (34944191636.32 -> 34357457496.84)
instructions:u: -2.0051% +/- 0.0614% (-926171189.36 +/- 28378206.66) (46190016825.56 -> 45263845636.20)
seconds time elapsed: -1.5786% +/- 0.7789% (-0.13 +/- 0.07) (8.39 -> 8.26)
seconds user: -1.5335% +/- 0.7902% (-0.12 +/- 0.06) (8.02 -> 7.89)
Scavenge(   new space) goes from 134 to 131
MarkSweep(   old space) goes from 1 to 0
Evacuate(store buffer) goes from 1 to 0
Notice combined GC time goes from 2766 ms to 2664 ms (notice only 1 run each).
```

This seems quite high and is more than I've gotten before rebases etc, so I'm guessing this has been lucky with GCs or something.

Running it on `pkg/analyzer/lib/` instead (only 5 times) I get:

```
msec task-clock:u: -2.1880% +/- 1.2579% (-227.09 +/- 130.55) (10378.74 -> 10151.65)
cycles:u: -2.2829% +/- 1.3197% (-988942892.00 +/- 571677673.33) (43320229255.60 -> 42331286363.60)
instructions:u: -1.9075% +/- 0.5803% (-1080089151.00 +/- 328577465.65) (56624410628.20 -> 55544321477.20)
seconds time elapsed: -2.1807% +/- 1.2533% (-0.23 +/- 0.13) (10.39 -> 10.17)
seconds user: -1.9061% +/- 1.4734% (-0.19 +/- 0.15) (9.94 -> 9.75)
Scavenge(   new space) goes from 168 to 164
MarkSweep(   promotion) goes from 17 to 15
MarkSweep(   old space) goes from 4 to 2
Notice combined GC time goes from 3228 ms to 3723 ms (notice only 1 run each).
```

which looks ~similar though so I don't know.

Change-Id: I21c9dd6fd5e122f65ec596551af8a2ec464d3920
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-05-16 02:07:22 -07:00
Jens Johansen 88db201efc [analyzer] Replace pathContext.relative inside LocatedGlob.matches
Comparing a before and an after aot-compiled analysis server,
running each 25 times, via `pkg/front_end/tool/benchmarker.dart`:

```
out/ReleaseX64/dart pkg/front_end/tool/benchmarker.dart \
  --iterations=25 \
  --snapshot=pkg/analysis_server/bin/server.aot.1 \
  --snapshot=pkg/analysis_server/bin/server.aot.2 \
  --arguments="--disable-file-byte-store" \
  --arguments="--train-using" \
  --arguments="pkg/front_end/lib/"
```

(where `server.aot.1` is an aot-compile without this CL and
`server.aot.2` is an aot-compile with this CL) gets this result:

```
msec task-clock:u: -5.2977% +/- 0.4313% (-466.26 +/- 37.96) (8801.11 -> 8334.86)
page-faults:u: -2.5748% +/- 0.1648% (-4094.76 +/- 262.07) (159032.16 -> 154937.40)
cycles:u: -5.5212% +/- 0.4440% (-2034156211.44 +/- 163567376.21) (36842412971.36 -> 34808256759.92)
instructions:u: -8.2456% +/- 0.0556% (-4125031082.64 +/- 27819990.07) (50026884750.04 -> 45901853667.40)
branch-misses:u: -4.2637% +/- 2.0984% (-5839704.08 +/- 2873998.26) (136961902.80 -> 131122198.72)
seconds time elapsed: -5.2895% +/- 0.4311% (-0.47 +/- 0.04) (8.82 -> 8.35)
seconds user: -5.5473% +/- 0.5002% (-0.47 +/- 0.04) (8.46 -> 7.99)
Scavenge(   new space) goes from 152 to 134
MarkSweep(   promotion) goes from 15 to 14
Notice combined GC time goes from 2804 ms to 2707 ms (notice only 1 run each).
```
Change-Id: Ib5070b3c037b30f96bb91b3536d85b85ebe0c30c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 01:28:25 -07:00
Paul Berry 929d058a1e Fix typo in demotion_and_type_of_interest_promotion_test.dart
Thanks to Lasse for pointing this out (see
https://dart-review.googlesource.com/c/sdk/+/427920/comment/0c3c5efc_f0a11a0f/).

Change-Id: Iea6dafd067d95651b9b7b80b5cff3979c1fd9989
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428843
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2025-05-16 01:04:31 -07:00
Chloe Stefantsova bd92c25d53 [model] Remove nullability messaging in subtyping error messages
The subtype checking mode that ignores the nullability and is enabling
the nullability-related messaging is to be removed. This CL cleans up
the test expectations for that change.

Change-Id: I39e1fbf40192d1434b87e38cbe00eb68a965f0df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428782
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-16 00:58:00 -07:00
Jens Johansen 0d4b08caaa [analyzer] Use QueueList by default in SourceFileEdit
Adding edits (e.g. via `dart fix --apply` are often done with
`List.insert(0, whatnot)` which takes O(n) time.
Here QueueList that can insert fast at both ends is used instead
(and we use `addFirst` instead of `insert(0)`.

On the example from
https://github.com/feinstein/google-i18n-address-dart.git we go from:

```
$ time dart fix --use-aot-snapshot --apply
[...]
249517 fixes made in 255 files.

real    3m55.810s
user    4m1.209s
sys     0m3.714s

(resetting)
$ time dart fix --use-aot-snapshot --apply
[...]
249517 fixes made in 255 files.

real    3m33.966s
user    3m37.588s
sys     0m2.058s

(resetting)
$ time dart fix --use-aot-snapshot --apply
[...]
249517 fixes made in 255 files.

real    3m36.525s
user    3m40.083s
sys     0m1.907s
```

to:

```
$ time dart fix --use-aot-snapshot --apply
[...]
249517 fixes made in 255 files.

real    0m9.970s
user    0m12.676s
sys     0m2.100s

(resetting)
$ time dart fix --use-aot-snapshot --apply
[...]
249517 fixes made in 255 files.

real    0m9.862s
user    0m12.926s
sys     0m1.797s

(resetting)
$ time dart fix --use-aot-snapshot --apply
[...]
249517 fixes made in 255 files.

real    0m9.612s
user    0m12.712s
sys     0m1.834s
```

Statistics on the `real` runtime:

```
    N           Min           Max        Median           Avg        Stddev
x   3       213.966        235.81       216.525     222.10033     11.941664
+   3         9.612          9.97         9.862     9.8146667    0.18363369
Difference at 95.0% confidence
        -212.286 +/- 19.1415
        -95.581% +/- 8.61838%
        (Student's t, pooled s = 8.44503)
```

For `lsp_many_prefer_single_quotes_violations_benchmark.dart --sizes=3200`:

Before from something like:

```
Initial analysis: 0.115654
First code action call: 0.835152
Subsequent action call 1: 0.538592
Subsequent action call 2: 0.561636
Select all code action call: 1.564402
```

After to something like:
```
Initial analysis: 0.086985
First code action call: 0.411660
Subsequent action call 1: 0.171566
Subsequent action call 2: 0.193708
Select all code action call: 1.107339
```

Statistics on 5 runs gives:

First code action call:

```
Difference at 95.0% confidence
        -0.44381 +/- 0.0261597
        -52.4602% +/- 3.09218%
        (Student's t, pooled s = 0.0179367)
```

Subsequent action call 1:

```
Difference at 95.0% confidence
        -0.381012 +/- 0.0195618
        -69.9139% +/- 3.5895%
        (Student's t, pooled s = 0.0134128)
```

Subsequent action call 2:

```
Difference at 95.0% confidence
        -0.360077 +/- 0.0265277
        -64.634% +/- 4.76173%
        (Student's t, pooled s = 0.0181891)
```

Select all code action call:

```
Difference at 95.0% confidence
        -0.405855 +/- 0.027662
        -26.7277% +/- 1.82169%
        (Student's t, pooled s = 0.0189668)
```

Change-Id: I3868afaa8c32a24c01c3a52bd8a53d5e8e4e3afe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427401
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-16 00:45:34 -07:00
Chloe Stefantsova 1f26ddfee2 [ffi] Account for position variance in converting native types
This CL introduces variance-dependent treatment of the `Handle` native
type when converting native types to Dart types. Since `Handle` can
represent any object, it should match any type. To achive that in
cases when `Handle` appears as the subtype in the subtype checks, it's
converted to `Never` in covariant positions and to `Object?` in
covariant ones.

TEST=existing

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

Change-Id: Ie16a210491ada80d21f4d0f1c0fa3b3804881ede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426880
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-15 22:53:41 -07:00
Konstantin Shcheglov 72b0d2d2af Fine. Use separate declaredXyz in InstanceItem.
This simplifies the implementation, even if makes it less cool.

Change-Id: I9418f959ca36455a1fff59cd4f980b319351d987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428562
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-15 19:26:43 -07:00
Konstantin Shcheglov 69cb105a5f Fine. Write separate declaredXyz in tests.
Change-Id: I6d87df7e19fde64063734aadf56456878d61353c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428842
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-15 18:28:49 -07:00
Konstantin Shcheglov 2db49488c1 CodeGen. Generate members of most leaf AstNodeImpl classes.
Every declaration annotated with `@generated` was generated. In the
current version there are `2180` such declarations. For comparison,
there are `2167` instances of `@override` in total, and `@generated +
@override` has `1576` instances, so we generate `72%` of all overrides.

The generator automatically formats and sorts `ast.dart` after applying
changes, so the result is nice and clean. We run a separate DAS instance
from the script to do this.

Things to improve in the future:

1. Generate for non-leaf classes.

2. Support for `DoNotGenerate`.

Change-Id: I05e6356c9aac68449d5117ad8fd533735f130c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-15 18:05:42 -07:00
Devon Carew e5a9b59973 Bump protobuf to 9bd149b40e3bd762d902f86a67889651bcb9486c
Changes:
```
> git log --format="%C(auto) %h %s" 7d2e615..9bd149b
 https://dart.googlesource.com/protobuf.git/+/9bd149b read from and generate grpc service metadata (991)
 https://dart.googlesource.com/protobuf.git/+/065d881 generate dartdocs for grpc services (993)
 https://dart.googlesource.com/protobuf.git/+/e2bd416 remove the api_benchmark/ package (992)
 https://dart.googlesource.com/protobuf.git/+/a6c8e56 Improve enum decoding -- alternative (981)
 https://dart.googlesource.com/protobuf.git/+/376c9ce Update README.md (990)
 https://dart.googlesource.com/protobuf.git/+/d5906e7 rev to 22.1.0 in prep for publishing (989)
 https://dart.googlesource.com/protobuf.git/+/072f99d use super params in generated grpc service classes (988)

```

Diff: https://dart.googlesource.com/protobuf.git/+/7d2e615086c973b0186802ca0b1db575d34d50ac..9bd149b40e3bd762d902f86a67889651bcb9486c/
Change-Id: Ib0586ce884c8b70301a9490e5682f19b5c27b830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428882
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-15 17:01:01 -07:00
Sam Rawlins bd700772ff analyzer: move testing utilities to analyzer_testing package
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: Iae062d95e5cf3b94b540496242b3627268ac2612
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428844
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-15 16:28:50 -07:00
Sam Rawlins 22453ba77f linter: deprecate AnalysisRule.lintCode
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: Iedf1127b9f04aec910647c7f35597f38c6bfe1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428846
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-15 16:20:11 -07:00
Alexander Markov d039e2865b [tfa,aot,dart2wasm] More precise intersection of a wide cone type with an empty cone type
When cone type has a large number of allocated subtypes, TFA uses
symbolic wide cone type as a faster approximation to speed up
the analysis.

Intersection of wide cone type C1+ with cone type C2+ when
there is no subtyping relation between C1 and C2 results in
approximate type C1+. As a result, analysis may fail to determine
that certain type test will never succeed.

This change improves precision of cone and wide cone intersections
and unions in case cone type has an empty specialization
(no allocated subtypes).

TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_60733.dart
Fixes https://github.com/dart-lang/sdk/issues/60733

Change-Id: I51287d38a9e5f3c0ce88dab358d0825843a0de03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428840
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-05-15 15:37:25 -07:00