Commit graph

101369 commits

Author SHA1 Message Date
Ryan Macnak 3da6b50905 [infra] Add configurations for ARM64 sanitizer testing.
Runs only the ffi test suite with no shards due to limited capacity. Runs JIT and AOT on the same builder to avoid building twice without RBE.

Change-Id: I1cebff950d89b3302169e9e4cdb68772cd8bf413
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365865
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-17 16:57:13 +00:00
Jonas Finnemann Jensen 08132157c9 Update Dart-GSoC-2024-Project-Ideas.md
Closes https://github.com/dart-lang/sdk/pull/55759

GitOrigin-RevId: 0cd1a55d048ba3ef807d6e84f10e5dcb36173d9a
Change-Id: I94eed117c0c2efb7542dbfdf5b4b140cc6959bde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366964
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-05-17 15:52:01 +00:00
pq 2db847f934 quick-fix for LATE_FINAL_LOCAL_ALREADY_ASSIGNED
Change-Id: I1f6be714db78de12e38502b694ecaef8c296e57d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366888
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-17 15:44:01 +00:00
pq c295496851 quick-fix for NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS
Change-Id: I0213b8a82d253cb2fbacd5c4331aaffe94f0a160
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366889
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-17 15:43:58 +00:00
Devon Carew 905e5468c5 Bump tar to b62573f39a4de28f69d9ed82b02fbd96b12b9633
Changes:
```
> git log --format="%C(auto) %h %s" 6150a0c..b62573f
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/b62573f Migrate to recommended lints
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/11f2f82 Merge pull request 33 from jonasfj/patch-1
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/53aceb0 Add `topics` to `pubspec.yaml`

```

Diff: 6150a0c88d..b62573f39a/
Change-Id: Id068b88d438b4830c5461bae19fb0b1a8a57ba29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366962
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2024-05-17 13:08:45 +00:00
Martin Kustermann 8fa0675a6d [dart2wasm] Make optimized builders run with --use-sdk (and therefore dart compile wasm)
This gives some more coverage for `dart compile wasm`

Change-Id: I62e7f9c6ecbdf80a1445c35d1733a7f89e6bcf54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366623
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-17 13:08:31 +00:00
Jonas Finnemann Jensen 160b9eadb3 Create a variant of EnumSet that works when compiled to js
Fixed: 54468
Change-Id: I36d3b8789695ef6a74a32c6801ec5c8c19aae381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366822
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
2024-05-17 12:35:49 +00:00
Martin Kustermann e6e9b4e595 [dart2wasm] Only share type parameter fields if nullability allows
Closes https://github.com/dart-lang/sdk/issues/55741

Change-Id: I1e542041496d07714431ed40871031a117030736
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366940
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-17 12:07:56 +00:00
Sigurd Meldgaard c91b5edf1c Bump pub to e70850b53ef9b15a08af7fb0f0f2dcdbfa762b34
Changes:
```
> git log --format="%C(auto) %h %s" 84895ca..e70850b
 https://dart.googlesource.com/pub.git/+/e70850b5 Fix flutter version update on fast path (4272)

```

Diff: https://dart.googlesource.com/pub.git/+/84895ca4c52df5ecc7dd4d439365c3045b7c2165..e70850b53ef9b15a08af7fb0f0f2dcdbfa762b34/
Change-Id: I540440a6c6fa828c421952870d56375b15ba381a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367024
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2024-05-17 11:42:50 +00:00
Martin Kustermann 328ae02be1 [dart2wasm] Remove --dart-sdk option from various places
The CFE's [CompilerOptions] object currently has 3 properties

* `CompilerOptions.sdkDir`: The sdk directory
   => Will use `<sdkDir>/lib/libraries.json` to compile corelibs

* `CompilerOptions.librariesSpecPath`: The libraries.json file
   => Will compile corelibs using this libraries.json

* `CompilerOptions.sdkSummary`: The platform.dill file
   => No need to compile corelibs as platform file is given.

=> Passing any of these is sufficient for the CFE to run.

This CL therefore mandates that either one passes the platform file or
the libraries.json file to dart2wasm. There's no need to also accept the
sdk dir.

As flutter still passes `--dart-sdk` (as well as platform file) - we
simply ignore that flag for the moment, until flutter's usage was
removed.

Change-Id: I4c3b1a7bf87f98e51ceb2e6adfaec4f4a6ce2202
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366821
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-05-17 11:31:58 +00:00
Johnni Winther 60a52f66f5 Revert "[CFE] Coverage on try bot"
This reverts commit 4ab652b38f.

Reason for revert: Causes timeouts locally and on trybots for other CLs.

Original change's description:
> [CFE] Coverage on try bot
>
> This runs the strong suite, does coverage, and compares the coverage
> (percentage) to the (hardcoded) expected percentage.
>
> Change-Id: I2e7511d7841b19c15139a7c84bf0861b56b81ccc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366340
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Jens Johansen <jensj@google.com>

Change-Id: I1afcb77bd44dc785bcf445ec041ab633fe7277a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367022
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-05-17 10:53:17 +00:00
Martin Kustermann d63a5f2a04 [dart2wasm]/[vm] Use inferred return types of methods in dart2wasm
* Make TFA annotate members with inferred return types
  => We introduce new `vm.inferred-return-type.metadata`
* Make dart2wasm use inferred return types for wasm signatures

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

TEST=Updated expectation files.

Change-Id: If2478255c2bb2633348f475b157f28581481578f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366540
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-17 10:30:31 +00:00
Sigurd Meldgaard 57a7ad165e Bump pub to 84895ca4c52df5ecc7dd4d439365c3045b7c2165
Changes:
```
> git log --format="%C(auto) %h %s" e184bfc..84895ca
 https://dart.googlesource.com/pub.git/+/84895ca4 Fix fast path check of ensureUpToDate (4271)
 https://dart.googlesource.com/pub.git/+/89e386bc Rewrite `getExecutableForCommand` tests to test with an external process. (4268)
 https://dart.googlesource.com/pub.git/+/7ab4020e Connect to _PUB_TEST_DEFAULT_HOSTED_URL instead of pub.dev when testing (4270)
 https://dart.googlesource.com/pub.git/+/c2592b3e Use lint unreachable_from_main to avoid dead code (4244)
 https://dart.googlesource.com/pub.git/+/a87b84dc Allow invoking `getExecutableForCommand` everywhere in workspace (4257)
 https://dart.googlesource.com/pub.git/+/a284c9b3 Remove debug logging statements (4267)

```

Diff: https://dart.googlesource.com/pub.git/+/e184bfc725793cbbf222fa8d8f96da10c40af24a..84895ca4c52df5ecc7dd4d439365c3045b7c2165/
Change-Id: I1eacbe85bd1016099575af06751205a94f988b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367000
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2024-05-17 08:50:30 +00:00
Martin Kustermann 3b02e41af1 [dart2wasm] Make dart compile wasm accept --enable-experiment flags and pass those to compiler
This is a preparation for making CI bot to run using `dart compile wasm`
instead of `pkg/dart2wasm/tool/compile_benchmark`.

Change-Id: I804d9392a8993cddc7a01afdd345ba9ee9a83374
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366820
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2024-05-17 08:29:20 +00:00
sgrekhov c03aa10f6d [co19] Roll co19 to ce52bad581af26062e8da7bdb0b0c5a5fc89ec7e
2024-05-16 sgrekhov22@gmail.com dart-lang/co19#2641. Rename `unchanged` -> `other_declarations` (dart-lang/co19#2670)
2024-05-16 sgrekhov22@gmail.com dart-lang/co19#2641. Check that it is still an error to declare more than one class member named `_` (dart-lang/co19#2669)
2024-05-15 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for multiple top-level declarations named `_` (dart-lang/co19#2667)
2024-05-15 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for unchanged type declarations named `_` (dart-lang/co19#2666)
2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for unchanged declarations named `_` (dart-lang/co19#2665)
2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for multiple declarations named `_` (dart-lang/co19#2656)
2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2661. Fix numerous typos in augmented_expression_A01_t09 (dart-lang/co19#2664)
2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2659. Make unique extension members names in augmenting_types_A05_t04 (dart-lang/co19#2662)
2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2660. Fix typos in augmented_expression_A01_t05 (dart-lang/co19#2663)
2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add wildcard initializer tests (dart-lang/co19#2658)
2024-05-13 sgrekhov22@gmail.com dart-lang/co19#2119. Remove some accidental comments (dart-lang/co19#2657)

Change-Id: I665f56c1039b14354019a32b94183f6d9c9bc5c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367020
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-05-17 08:25:25 +00:00
Martin Kustermann 110219a532 [dart2wasm] Make dart compile wasm use platform file instead of compiling SDK from sources
This shaves around 1 second of a `dart compile wasm hello.dart`

Change-Id: I6a7a7620d71c7af81b2617959f952f025dd25d4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366802
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-17 07:41:58 +00:00
Martin Kustermann 9db56f786d [dart2wasm] Use the main method from Component instead of (arbitrarily) assuming the first library is the main library
The CFE compilation should fail if there is no `main`, so dart2wasm
compiler should be able to assume it's there in
`Component.mainMethod`.

This fixes an issue when the `main` method in the main library isn't
there but rather re-exported from another library (which is not the
first one).

(This is part of work towards adding a CI builder using
`dart compile wasm`)

Change-Id: If9e75c2bf1c175ec9db1d97bd56b00cfdb6d3cb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366800
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-17 07:38:22 +00:00
Sam Rawlins ee5eb9fedc Remove unnecessary Linter parent class, rename linterRegistry
Linter was in between LintRule and NodeLintRule, but the only subtype
was LintRule so the abstraction was unnecessary. There are lots of
small, nice follow-on effects across the codebase.

Also rename the top-level `lintRegistry` variable to be
`lintRuleTimers` as it is just a mapping of lint rule timers. (I was
confused about what this was because `Analyzer.registeredRules` is the
more general "registry of rules."

Also remove the deprecated, unused `getVisitor` API.

Also remove the unused top-level `linterVersion` string.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Icf75db7786fc2022e271ec6f32fd3aa00b2b4084
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366840
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-17 03:25:49 +00:00
Konstantin Shcheglov 053fcb92c7 CQ. Make atEntity() consistent - use required target and 'errorCode' formal parameters.
Change-Id: I17defde653f41e83c0ff054a4a498a0dacaccd08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366887
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-17 00:12:23 +00:00
Devon Carew 515827db07 [deps] rev async, dartdoc, http, lints, test, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (09cba7f..77a25d7):
  77a25d7  2024-05-15  Sarah Zakarias  Add `topics` to `pubspec.yaml` (dart-lang/async#274)

dartdoc (2e706be..476d5cc):
  476d5cc8  2024-05-16  Sam Rawlins  Refactor PackageGraph._tagReexportsFor and document (dart-lang/dartdoc#3772)
  24658cca  2024-05-14  Sam Rawlins  Privatize CommentReferenceParser._codeRef (dart-lang/dartdoc#3771)
  dff86ed9  2024-05-14  Sam Rawlins  Bump to 8.0.9 (dart-lang/dartdoc#3770)

http (4722e03..76deb75):
  76deb75  2024-05-16  Hossein Yousefi  [cronet_http] Upgrade jni to 0.9.2 and publish 1.2.1 (dart-lang/http#1198)
  ec55561  2024-05-15  Brian Quinlan  [cronet] Use the same host and Android emulator architecture. (dart-lang/http#1201)

lints (f0205c1..b254c7e):
  b254c7e  2024-05-16  Devon Carew  Update README.md (dart-lang/lints#189)
  5fef508  2024-05-13  Lasse R.H. Nielsen  Tighten up the `gen_docs.dart` script. (dart-lang/lints#187)

test (84d2a2b..2464ad5):
  2464ad5c  2024-05-16  Sarah Zakarias  Add `topics` to  package "test" `pubspec.yaml` (dart-lang/test#2230)
  6540a360  2024-05-15  dependabot[bot]  Bump the github-actions group across 1 directory with 3 updates (dart-lang/test#2229)
  4b6f029c  2024-05-15  dependabot[bot]  Bump dart_flutter_team_lints from 2.1.1 to ^3.0.0 in all packages (dart-lang/test#2228)

webdev (d46cf50..fc32eb6):
  fc32eb69  2024-05-14  Elliott Brooks  Collect log message count and log at the end (dart-lang/webdev#2430)
  99abc535  2024-05-14  Elliott Brooks  Wait for a `resume` event to run the `main()` method after a page refresh (dart-lang/webdev#2431)

Change-Id: Iee28bacfc028c92e4b59d95f0c7e61f8282d2968
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366980
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-05-16 23:34:38 +00:00
Ryan Macnak bc0f02e4c8 [vm, gc] Incremental compaction.
At the beginning of a major GC cycle, select some mostly-empty pages to be evacuated. Mark the pages and the objects on these pages. Apply a write barrier for stores creating old -> evacuation candidate pointers, and discover any such pointers that already exist during marking.

At the end of a major GC cycle, evacuate objects from these pages. Forward pointers of objects in the remembered set and new-space. Free the evacuated pages.

This compaction is incremental in the sense that creating the remembered set is interleaved with mutator execution. The evacuation step, however, is stop-the-world.

Write-barrier elimination for x.slot = x is removed. Write-barrier elimination for x.slot = constant is removed in the JIT, kept for AOT but snapshot pages are marked as never-evacuate.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52513
Change-Id: Icbc29ef7cb662ef8759b8c1d7a63b7af60766281
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357760
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-16 23:26:08 +00:00
Derek Xu 45221e51c3 [VM/Debugger] Prevent FindBestFit from considering closures that were
compiled prior to the latest reload

TEST=verified that
pkg/vm_service/test/breakpoint_resolution_after_reloading_test.dart
fails without the changes in this CL and passes with them, verified that
none of the existing debugger tests got broken by this CL

Change-Id: Ie816a3ad65a17ef9f497f209f2203d679728cb75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366860
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-05-16 21:57:18 +00:00
Konstantin Shcheglov 017bed7b9a CQ. Enable unnecessary_final in analysis_server/
Change-Id: Ieb62a1c774a5e8f5a22deaa8e8e5fff6f9f849dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366960
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-16 21:20:28 +00:00
Konstantin Shcheglov dbc478ce81 CQ. Use ErrorReporter.atEntity() where possible.
Change-Id: I64c44cc6883001ee9421f85320f871e64b0b36ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366503
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-16 21:17:44 +00:00
Sam Rawlins ba79c308d7 analyzer: remove deprecated members of LinterContext
* `LinterContext.analysisOptions`
* `LinterContext.declaredVariables`
* `LinterContext.canBeConst`
* `LinterContext.canBeConstConstructor`
* `LinterContext.inTestDir`

This is all private API; google3 is clean.

Change-Id: I573037934889e24d0af1ef2a03bf65d7982a272d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365521
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-16 21:00:59 +00:00
Sam Rawlins 2e53eada36 compiler: replace unsupported [this] comment references with this.
Work towards https://github.com/dart-lang/dartdoc/issues/3761

Sibling CL to https://dart-review.googlesource.com/c/sdk/+/365204

The analyzer has never recognized `[this]` as a valid doc comment
reference (and the `comment_references` lint rule has similarly
reported such reference attempts). dartdoc has its own algorithms
for resolving comment references, which we are dismantling in favor
of a single resolution, provided by the analyzer.

We've also decided against adding support in the analyzer (see
https://github.com/dart-lang/linter/issues/2079), so these
reference attempts should be re-written.

Change-Id: I0a30a34c9f58bd6c98c6b83e607a973c9ba51ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-05-16 20:20:34 +00:00
pq fe91f3eed8 + quick fix for INVALID_REOPEN_ANNOTATION
Change-Id: I1778edea4371ce84efaab5e2a64e14ee035d0500
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-16 20:09:00 +00:00
Sam Rawlins 020a59e59c js_interop: replace unsupported [this] comment references with this.
Work towards https://github.com/dart-lang/dartdoc/issues/3761

Sibling CL to https://dart-review.googlesource.com/c/sdk/+/365204

The analyzer has never recognized `[this]` as a valid doc comment
reference (and the `comment_references` lint rule has similarly
reported such reference attempts). dartdoc has its own algorithms
for resolving comment references, which we are dismantling in favor
of a single resolution, provided by the analyzer.

We've also decided against adding support in the analyzer (see
https://github.com/dart-lang/linter/issues/2079), so these
reference attempts should be re-written.

CoreLibraryReviewExempt: Comments only.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I38dd476e40e4508fb6bf88c28415ff261bae5f43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366880
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-05-16 19:43:18 +00:00
Danny Tuppeny 3ca4243818 [dds/dap] Handle errors during VM Service connection/initialization and ensure they're reported to the user
Sometimes we see unhandled exceptions during this setup work, see:

- https://github.com/flutter/flutter/issues/148346
- https://github.com/flutter/flutter/issues/148348

Currently these are unhandled and bring the debug adapter down. In VS Code, the error (send to stderr) is not visible to the user so they just see a silent crash which makes it very difficult to report (and the Flutter crash reports don't have any context).

This change will send the exception to the client and then cleanly terminate, which should give the user more information to open a good bug report (assuming the issue wasn't just something like them terminating the app as it was starting).

Change-Id: I4aefbc278e6a0708924c6fa41c5179d581117689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366662
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-05-16 19:39:57 +00:00
Ryan Macnak 565bc48302 [vm, gc] Use FreeListElement as the filler object for array truncation.
This is consistent with new-space sweeping using FreeListElement as the filler object, and allows for stronger asserts in incremental compaction.

TEST=ci
Change-Id: I43a87a46fb1211a88589cf4a349ada7b556e4c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366885
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-16 19:30:58 +00:00
Sam Rawlins 8b53d26a09 observatory: replace unsupported [this] comment references with this.
Work towards https://github.com/dart-lang/dartdoc/issues/3761

Sibling CL to https://dart-review.googlesource.com/c/sdk/+/365204

The analyzer has never recognized `[this]` as a valid doc comment
reference (and the `comment_references` lint rule has similarly
reported such reference attempts). dartdoc has its own algorithms
for resolving comment references, which we are dismantling in favor
of a single resolution, provided by the analyzer.

We've also decided against adding support in the analyzer (see
https://github.com/dart-lang/linter/issues/2079), so these
reference attempts should be re-written.

TEST=Nope
Change-Id: Ie584a8338d4b203c4dce737769dbf2bd9094a42c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366881
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-16 19:24:38 +00:00
pq 6eb6d4f26c [macros] quick fix for DUPLICATE_AUGMENTATION_IMPORT
(This was stashed locally and just remembering it.)

If this feels risky to land, happy to hold off.


Change-Id: I5349414bf7eb609ea151866436df4df7bb46bcec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366884
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-16 18:22:48 +00:00
Devon Carew 2837647bea [wiki] move the https://github.com/dart-lang/sdk/wiki to the docs/ dir
Change-Id: I28db796fadcc111d97d3589bf3988ea0bbb8e18a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366682
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-05-16 18:19:40 +00:00
pq 3bdc1f9c59 [wildcards] UNUSED_CATCH_CLAUSE tests
Fixes: https://github.com/dart-lang/sdk/issues/55721
Change-Id: I5e675c61a7d1eb0f6192f98146fd2dbd5dd0e2e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366407
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2024-05-16 17:31:30 +00:00
Daco Harkes b6207ebdb4 [deps] Roll dart-lang/native
Adds the missing argument to `link`.

Change-Id: I8a9d167b046ac301e5274a5062e30d6c186ac257
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366381
Reviewed-by: Hossein Yousefi <yousefi@google.com>
Commit-Queue: Hossein Yousefi <yousefi@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-05-16 17:12:17 +00:00
Konstantin Shcheglov 73bdc86dd5 Macro. Issue 55746. Fix for using re-exported macros.
Bug: https://github.com/dart-lang/sdk/issues/55746
Change-Id: Ib18b60467ce946346072c04b1df7b36d12e4cab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366901
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-16 17:03:01 +00:00
Paul Berry c734d583c1 Prevent .call tearoff on expressions whose type is a nullable type variable.
Note that this is not a breaking change, since the CFE already
correctly flags the error condition.

Fixes #55734.

Bug: https://github.com/dart-lang/sdk/issues/55734
Change-Id: I5570e0840ce20c2a761d88f698b9876f7543bd8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-05-16 16:44:29 +00:00
Ryan Macnak b3287af10e [vm] Remove MSAN_UNPOISONs around print and sort functions.
This was probably fixed by ddc11f8084.

TEST=msan
Change-Id: I05f58b382ad186929bd4dbf56e905568cb268d96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366683
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-16 16:33:52 +00:00
Danny Tuppeny 8b5b1571ae dds/dap] Fix evaluation tests for new exceptions wrapping failed responses
In a recent change I wrapped these exceptions to provide better failure messages in tests, but I missed updating these tests that had matchers against them.

For reasons I don't yet understand, the trybots that ran on that change didn't include these tests so didn't catch this.

Change-Id: I5227842d2317bbe33186670141586c315f98a5c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366665
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2024-05-16 15:51:10 +00:00
Stephen Adams 762ca98456 [corelib] Update date_time_far_away_dates_test
Bug: #37442
Change-Id: I0c04136bc4fdbf2908154a608f09311c5c511da5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366720
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-05-16 14:19:18 +00:00
Johnni Winther eb413f21fe [cfe] Remove unused messages
Change-Id: I97542c9558b19d634ac562fdde1cb833f0c22d16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366666
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-16 12:37:49 +00:00
Ömer Sinan Ağacan e7dde8377e [dart2wasm] Port VM fix for #52083 (sync*)
dart2wasm's sync* runtime library was mostly copied from VM, but we
didn't get the fix for #52083 in 9cf26fc. This ports the fix to
dart2wasm.

This currently doesn't fix any tests as there are other issues with
dart2wasm's sync* implementation, which we are fixing in
https://dart-review.googlesource.com/c/sdk/+/366663.

Change-Id: I9d82d1bbb4c96ccb9bf411a385f4b7ff395a1c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366671
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-05-16 11:53:25 +00:00
Jens Johansen 4ab652b38f [CFE] Coverage on try bot
This runs the strong suite, does coverage, and compares the coverage
(percentage) to the (hardcoded) expected percentage.

Change-Id: I2e7511d7841b19c15139a7c84bf0861b56b81ccc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-05-16 11:48:12 +00:00
Tess Strickland 8b8ec2aa3d [gardening] Fix TrySwitchInstanceCall for --no-lazy-dispatchers.
TEST=Manual run of the following command line found by the dart
     fuzzer:

out/DebugX64/dart --profiler --max_profile_depth=189 \
  --sample_buffer_duration=51 --marker_tasks=2 \
  --optimization_counter_threshold=31050 --no_load_cse \
  --no_lazy_dispatchers pkg/compiler/lib/src/dart2js.dart \
  --invoker=test --platform-binaries=out/ReleaseX64 \
  --out=out/dartfuzz/5.js --no-source-maps \
  pkg/compiler/lib/src/util/memory_compiler.dart

Change-Id: If7620b7b7bb76d28f66ffde01af52a62392302c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366780
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-16 10:33:58 +00:00
Johnni Winther a9d8cd598a [cfe] Change incremental suite to default to strong mode
Change-Id: I551cdc70e07f033a73c9941c307fa68ad3f78a01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366761
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-16 09:45:39 +00:00
Martin Kustermann 05df51c962 [vm] Use newer language version in package:vm which removes some unnecessary casts
TEST=ci

Change-Id: Ic1218bddf1879054f1d35ac550224a294d03cda8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366664
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-05-16 08:57:40 +00:00
Johnni Winther d8e6d26159 [cfe] Remove isNonNullableByDefault from various functions
Change-Id: I757b3be578f5ce6489482cdcaae45480ed20ce68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-05-16 08:20:28 +00:00
Johnni Winther eccaf152ee [cfe] Change more nnbd default modes to strong
Change-Id: Iab51c30024764ebd1c82991ad8687e7accf999f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366661
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-16 07:44:10 +00:00
Danny Tuppeny 5a6b2421bf [dds/dap] Improve reporting of failed requests in DAP tests
This improves the failure messages that will show in tests if a DAP request unexpectedly fails.

Before:

```
Instance of 'Response'
```

After:

```
  Request "evaluate" failed:
  {
      "seq": 17,
      "type": "response",
      "body": {
          "error": {
              "format": "{message}",
              "id": 1,
              "showUser": true,
              "variables": {
                  "message": "This is a test failure",
                  "stack": "#0      DartDebugAdapter.evaluateRequest (package:dds/src/dap/adapters/dart.dart:1046:5)\n#1      (SNIP)\n"
              }
          }
      },
      "command": "evaluate",
      "message": "This is a test failure",
      "request_seq": 8,
      "success": false
  }
```

Might help diagnose https://github.com/dart-lang/sdk/issues/55705.

Change-Id: If9edad16090a8bd09e22dd9b772401763d281f8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366640
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-05-15 22:17:18 +00:00
Ryan Macnak 38d7d5d663 [vm, compiler] Account for IndirectGotoInstr with 1 successor in register allocation.
TEST=dartfuzz
Bug: https://github.com/dart-lang/sdk/issues/55686
Change-Id: I58f772d80063c0b44613224bf4eb3980d2d9e2b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366067
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-15 16:53:58 +00:00