Commit Graph

105327 Commits

Author SHA1 Message Date
pq b4eceecdc3 [element model] migrate typed_literal_resolver
Change-Id: Ic90d4c498205f317cca293d8695f7f906f3cb79b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406201
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2025-01-27 15:12:28 -08:00
pq f98a7f9b89 [element model] migrate resolution_result
Change-Id: Ie3f7ef2c632a8e062b1a1f602a513fcf408825a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406181
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2025-01-27 15:11:52 -08:00
Danny Tuppeny 8eb9bcd7f0 [analysis_server] Verify with/without documentChanges for EditArguments tests
The tests by default run with documentChanges (set in `setUp`), but it's possible LSP-over-Legacy clients won't support it.

Change-Id: I40c65f05127c88e15a43f16669f64675285955dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406002
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-27 12:54:48 -08:00
Konstantin Shcheglov 04484a2c59 Elements. Migrate ExtensionMemberResolver.
Change-Id: I0a9f008d900a478200bbdac898fe58c61e825391
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406082
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-27 12:39:41 -08:00
DEPS Autoroller 193f8a26ad Roll gn from c97a86a72105 to ed1abc107815
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com,dart-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in gn: https://bugs.chromium.org/p/gn/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:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: I9edd07c7072cc191b62a377201ffd2800dd74b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404745
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-01-27 12:30:56 -08:00
Devon Carew 732fa5ed79 [deps] rev core, ecosystem, test, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

core (https://github.com/dart-lang/core/compare/72a2060..3b35aca):
  3b35aca9  2025-01-24  Devon Carew  update the topics section of several pubspecs (dart-lang/core#854)

ecosystem (https://github.com/dart-lang/ecosystem/compare/682c8ef..c4a163a):
  c4a163a  2025-01-23  Devon Carew  print detailed info about the leaked APIs to stdout in the workflow (dart-lang/ecosystem#339)

test (https://github.com/dart-lang/test/compare/7fc9521..92eed6c):
  92eed6c4  2025-01-27  Lasse R.H. Nielsen  Make zone handlers call zone.run to run callbacks. (dart-lang/test#2451)
  ad04f172  2025-01-24  Devon Carew  add a pull request labeler; add issue tracker links; update codeowners file (dart-lang/test#2452)
  1f292db8  2025-01-24  Lasse R.H. Nielsen  Don't require Dart 3.5.
  a56fa947  2025-01-24  Lasse R.H. Nielsen  Accept extra `run`s in test. Move to Dart 3.5.
  4bd54972  2025-01-24  Lasse R.H. Nielsen  Clean-up. Accidentally merged a removed lint back in.
  9fa57d16  2025-01-24  Lasse R.H. Nielsen  Make zone handlers call zone.run to run callbacks.

webdev (https://github.com/dart-lang/webdev/compare/9430dd7..5dc7950):
  5dc79508  2025-01-24  Jessy Yameogo  Added support for callLibraryMethod with the DDC library bundle format.  (dart-lang/webdev#2577)
  1d0b32c2  2025-01-24  Srujan Gaddam  Reset DWDS to 24.3.4-wip (dart-lang/webdev#2580)
  1990d29a  2025-01-23  Srujan Gaddam  Implement hot restart for DDC library bundle format and publish 24.3.3 (dart-lang/webdev#2576)

Change-Id: Ifa23e74a1399ac7ec70a99750419b915a2efbb19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406120
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2025-01-27 12:19:40 -08:00
Konstantin Shcheglov e9896a9a68 Elements. Migrate CommentReferenceResolver.
Change-Id: I8962f99ba4422d673ace93035bfad1d926ce68e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406042
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-27 12:10:22 -08:00
DEPS Autoroller b7a9e2b5d9 Roll Fuchsia Test Scripts from gUHjJPMGJW0yseyRp... to g6IlaYL1_wNmk3zNj...
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: Id21860f72cf9a85b3cdc541aaae360101efe47c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405880
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Zijie He <zijiehe@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-01-27 11:44:16 -08:00
Konstantin Shcheglov f72732c351 Elements. Migrate, remove v1 getters from SimpleResolutionResult.
Change-Id: I4eb55afe0a04bd2ff16daa8d29d88d2847fb9c08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406100
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-27 11:17:34 -08:00
DEPS Autoroller e4d04807f7 Roll Clang from 684052173971 to 6d12b954a7df
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/clang-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@grotations.appspotmail.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Clang: https://bugs.fuchsia.dev/p/fuchsia/issues/list?q=component%3AToolchain
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: I3ba75dd58bda848c4262776824cada308f9bebab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405680
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-01-27 11:10:13 -08:00
pq af534bd087 [element model] migrate super_formal_parameter_test
Change-Id: Ib33e62c00a84f9cfd1976f2711d65c11b2f20dbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405607
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-01-27 11:03:38 -08:00
DEPS Autoroller 90ba332029 Roll Fuchsia SDK from 26.20250106.5.1 to 26.20250120.5.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: I9d1d0b5a9d930e0125724fc11cbbaf302b2d9e18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405160
Reviewed-by: Zijie He <zijiehe@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-01-27 10:55:41 -08:00
Ryan Macnak 82f8a10cdb [vm] Take only a read lock during Field::SetStaticValue.
It is safe for multiple isolates to set their values concurrently. Only growth of the field tables needs to be excluded by the write lock.

A storm of such setters are invoked as part of core library initialization during isolate spawning.

TEST=ci, tsan
Change-Id: I4677e33ee80bb06d261ada2ae9d6b71c94fde611
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405400
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-01-27 10:41:28 -08:00
DEPS Autoroller 8a1010f439 Roll BoringSSL from 5a2194f43d88 to d3f26f8af085 (48 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/5a2194f43d88..d3f26f8af085

2025-01-20 bbe@google.com Add a function for Conscrypt to use
2025-01-17 davidben@google.com Fix unwrap comment for CBB_init_fixed
2025-01-17 davidben@google.com Document and test PEM_X509_INFO_read_bio's odd decryption behavior
2025-01-16 davidben@google.com Test some obscure modes of EVP sign/verify with RSA keys
2025-01-16 davidben@google.com Remove some dead code in bssl_shim
2025-01-16 davidben@google.com clang-format bssl_shim.cc
2025-01-16 davidben@google.com Rename foo_extra to foo
2025-01-16 ebiggers@google.com Add explicit prefetching to the new AES-GCM code
2025-01-16 agl@chromium.org Add SPAKE2+.
2025-01-15 joegar@google.com Add ability to upload a directory of vector test results.
2025-01-14 davidben@google.com Bump MODULE.bazel for another snapshot
2025-01-14 davidben@google.com Unfork Chromium's Clang update script
2025-01-14 davidben@google.com Remove embed_test_data.go
2025-01-14 agl@chromium.org Mark fallible container operations as `nodiscard`
2025-01-13 davidben@google.com Start using bssl::UniquePtr in libcrypto
2025-01-13 davidben@google.com Move RSA_blinding_on out of BCM
2025-01-13 davidben@google.com Switch some tests to std::string_view
2025-01-13 davidben@google.com Initialize iqmp during keygen directly
2025-01-13 davidben@google.com Remove a redundant call to freeze_private_key
2025-01-13 bbe@google.com Add tests for TIME functions that accept offsets
2025-01-13 davidben@google.com Use more span patterns for strings vs bytes
2025-01-13 davidben@google.com Remove calls to now unnecessary MakeSpan/MakeConstSpan
2025-01-13 davidben@google.com Remove now unused size hooks from ECDSA_METHOD and RSA_METHOD
2025-01-13 davidben@google.com Remove some RSA_is_opaque and EC_KEY_is_opaque special cases
2025-01-12 davidben@google.com Use std::string_view for label strings
2025-01-09 davidben@google.com Update CMAKE_CXX_STANDARD in generate_build_files.py
2025-01-09 davidben@google.com Revert "Stop playing with time strings with strlcat"
2025-01-08 daniel@binaryparadox.net util/fipstools: document AES-gcm-randnonce cmds
2025-01-08 daniel@binaryparadox.net util/fipstools: add SSH KDF ACVP support
2025-01-08 davidben@google.com Add something to the error queue when Proc-Type version is wrong
2025-01-08 agl@chromium.org Gate Rust support for ML-{KEM,DSA} on a crate feature.
2025-01-07 bbe@google.com Stop playing with time strings with strlcat
2025-01-07 agl@chromium.org Revert "Always try and enable the new_uninit feature."
2025-01-07 bbe@google.com replace some more allocate + strlcat with asprintf
2025-01-07 davidben@google.com Remove out directories in pki test data
2025-01-07 bbe@google.com replace manual alloction math and srlcats with asprintf
2025-01-07 bbe@google.com use asprintf instead of magic manual allocation
2025-01-07 prb@google.com Always try and enable the new_uninit feature.
2025-01-07 davidben@google.com Add another missing file header
2025-01-07 davidben@google.com Add some missing file headers
2025-01-07 davidben@google.com Align a few license headers with OpenSSL's "copyright consolidation"
2025-01-06 agl@chromium.org Remove uses of `strcpy`, `strcat`, and `sprintf`, and handle NULL in some functions.
2025-01-06 davidben@google.com Import "Remove some code for a contributor that we cannot find" from upstream OpenSSL
2025-01-06 davidben@google.com Import "Undo commit d420ac2" from upstream OpenSSL
2025-01-06 ebiggers@google.com Disable the "AVX10/256" AES-GCM functions for now
2025-01-06 ebiggers@google.com Add VAES + AVX2 optimized AES-GCM
2025-01-06 daniel@binaryparadox.net util/fipstools: adjust KDF-counter command docs
2025-01-06 daniel@binaryparadox.net util/fipstools: support more digests w/ hmacDRBG

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: I9947da0bc5b08179052b9c8eef2e7520195d6213
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405161
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-01-27 10:33:56 -08:00
Konstantin Shcheglov 6417e1ce8a Elements. Migrate TypeConstraintGatherer.
Change-Id: I321604b994d6aa63bf9e6b6de70bbe6a79f61f24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406060
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-27 10:03:49 -08:00
Danny Tuppeny 1ec4ea79fd [analysis_server] Include "get" or "set" in LSP override completions to distinguish them
Screenshot of how this looks here: https://github.com/dart-lang/sdk/issues/59929#issuecomment-2602188244

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

Change-Id: I220ee8facb96dbf31ee88868c8c44223de5e8406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405007
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-27 09:06:38 -08:00
Danny Tuppeny 8884a8b4ad [analysis_server] Make it easier to print protocol messages when running LSP-over-Legacy tests
This moves the existing `debugPrintCommunication` flag out of `test/lsp` into `test/` and passes it to the `MockServerChannel` to simplify printing protocol messages for LSP-over-Legacy tests (similar to what MockLspServerChannel already does).

Change-Id: Ic5fa6309e8de01ce0c624584ad6eb653ced90698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406021
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-01-27 08:47:42 -08:00
Alexander Markov 6ddd96b45a [vm,compiler] Treat 'Never' return type as unreachable
When building a flow graph, break control flow (close fragment) after
a call with return type 'Never'. Append 'Stop' instruction after
the call to make sure the return address is still within function
code range.

TEST=runtime/tests/vm/dart/regress_59941_il_test.dart

Fixes https://github.com/dart-lang/sdk/issues/59941
Issue https://github.com/dart-lang/sdk/issues/56969

Change-Id: I5bbc0b9740a4f7e06b8560589daeb2b44f13d084
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405604
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-01-27 08:16:08 -08:00
Brian Wilkerson 83f540b4f0 Fix three links to the contributing docs for the sdk
Change-Id: I7da01e06279b649021c3c40e44c223cd1cec02c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405860
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-01-27 08:12:11 -08:00
Nate Biggs b969f32a76 [dart2wasm] Store exception/stacktrace for nested catch blocks.
The async state machine uses a single state in the heap to store the current exception and stacktrace when within a catch block in case they need to be rethrown. When catch blocks are nested this state can be overwritten.

With this new change, before entering a new catch we store the current value of the exception/stacktrace in a local that we can restore after exiting the associated catch blocks. A wasm catch can represent multiple Dart catch blocks so we only need to store the state per wasm catch.

Fixes: https://github.com/dart-lang/sdk/issues/59981
Change-Id: I738084fdecdf5aceac65c5d3698e40b791175171
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405920
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-01-27 07:58:31 -08:00
Alexander Markov e893d11b3f [vm,compiler] Fix serialization of ranges and arguments descriptors
Convert range boundaries with symbolic references to other instructions
into constant boundaries to avoid serializing extra references.

Specially handle serialization of arguments descriptors which are
cached in the VM isolate.

TEST=ci

Change-Id: Ifab3bb4d9b037aaefd81d38dd93d47cd4b42cf1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405571
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-01-27 06:46:05 -08:00
Parker Lougheed d86f6c2815 [release] Add 3.6.1 entries and recent release dates to changelog
Resolves https://github.com/dart-lang/sdk/issues/56999 by placing release dates separate from the header.

Change-Id: I54dc71db61982ceb2de1edd4fcf2771a74565d58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404501
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-01-27 01:46:27 -08:00
Jens Johansen 8521d4f5d9 [CFE] Fix coverage destroyed by (wrong) offsets on extension method tearoffs
Say you have a class method like this:

```
class Bar {
  /*offset a*/ void /*offset b*/ qux() {
    /*offset c*/ print("hello");
  }
}
```

Lets also say that this method is run.
This will mark offset a and offset c as hits.
Offset b does not exist in coverage terms.

Now say you have an extension mehod like this:

```
extension Foo on Bar {
  /*offset a*/ void /*offset b*/ baz() {
    /*offset c*/ print("hello");
  }
}
```

Lets also say that this method is also executed.
This will mark offset a and offset c as hits.
Offset b does not exist in coverage terms for this method.

Because extension methods are special though we create a special tearoff for
it. Lets say we didn't execute that one.
The tearoff method - before this CL - had offset b on positions that caused
the position to exist in coverage terms, and as the method wasn't executed
this would make it a miss.

This CL fixes the issue by setting the offsets on the tearoff that before
introduced offset b to offset a instead.

Change-Id: I3a5339135f3d76327624b35f04cc14afccaf487a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404563
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-01-27 01:27:50 -08:00
Johnni Winther 2d83ca1d38 [cfe] Remove SourceFunctionBuilderImpl and merge SourceFactoryBuilder and RedirectingFactoryBuilder
This is in preparation for creating factories through fragments.

Change-Id: Ia9589d16468c647a1bf3236bcb75133f96fcfac3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405781
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-01-27 00:25:48 -08:00
Sam Rawlins c550de7c40 analysis server: simplify LegacyAnalysisServer
This class had a few methods which only pertain to the resource provider
and can just be extensions on ResourceProvider. They also have the
exact same impl! So one can redirect to the other.

Change-Id: I3a0433304adba1b71f69d0a4afc8a44515a23d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405600
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-25 11:52:58 -08:00
Paul Berry e2477add3e [analyzer] DartType no longer implements SharedTypeStructure.
Field types, getter types, method return types, and method parameter
types are changed to `Impl` types in the following classes:

- `BodyInferenceContext`
- `BinaryExpressionResolver`
- `ForResolver`
- `ListPatternResolver`
- `PrefixExpressionResolver`
- `StaticTypeAnalyzer`
- `TypeConstraintGatherer`
- `TypeSystemOperations`
- `YieldStatementResolver`

Additionally, the type `DartType` is changed so that it no longer
implements `SharedTypeStructure`. Instead, the private class
`TypeImpl` implements `SharedTypeStructure`.

There is no change to the analyzer public API.

This is part of a larger arc of work to change the analyzer's use of
the shared code so that the type parameters it supplies are not part
of the analyzer public API. See
https://github.com/dart-lang/sdk/issues/59763.

Change-Id: Idbf09e25a26249a16e65a59274e66b477480d697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405802
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-01-24 16:32:11 -08:00
Paul Berry a68ae55885 [analyzer] Switch more types to "Impl" types.
Field types, getter types, method return types, and method parameter
types are changed to `Impl` types in the following classes:

- `AssignmentExpressionResolver`
- `DartPatternImpl` and its subtypes
- `ExpressionImpl` and some of its subtypes
- `PropertyElementResolver`
- `RecordLiteralResolver`
- `TypeParameterElementImpl2`
- `TypeSystemImpl`
- `_InferenceLogWriterImpl`

There is no change to the analyzer public API.

This is part of a larger arc of work to change the analyzer's use of
the shared code so that the type parameters it supplies are not part
of the analyzer public API. See
https://github.com/dart-lang/sdk/issues/59763.

Change-Id: I2cc0dcf0a8e0d97053bf6da4975c729500bb1131
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405840
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-24 15:12:43 -08:00
Stephen Adams a1c54855a6 [dart2js] Detect larger no-op regions
Change-Id: Id4ced6f3a54d40a3775b77fde8453e45a6383ee2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404800
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-01-24 14:35:55 -08:00
Konstantin Shcheglov b92ef7e053 Elements. Migrate DefaultTypesBuilder.
Change-Id: Ic9742f46b3d83077baa720112d2576b1f40ac6f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-24 13:21:13 -08:00
Nate Biggs 6c4028eab8 [ddc] Update ddc_module_loader.js to safely check for localStorage in page.
When running in an iframe without specific flags, DDC may not have access to `localStorage`. In this context, even trying to access `window.localStorage` can cause an exception in the iframe.

Wrapping the check in a try/catch allows us to safely check for access before using it.

Change-Id: I0c5d3d0ac34a550444c12b52f6519a9446ebfe9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405608
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2025-01-24 12:17:26 -08:00
Paul Berry ba9ef09163 [analyzer] Switch more types to "Impl" types.
Field types, getter types, method return types, and method parameter
types are changed to `Impl` types in the following classes and
extensions:

- `CompoundAssignmentExpressionImpl`
- `ExecutableElementExtensionQuestion`
- `ExtensionElementImpl`
- `ExtensionResolutionError`
- `FunctionReferenceResolver`
- `InstanceElementImpl2`
- `InstantiatedExtensionWithMember`
- `InstantiatedExtensionWithMember2`
- `InterfaceElementImpl`
- `InvocationInferrer`
- `LexicalLookupResult`
- `LocalVariableTypeProvider`
- `PostfixExpressionResolver`
- `PropertyElementResolverResult`
- `RecordTypeExtension`
- `ResolutionResult`
- `ResolverVisitor`
- `SimpleResolutionResult`
- `TypePropertyResolver`

There is no change to the analyzer public API.

This is part of a larger arc of work to change the analyzer's use of
the shared code so that the type parameters it supplies are not part
of the analyzer public API. See
https://github.com/dart-lang/sdk/issues/59763.

Change-Id: I5d0d432301df38c7a5ccc7c65767cf73ce7b5d7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405801
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-01-24 11:16:50 -08:00
Devon Carew 4c3e7abfee [deps] revert the recent tools roll
Change-Id: Ie5bbca028df25a32e9a2cb6a27c459a5f47f48cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405570
Reviewed-by: Nate Bosch <nbosch@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2025-01-24 10:41:24 -08:00
Konstantin Shcheglov 668754285b Elements. Fixes after https://dart-review.googlesource.com/c/sdk/+/405660
Bug: https://buganizer.corp.google.com/issues/392069763
Change-Id: Iecbfc55433890c4e5e606dc9b1f2bc005b9b6684
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-24 09:54:59 -08:00
Danny Tuppeny 0d90ccc2ec [analysis_server] Use unique request IDs in tests to avoid flaky tests
Some of the LSP-over-Legacy tests were intermittently failing because the test did not correctly wait for the `setClientCapabilities` request to complete.

The reason for this was that it used the ID `0` (from `_newRequestId`) but so did `setAnalysisRoots`. If the timing was right, the second request would appear to complete when the first did (because the response had id=0) and the test would start before the capabilities had actually been set (and since the test reads them directly off the server, they would be incorrect).

This moves the `_nextRequestId` field down into a base class and updates the helpers for requests like `setAnalysisRoots` to use it too.

Change-Id: Ice44191aad39c7ea81c40e501827557fe563e3d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-01-24 09:26:38 -08:00
Nicholas Shahan 4fce27b1f7 [tests] Fix formatting when writing diffs
* Normalize white space around source code strings before producing
  diffs by trimming and appending a single newline character.
* Write an empty line between the source code and diff text in
  generation files.
* Run dart format on all test files.

With these changes you should be able to run the hot reload suite with
`--diff write` and dart format the code multiple times without
introducing changes in the file.

Change-Id: Ifc0b1dd7032bd448f5f6568c5aa3c18dde076c71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405247
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2025-01-24 09:07:01 -08:00
FMorschel a0db69f182 [DAS] Considers factory keyword on constructors auto-complete
R=keertip@google.com

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

Change-Id: I47c51bc521f97398ae19a8d124e836baadfdabd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405200
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-01-24 08:45:46 -08:00
Ömer Sinan Ağacan da9de5ae98 [dart2wasm] More dart:convert micro optimizations
This does some micro-optimizations in UTF-8 decoder that wasm-opt
doesn't do for us.

- Inline some small and/or single-use functions.

- Instead of passing `U8List` to parser functions, pass the `array i8`
  of the `U8List`. This eliminates a layer of indirection when accessing
  the array in loops.

- Copy `_Utf8Decoder.transitionTable` and `_Utf8Decoder.typeTable`,
  which are `String`s, as `array i8`s. This also eliminates a layer of
  indirection when accessing the tables.

CoreLibraryReviewExempt: added dart2wasm inline pragma.
Change-Id: I1fd2b6a94e74e1565ba87068299cb80f5a0e9e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405480
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-01-24 08:00:39 -08:00
Sam Rawlins 8ed5503eeb dartdev: Add comment about analysisFinished.
Change-Id: Iefd2daa478e0b8426e9d8786c169fd8cbdd5e5c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-01-24 07:47:28 -08:00
Sam Rawlins 994b474b74 analysis_server_plugin: Bump versions of dependencies
Change-Id: I6f4a04732ef8ad5af178ea64b1ab259c891ea451
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-01-24 07:46:20 -08:00
Tess Strickland f2c9bdaa9d Reland "[pkg/vm] Handle cross compilation in dart_precompiled_runtime2."
This is a reland of commit 103ffd6041

Parent CL adds "aarch64" as a `uname -m` possibility for ARM64.

TEST=manual testing

Original change's description:
> [pkg/vm] Handle cross compilation in dart_precompiled_runtime2.
>
> When cross compiling, use qemu-<arch> to run dartaotruntime for
> the target architecture.
>
> TEST=manual testing with native X64 and cross-compiling ARM64 on X64.
>
> Change-Id: I6ce4e2cfa3108108fe05c7a1fcd2c400a8a47492
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404600
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

Change-Id: I4407f64e804fbc19d05440ed961a67b5e1c2c047
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405761
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-01-24 07:00:04 -08:00
Tess Strickland 7e080fa289 Reland "[pkg/vm] Handle cross compilation in the precompiler2 script."
This is a reland of commit 11a338000b

Adds "aarch64" as a `uname -m` possibility for ARM64.

TEST=manual testing

Original change's description:
> [pkg/vm] Handle cross compilation in the precompiler2 script.
>
> When cross compiling, gen_snapshot for the host architecture is in
> ${BUILD_DIR}/clang_<arch>/gen_snapshot.
>
> TEST=manual testing with native X64 and cross-compiling ARM64 on X64.
>
> Change-Id: I9f6af045675612651c659683081aca3e65acad1b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404421
> Reviewed-by: Slava Egorov <vegorov@google.com>

Change-Id: I4fb4812dfa96ba582ca3bedbfd68d58ce2a4ab5b
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405780
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-01-24 07:00:04 -08:00
Sigurd Meldgaard 503437735a Create lib folder for observatory_test_package
This is in preparation for https://dart-review.googlesource.com/c/sdk/+/397164

Pub insists that packages have their code in 'lib/'.

TEST=ci
Change-Id: I416204bec5ef7948bcf93c39f50fb018574b775f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405140
Reviewed-by: Tess Strickland <sstrickl@google.com>
2025-01-24 06:51:02 -08:00
Tess Strickland 1ac77f57dd [vm] Align entry point verification and the precompiler.
For entry-point pragma annotations, most of the time they are
used with either no argument or with an argument that evaluates
to either

* false to denote the annotation should not take effect, or
* null or true to denote the annotation should take effect.

However, the user can also specify that only part of the operations
on a member should be accessed from native code by using a string
argument that is either 'call', 'set', or 'get'.

The entry point verification in Invoke/InvokeGetter/InvokeSetter
assumes that for getters and setters, the only valid string argument
is 'get' or 'set', respectively. This is because those methods are
called via `Dart_GetField`[0] and `Dart_SetField`, respectively, as if
they were the getter or setter of a defined field.

However, the precompiler previously assumed that the string
argument 'call' was the only string argument that meant the link
to a function's code object should be saved. Similarly, it assumed the
string argument 'get' for functions meant that their implicit closure
function should be saved, which ends up including getters. Furthermore,
it did not do anything with setters annotated with the string argument
'set'. This means that the code link would not be saved for getters or
setters that were annotated with the string argument expected by the
entry point verifier.

This CL aligns the precompiler to match the expectations of other
parts of the codebase. It also changes TFA to report an error
if a getter or setter is marked with the string argument 'call'.

[0] `Dart_Invoke` can be called with the name of a getter that
returns a closure, but doing so is semantically equivalent to
calling `Dart_GetField` followed by `Dart_InvokeClosure`.

TEST=vm/dart/entrypoint_verification_test

Fixes: https://github.com/dart-lang/sdk/issues/59920
Change-Id: Ia2768bbaf9058bb14a1cdfb331eb85fa082a0e90
Cq-Include-Trybots: luci.dart.try:vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-product-x64-try,vm-aot-mac-product-arm64-try,vm-aot-obfuscate-linux-release-x64-try,vm-linux-debug-x64-try,vm-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404823
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-01-24 03:21:22 -08:00
Sigurd Meldgaard 862ca5b12e Opt front_end_server test fixtures out of package_deps validation
Change-Id: Ia0e557f4546b32390675d0addd1a2004113a1a46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404564
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2025-01-24 01:02:48 -08:00
Jens Johansen 46c9c29b6f [vm] Fix crash when expression evaluating with extension type with type parameter is available
Fixes https://github.com/dart-lang/sdk/issues/59653

Tested: Manually; added pkg/vm_service/test/issue_59653_test.dart and existing tests / CI.
Change-Id: I0969720c4d7c50e8756406477abe791891877abb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405381
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2025-01-23 23:26:39 -08:00
Jens Johansen 663c55b7bd [ package:vm_service ] Deduplicate expression evaluation testing helper
Change-Id: I371ef13859bf73a44e89ffbf0f5f8c042a112e0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405362
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-01-23 23:25:22 -08:00
Konstantin Shcheglov 60d98b8c81 Elements. Migrate ReplacementVisitor.
Change-Id: I06104d34aee22a3355929fc53f99d1cee93ee5c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405606
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-23 18:48:18 -08:00
Konstantin Shcheglov eb512ee556 Elements. Use 'lookupName' in Name.
Change-Id: Ice9138ad9a47f342ac1765f7f7bb348527e5edd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405447
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-01-23 18:32:22 -08:00
Konstantin Shcheglov e075d92262 Elements. Migrate DemotionVisitor.
Change-Id: I4a869708a1e73897ecf0fc568363e5fca1986169
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405605
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-23 17:41:36 -08:00
Konstantin Shcheglov 1ed1e83ac0 Elements. Migrate TopMergeHelper.
Change-Id: I7f70d8ac6f82d8d66ddac8293010b9b3dea5c147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405566
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-01-23 17:33:40 -08:00