Commit Graph

100820 Commits

Author SHA1 Message Date
Sam Rawlins cfc705ce09 Introduce analysis_server_plugin package; replacement for server_plugin
We have chosen a new name for this package. So before we write more
code inside, we need to move everything from 'server_plugin' to
'analysis_server_plugin'. There are some steps do doing so, to not
break various infra:

1. Land this change, introducing the new package in the SDK, but no
   dependencies on it.
2. Land this change independently in google3 (the package is not
   yet "unbundled.")
3. Mark the package as "unbundled" in google3.
4. Move all code from server_plugin to analysis_server_plugin; update
   imports; and delete server_plugin.
5. Remove server_plugin as an "unbundled" package; and remove
   server_plugin from google3.

Bug: https://github.com/dart-lang/sdk/issues/53402
Change-Id: I70197fdf61dd5862c2220d8ed5dd0880a1593ead
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-19 01:38:29 +00:00
Nate Biggs 43fa24f839 [dart2js] Use deferred reads for standalone dump info.
Change-Id: I43492255a1d9db67a95a1c3ed347640d5e66bbc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363542
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-04-19 01:02:38 +00:00
Konstantin Shcheglov c470a835a8 Augment. Update 'augmented' members while building elements.
Found out while working on enum constants merging that we need to
have correct InterfaceScope during ReferenceResolver, before
TypesBuilder.

Change-Id: I5b495e2cd143192329b5bf37c86405c16de7d56c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363487
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-19 00:58:15 +00:00
Nicholas Shahan 061004f83f [ddc] Cleanup old setBaseClass()
With the new type system type arguments appearing in extends are
no longer represented by a class definition and do not need to
trigger any lazy logic.

Change-Id: I3f80f9f972bec69c678909c12d25a604a8fe2c59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353205
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2024-04-18 23:21:07 +00:00
Konstantin Shcheglov e12b3d0ee5 Completion. Issue 55505. Fix for completion in property access target in assignment begin.
Bug: https://github.com/dart-lang/sdk/issues/55505
Change-Id: I26bde2ab84d7216218ba9aed75b7561ed30c9c30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-18 23:13:16 +00:00
Konstantin Shcheglov af8b4e2e0f Extension type. Issue 55484. Fix for crash on super() in extension type constructor.
Bug: https://github.com/dart-lang/sdk/issues/55484
Change-Id: I9f6b11333549ce08ebd43367979086f3787b3a7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363621
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-18 23:13:01 +00:00
pq bb702d4f82 augmentation test for prefer_generic_function_type_aliases
See: https://github.com/dart-lang/linter/issues/4942

If I'm reading the spec right, this should be legal but is just not yet supported by the parser.

Change-Id: I793cf237683c296c6db49cc9ba614a945433da06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363622
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-04-18 23:05:13 +00:00
pq e90210be10 augmentation support for overridden_fields
Fixes: https://github.com/dart-lang/linter/issues/4930

Change-Id: Iee270a59ab3ba76f414a7d743aad92559808a948
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363640
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-18 23:04:58 +00:00
William Hesse 2a265c183d Revert "Bump web_socket_channel to b612fc2caa9f4c3c8947b4ffbb274bce33c54a04"
This reverts commit 4d6919aa5e.

Reason for revert: This adds additional transitive dependencies to the 
web_socket_channel package, which must be added to Flutter engine packages before landing.  Please run the flutter-linux-try bot before rolling internal packages. See failure on https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/flutter-linux-host_debug/7089/overview
Original change's description:
> Bump web_socket_channel to b612fc2caa9f4c3c8947b4ffbb274bce33c54a04
>
> Changes:
> ```
> > git log --format="%C(auto) %h %s" ced3a37..b612fc2
>  https://dart.googlesource.com/web_socket_channel.git/+/b612fc2 Avoid importing io_web_socket namespace (343)
>  https://dart.googlesource.com/web_socket_channel.git/+/ce69d31 Rename WebSocketAdapterWebSocketChannel to AdapterWebSocketChannel (344)
>  https://dart.googlesource.com/web_socket_channel.git/+/429e7d9 Implement IOWebSocketChannel as a WebSocketAdapterWebSocket subclass (342)
>  https://dart.googlesource.com/web_socket_channel.git/+/00cb13a Remove WebSocketChannel constructor (341)
>  https://dart.googlesource.com/web_socket_channel.git/+/1f3dfd7 Create an adapter for `package:web_socket` (339)
>
> ```
>
> Diff: https://dart.googlesource.com/web_socket_channel.git/+/ced3a37193f89d5ee95792f342eeb15d3d55d8c1..b612fc2caa9f4c3c8947b4ffbb274bce33c54a04/
> Change-Id: I558a25a5f8cbe0704e40b7e60886c8934f04d2e8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362662
> Reviewed-by: Nate Bosch <nbosch@google.com>

Change-Id: I91c1935a68570d18385207d0de4000213143c4ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363660
Auto-Submit: William Hesse <whesse@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-04-18 22:33:17 +00:00
Alexander Aprelev 6011eb98d9 [vm] Fix isNegative on x64 and ia32.
Only one sign bit should be checked, other might contain sign of some garbage and should be ignored.

The issue manifested itself on unrelated cl on co19/LibTest/math/pow_A11_t01 test https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8750395319897344289/+/u/test_results/new_test_failures__logs_

TEST=ci

Change-Id: Id40a7eb1e5f1949a1c285968fffe55d80cf434a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363502
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-04-18 21:29:49 +00:00
Elliott Brooks 51e8a74f07 [DDC] During hot-restart, wait to run main if the promise readyToRunMain is provided
Bug: https://github.com/flutter/devtools/issues/7231
Change-Id: Iebd1caa62cff4f41a226d7214c7a8ae330ed02c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355880
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
2024-04-18 21:22:15 +00:00
Nate Biggs 215323ad51 Fix broken links in dart:html package.
Fixes: https://github.com/dart-lang/sdk/issues/50247
Change-Id: Ia43cef267fa9f82702892c3a27cbaa81d71386c7
CoreLibraryReviewExempt: Doc update
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363440
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-18 18:10:45 +00:00
Sam Rawlins 88b7f0802d linter: Fix documentation for avoid_void_async
Fixes https://github.com/dart-lang/linter/issues/3119

Fixes a rendering issue here with raw HTML:
https://dart.dev/tools/linter-rules/avoid_void_async

Documents https://github.com/dart-lang/linter/issues/4941

Also deduplicates the implementation code.

Also, the test cases were not grouped very well. I grouped them,
removed a few duplicates, added some missed cases.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I4a0b91c85bd8a359388a26d38b7f084ae9909f5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-18 17:39:25 +00:00
Sam Rawlins 33b97140fb DAS: Move CorrectionUtils.selectionIncludesNonWhitespaceOutsideNode into extract_method
Bug: https://github.com/dart-lang/sdk/issues/53402
Change-Id: I4fca3482c27520328339d1d1f0b6b541399ed612
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-18 17:32:21 +00:00
Brian Quinlan 4d6919aa5e Bump web_socket_channel to b612fc2caa9f4c3c8947b4ffbb274bce33c54a04
Changes:
```
> git log --format="%C(auto) %h %s" ced3a37..b612fc2
 https://dart.googlesource.com/web_socket_channel.git/+/b612fc2 Avoid importing io_web_socket namespace (343)
 https://dart.googlesource.com/web_socket_channel.git/+/ce69d31 Rename WebSocketAdapterWebSocketChannel to AdapterWebSocketChannel (344)
 https://dart.googlesource.com/web_socket_channel.git/+/429e7d9 Implement IOWebSocketChannel as a WebSocketAdapterWebSocket subclass (342)
 https://dart.googlesource.com/web_socket_channel.git/+/00cb13a Remove WebSocketChannel constructor (341)
 https://dart.googlesource.com/web_socket_channel.git/+/1f3dfd7 Create an adapter for `package:web_socket` (339)

```

Diff: https://dart.googlesource.com/web_socket_channel.git/+/ced3a37193f89d5ee95792f342eeb15d3d55d8c1..b612fc2caa9f4c3c8947b4ffbb274bce33c54a04/
Change-Id: I558a25a5f8cbe0704e40b7e60886c8934f04d2e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362662
Reviewed-by: Nate Bosch <nbosch@google.com>
2024-04-18 17:23:19 +00:00
Sam Rawlins a862d9d745 analyzer: Correct message about const addition operator
Fixes https://github.com/dart-lang/sdk/issues/54578

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Fixed: 54578
Change-Id: Iebc9e04539a172e58024758e33ffd93e48cb1a81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-18 17:21:29 +00:00
Devon Carew 24631f5131 [deps] rev dartdoc, usage, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/f339b09..592694e):
  592694e0  2024-04-18  Sam Rawlins  Remove redundant ModelElement.filePath implementations (dart-lang/dartdoc#3751)
  46947ba6  2024-04-16  Sam Rawlins  Rename Library.allClasses; tidy other collections (dart-lang/dartdoc#3747)
  820505ee  2024-04-15  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (dart-lang/dartdoc#3749)

usage (https://github.com/dart-lang/usage/compare/09cab89..2847cdb):
  2847cdb  2024-04-17  Kevin Moore  Readme: fix status badge (dart-lang/usage#204)

webdev (https://github.com/dart-lang/webdev/compare/7d0d2d4..3a10b76):
  3a10b76f  2024-04-17  Elliott Brooks  Update DDS dependency to ^4.1.0 (dart-lang/webdev#2411)
  f73fe1ce  2024-04-17  Elliott Brooks  Update DDS to ^4.0.0 (dart-lang/webdev#2409)
  cfd5a6b9  2024-04-16  Elliott Brooks  Indicate whether an app is a Flutter app via the app ID (dart-lang/webdev#2406)

Change-Id: I4230dad426a23efb84d959fd9dccb78388c3f501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363483
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-04-18 16:52:23 +00:00
Ryan Macnak 5187dbfffe [vm] Update gdb helpers.
- Take raw addresses instead of ObjectPtr. gdb seems to sometimes not understand how to do the cast.
 - Use newer "retain" attribute to disable linker GC instead of exporting a dynamic symbol.
 - Add helper to get the current thread. Directly accessing dart::OSThread::current_vm_thread_ doesn't work.
 - Add helper to find the function or stub for a PC and disassemble.

TEST=gdb
Change-Id: I3825a820194673a9a9d5153cd0e0cf175acab5f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363403
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-04-18 16:35:58 +00:00
Jake Macdonald d82385e372 drop chmod operations, should not be necessary
Bug: https://github.com/dart-lang/sdk/issues/55460
Change-Id: Ic811ff55e4af023ed00e9e2b32b907ef2253114b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363540
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2024-04-18 16:34:16 +00:00
Kevin Moore 7df98cd150 FE server: drop dependency on pkg:usage
Inline trivial usage of UUID
Copied from https://github.com/dart-lang/usage/blob/2847cdb94e238a921c600e81b52c91baf4ea0b50/lib/uuid/uuid.dart

We could almost certainly DROP UUID here for some other random string
generator.

Change-Id: Ib50023b497dd02c469b4ead9139b0dc3d42cc379
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363405
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-04-18 16:25:28 +00:00
Sam Rawlins a5fb950f97 DAS: Move CorrectionUtils.indentLeft and indentRight near their call sites
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Bug: https://github.com/dart-lang/sdk/issues/53402
Change-Id: Id62b06f3419820d4a74b34b51a6022792bcef7ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363404
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-18 16:01:00 +00:00
Kevin Chisholm 82d5407d82 [docs] merge stable CHANGELOG to main
Change-Id: Id47bf18ea0354c36cf25e6040cb49209bade32fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363485
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
2024-04-18 15:59:01 +00:00
Kevin Moore 05764ff967 pkg/dartdev: drop pkg:usage
Remove unused events code that was the only thing referencing it

Change-Id: I1a0a4f40b95c2a1d3c8f0812ca278a282d9f4134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363424
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2024-04-18 15:51:34 +00:00
Alexander Markov 20029533b8 [vm/compiler] Fix stack map for the catch block entry PC
Parameters of catch block entry corresponding to the exception and
stack trace are live only after catch block entry, and they should not be
scanned by GC if it occurs at catch block entry PC before control is
transferred to the catch block.

TEST=runtime/tests/vm/dart/regress_55442_test.dart
Fixes https://github.com/dart-lang/sdk/issues/55442

Change-Id: I09b8152544eb14187ad62a11902e080d41722bf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363423
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-04-18 13:42:21 +00:00
Alexander Markov ab036dc4da [vm/compiler] Fix aliasing of typed data view indexed accesses
When calculating an alias for an indexed access to a typed data
view X[i], pick a more generic alias *[i] as it may potentially
alias another typed data indexed access.

TEST=lib/typed_data/typed_data_load2_test
(in vm-aot-optimization-level-linux-release-x64 configuration)

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

Change-Id: I44b494cd40d0c8b8f93fac92f042081b818cb1de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363401
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-04-18 13:35:09 +00:00
Alexander Markov 6d4817b147 Disable --no-sound-null-safety in 'dart compile', front-end server and gen_kernel
Change 'dart compile', front-end server and gen_kernel tools to reject
--no-sound-null-safety option as unsound mode is no longer supported.

TEST=ci

Change-Id: I4f6e87865bf206a27958caee4088272b4e397608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-18 13:34:17 +00:00
Daco Harkes 3eb9f5374e [vm] Fix clang-tidy warning
The clang-tidy check in PRESUBMIT.py is only run on Linux x64 hosts,
so CLs uploaded from other machines can introduce clang-tidy lint
violations.

Running `git cl presubmit --files="runtime/*.cc;runtime/*.h"` revealed
one violation in `runtime/vm/compiler/ffi/unit_test_custom_zone.cc`.

This file is not part of the normal build only of cc unit tests, so
it is built with different ifdefs which are not supplied from the
`run_clang_tidy.dart` script, so skip it.

Change-Id: Iddf0256625a092038f4a908ac5311a2dc9a8d62b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363561
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-04-18 10:22:01 +00:00
Sigurd Meldgaard da5d1e556d Bump pub to 55cc6c138ad4777cf4fc0710c55dc37a33fdcd69
Changes:
```
> git log --format="%C(auto) %h %s" f3b1199..55cc6c1
 https://dart.googlesource.com/pub.git/+/55cc6c13 Avoid trying to do suggestions for workspaces (4229)
 https://dart.googlesource.com/pub.git/+/55a2f81e Make solve traces more precise for workspace members (4228)
 https://dart.googlesource.com/pub.git/+/e3ba2767 Enable workspaces from dart 3.5 (4226)
 https://dart.googlesource.com/pub.git/+/45e58699 Normalize whitespace in stacktrace golden (4220)
 https://dart.googlesource.com/pub.git/+/3f18ccab Update package:args, more consistent helper usage (4219)
 https://dart.googlesource.com/pub.git/+/2eb464ac Report failure if package is included twice in same workspace (4211)
 https://dart.googlesource.com/pub.git/+/bd734377 Handle whole workspace in `pub upgrade [--tighten|--major-versions]` (4213)
 https://dart.googlesource.com/pub.git/+/9d6cd8a4 Show parent pubspecs when a pubspec could not be found. (4197)
 https://dart.googlesource.com/pub.git/+/868e70e4 Error reporting for bad workspace paths (4201)
 https://dart.googlesource.com/pub.git/+/4317ce15 Filter content hashes from golden files (4210)
 https://dart.googlesource.com/pub.git/+/7a37d7c2 Merge pull request 4207 from sigurdm/merge-cherry_pick_binstub_fix
 https://dart.googlesource.com/pub.git/+/8e91dcc4 Merge remote-tracking branch 'origin/cherry_pick_binstub_fix' into merge-cherry_pick_binstub_fix
 https://dart.googlesource.com/pub.git/+/ed20b455 Fix package name when refreshing binstubs (4205)

```

Diff: https://dart.googlesource.com/pub.git/+/f3b1199fcab37a197f2980bf6b28e421e7bce771..55cc6c138ad4777cf4fc0710c55dc37a33fdcd69/
Change-Id: I4613569cd1f8248fb8705b9022a05c82ee743d8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363300
Commit-Queue: Sarah Zakarias <zarah@google.com>
Auto-Submit: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sarah Zakarias <zarah@google.com>
2024-04-18 09:21:58 +00:00
Ömer Sinan Ağacan a2e3063250 [dart2wasm] Remove redundant allocation in JSStringImpl.toString
Also removes a redundant variable.

Change-Id: I6ff36f2a007f4248b9ec4b3c1fc3fe78a2bb6e85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363560
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-04-18 09:07:54 +00:00
Ömer Sinan Ağacan eabb2b3aca [dart2wasm] Catch JS exceptions in async functions
When generating `try` block around a CFG block of an async state
machine, generate `catch_all` if the Dart `catch` blocks wrapping the
CFG block can catch JS exceptions.

`catch_all` bodies are identical to the `catch` bodies we already
generate.

The check for whether to generate `catch_all` is reused from the
non-async code generator without changes.

Fixes #55457.

Change-Id: I9d89593599da592106e12efb77c07d68b6cfce5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-04-18 08:57:39 +00:00
Martin Kustermann a133b75438 [dart2wasm] Enable weak reference / finalization tests on dart2wasm
This enables the currently dart2js/ddc-only tests for [WeakReference] /
[Finalizer] on dart2wasm.

As part of that we add a polyfill for the two implementations (just like
dart2js/ddc) do, to make the polyfill test pass.

We also migrate the implementation to use static interop.

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

TEST=tests/web/wasm_js_shared/weak_reference_*test.dart

Change-Id: Ic08ae41b6fc78fd9857172ca24695a7f91e06a78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363082
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-04-18 07:55:38 +00:00
Ömer Sinan Ağacan 7e237a12aa [dart2wasm] Small refactoring in async code generator
Use a `for` loop instead of `while` when iterating `try` blocks
generated for a CFG block, and when iterating finalizers covering the
CFG block, to make it clear which variables are loop variables and how
they are updated.

Also clarifies a documentation.

Change-Id: I6ee205285b219acb4811ee665e3b28d25331d598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362980
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-04-18 07:44:44 +00:00
Konstantin Shcheglov ad8f4b0f3d Issue 55495. Fix renaming extension types when and the end of the name.
Bug: https://github.com/dart-lang/sdk/issues/55495
Change-Id: I4db31e8a97a201fa00372f3d033d50ef79ca0941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-17 22:26:49 +00:00
Sam Rawlins 5c79627e08 Move CorrectionUtils addLibraryImports to ExtractMethod
`_getInsertionLocationTop` and `addLibraryImports` are each moved to
extract_method.dart, as the only location where they were used.

We get to delete the `_InsertionLocation` class.

The tests are also moved, unchanged, and CorrectionUtilsTest is very
much simplified.

Bug: https://github.com/dart-lang/sdk/issues/53402
Change-Id: Ia410f04a837d85a0e06ec523d156c6c6c8bf6a3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-17 22:12:28 +00:00
Konstantin Shcheglov 9a385638cd Augment. Basic support for enum elements..
Change-Id: I42e7b58f7edaa979740a8e5b6787665c7a79c54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-17 21:53:31 +00:00
pq 1b46b26f99 augmentation support for avoid_classes_with_only_static_members
Fixes: https://github.com/dart-lang/linter/issues/4931


Change-Id: I4194dd6e4d8790998b202bdb654b9a9d7a114104
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-04-17 20:50:55 +00:00
Derek Xu defa4d76a3 [CLI] Account for SDK version changes that happen between when resident frontend compilers are started and when they are used
TEST=test case added to pkg/dartdev/test/commands/run_test.dart

Issue: https://github.com/dart-lang/sdk/issues/54245
Fixes: https://github.com/dart-lang/sdk/issues/55349
Change-Id: Ic3db064d0975e6b999beefed8b6fc32d2c603cff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362522
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-04-17 20:48:55 +00:00
asiva 0165643fa7 Reland "[SDK] - Ensure we only build an AOT snapshot for the frontend-server"
This is a reland of commit e6c9eaaf6b

Original change's description:
> [SDK] - Ensure we only build an AOT snapshot for the frontend-server
>
> Currently we seem to build both the JIT and AOT snapshots of the
> frontend-server, ensure we only build the AOT snapshot on all
> architectures except IA32
>
> Change-Id: Ie79dc6d88fd9fa680267571e5d65081ca57609c6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359100
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: Id9a695f33e4e808463b4f65bdb3cd0e546a695d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363480
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-04-17 20:42:51 +00:00
Derek Xu 3ac8d60115 [VM/Service] Add a case that tests ReadStream.readUtf16
TEST=confirmed that the added test case fails when undoing the changes
made in package:vm_service 14.2.1

Issue: https://github.com/dart-lang/sdk/issues/55475
Change-Id: I189db9dda4c730199157432522323e34a6f87c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363441
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-17 19:47:29 +00:00
pq c109a1a2be augmentation support for avoid_field_initializers_in_const_classes
Fixes: https://github.com/dart-lang/linter/issues/4926

Change-Id: I517b0fbc65feabd55daa238afbad011b4c1fbd90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-04-17 19:26:28 +00:00
pq 54ef834f1b augmentation support for constant_identifier_names
Partially fixes: https://github.com/dart-lang/linter/issues/4933

Change-Id: Ia22ebdb3f68b3ce0ad2320a882379a702a941f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363421
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-17 19:20:08 +00:00
Daco Harkes f98a2138b7 [vm] Run clang-format on code base
When uploading CLs, the presubmit checks verify that the lines in the
diff are formatted correctly according to `git cl format runtime`.

However, when `buildtools/<os>-<arch>/clang/bin/clang-format` is
updated, it does not force reformatting of files that would be
reformatted.

This leads to two issues:
* Inconsistent style within the code base and within a single file.
* Spurious reformatting in CLs when (1) clang-format is used on the
  whole file, or (2) the diff lines overlap.

`clang-format` doesn't change that frequently, so in general this is
not a large issue, but I've seen a bit too many "spurious formatting,
please revert" comments on CLs recently.

This CL formats the runtime to be in line with the current pinned
`clang-format`:

```
$ find runtime/ -iname *.h -o -iname *.cc | xargs buildtools/mac-arm64/clang/bin/clang-format -i
```

`git cl format` (which only formats changed lines, and does so with
`clang-format`) seems to not agree with itself, or clang-format, or
cpplint in a handful of places. This CL adds `// clang-format off`
for these. (See previous patchsets for the specific instances.)

TEST=A variety of bots including GCC, MacOS and Windows.

Change-Id: I470892e898971899fda14bb3b8f2c8efefd67686
Cq-Include-Trybots: luci.dart.try:vm-gcc-linux-try,vm-ffi-qemu-linux-release-riscv64-try,vm-ffi-qemu-linux-release-arm-try,vm-aot-win-debug-x64-try,vm-win-debug-x64c-try,vm-mac-debug-x64-try,vm-mac-debug-arm64-try,vm-aot-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362780
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-04-17 19:14:41 +00:00
Tess Strickland 2d49ca0204 [vm] Simplify root unit checks in snapshot deserialization.
Previously, there were two ways to determine whether a deserialization
cluster was being deserialized for the root loading unit or a non-root
loading unit:

* some deserialization clusters (those deriving from
  CanonicalSetDeserializationCluster) took a boolean at construction
  time, and
* all deserialization clusters took an additional boolean argument to
  ReadFill and PostLoad on whether the loading unit was primary (i.e.,
  the root) or not.

Since only clusters that deal with canonical values need to worry about
whether the deserializing loading unit is the root or not, standardize
on the first, where clusters that need to know take the boolean in their
constructor and store it in a field, and remove the boolean argument to
ReadFill and PostLoad.

Have DeserializationCluster::PostLoad just check is_canonical() to
determine whether to throw an error if not overridden in the base class,
so that any deserialization cluster that may operate on canonical
objects needs to explicitly make a choice about whether they need to
recanonicalize or not. This check only happens in the precompiled
runtime, as otherwise there are no non-root loading units.

In particular, this fixes an issue where symbols (canonical strings)
in non-root loading units weren't marked as canonical, even though
they do not need recanonicalization (since symbol tables are
per-isolate group, and thus per-loading unit).

TEST=ci (refactoring, test of symbol fix coming in followup CL)

Cq-Include-Trybots: luci.dart.try:vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try
Change-Id: I411a254767653da82631abc1fcc687ae4259e0b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363321
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-04-17 18:30:20 +00:00
Nate Biggs 226f862be1 [dart2js] Fix broken dart2js_batch_test.
Fixes: https://github.com/dart-lang/sdk/issues/55391
Change-Id: If4fdfb45348811d0f563baa30b68173b8ce0e444
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-04-17 18:29:43 +00:00
Brian Quinlan 9ea49e553b Bump http to 34d7087ed2361dbe68faae6af8e7874fb805311d
Changes:
```
> git log --format="%C(auto) %h %s" b7477b1..34d7087
 https://dart.googlesource.com/http.git/+/34d7087 Fix a StateError in IOWebSocket (1177)

```

Diff: https://dart.googlesource.com/http.git/+/b7477b1e1bc5c8f850299b7abcc58d08ddea9e4a..34d7087ed2361dbe68faae6af8e7874fb805311d/
Change-Id: Iea9db7b42b98c4b79f9fe8c20ee31b3c775fb216
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363361
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-04-17 18:19:41 +00:00
Sam Rawlins 1dd5b46dab linter: use_rethrow_when_possible: fix false positives
Fixes https://github.com/dart-lang/linter/issues/4940

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I99fa59981e081f08c46bea5e6bd24338f34a3ca2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363360
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-17 18:17:50 +00:00
Alexander Markov 4e17077128 [vm] Cleanup obsolete VM flags
The following flags are removed:
* --null-assertions
* --strict_null_safety_checks
* --lazy_async_stacks

TEST=ci

Change-Id: Ibb390d4f85e0e97faa8dd72f6d964e6af0274cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363110
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-04-17 17:30:49 +00:00
Danny Tuppeny 0b170c759e [analysis_server] Don't expand variable declarations to their lists if multiple variables in LSP definitions
VS Code uses the definition range to show a preview of the hovered item (when holding `ctrl`). We usually expand a variable declaration to the parent list so that this preview includes "var", "final" and/or any type.

However, if the list contains multiple variables, this resulted in us showing other variables in the preview too which is confusing/misleading.

This change keeps the original behaviour for VariableDeclarationLists with only a single variable, and otherwise keeps the specific variables range.

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

Change-Id: I9e3cfd672f51040b60f9791ba89a937d5733c628
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-04-17 17:24:29 +00:00
Daco Harkes c0b938c228 [vm/ffi] Fix variadic arguments on MacOS Arm64
Non-variadic arguments on the stack on MacOS Arm64 are aligned to
the value size (which can be smaller than word size). However, for
varargs, the arguments on the stack seem to be aligned to the word
size.

This CL introduces an alignment strategy constant for primitives on
the stack in varargs and uses it in the native calling convention
calculation.

TEST=runtime/vm/compiler/ffi/native_calling_convention_test.cc with
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_macos.expect

TEST=tests/ffi/function_varargs_generated_native_leaf_test.dart

Closes: https://github.com/dart-lang/sdk/issues/55471
Change-Id: I51d20c3933a2cea9b110954ddec92fb91b9c3ecd
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362762
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-04-17 15:42:16 +00:00
Konstantin Shcheglov 4bb644ce3e Augment. Parse enum constant augmentations, allow just ';' before methods.
I was unable to update the parser to avoid requirement for ';' at all.
Ideally we should be able to parse:
```
enum E {
  void foo()
}
```

Change-Id: I7edba99454b965407c3fb402642933b3d8d6bb7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363106
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-17 15:26:31 +00:00