Commit graph

101814 commits

Author SHA1 Message Date
Ömer Sinan Ağacan 060d841ec0 [vm] Improve JSON copyCharsToList argument type
The buffer type is always `Uint8List`, improve the type from `List<int>`
to `Uint8List`.

Tested: existing tests
Change-Id: I03ad84a0f1fe1ade8a46719545f3c33eeccd99b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371402
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-14 08:31:19 +00:00
なつき bde8d28217 Fix build regression on alpine linux
Closes https://github.com/dart-lang/sdk/pull/55993

GitOrigin-RevId: 0a4d00914442f6be1bce949ca7a234fbd04952cd
Change-Id: I1cb1ad381111853c03ac3a39854a0c0a75a3d31a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371262
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-06-14 07:39:30 +00:00
Daco Harkes 47cb48e415 [vm] Native asset relative path resolution with symlinks - fix
The fallback mechanism wasn't working because the embedded struct by
value wasn't nullptr initialized.

TEST=tested by commenting out `Dart_InitializeNativeAssetsResolver`
in `main_impl.cc`. Without this CL it segfaults, with this CL it works
as expected.

Closes: https://github.com/dart-lang/sdk/issues/56006
Change-Id: If93cf9b077a2791a8385bdc8e75708dd95c8ead6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371620
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-14 07:05:15 +00:00
Martin Kustermann 6f21d19b02 [dart2wasm] Add flag to allow experimental wasm interop.
Adds a flag users can use via

    dart compile wasm \
        --extra-compiler-option=--enable-experimental-wasm-interop

which allows code to import `dart:_wasm` and use import/export
pragmas.

Similar to how we have a way to import `dart:ffi`

    dart compile wasm \
        --extra-compiler-option=--enable-experimental-ffi

TEST=web/wasm/allow_import_export_pragmas_test (positive test)
TEST=web/wasm/reject_import_export_pragmas_test (negative test)

Change-Id: Ibdbbac6c3aa049b2759e96b7b749dd30ecc6aaed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370063
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-14 07:01:58 +00:00
Alexander Thomas ff3f629d4b [3xH] Migrate apply.sh to python 3.12
See https://docs.python.org/dev/whatsnew/3.12.html#imp

Fixes: https://github.com/dart-lang/sdk/issues/55973
Change-Id: I0ac6e60104bddc17cfe5cd537a409c4ded3eb1a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371302
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-06-14 06:52:12 +00:00
Martin Kustermann 18ffc284c3 [dart2wasm] Remove deprecated --name-section flag from dart compile wasm
Change-Id: I1e1746c408a704d23db1dbf05b554afda667a0ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371540
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2024-06-14 06:50:18 +00:00
Sam Rawlins 50e4c576b9 analyzer: fix various issues for static extension member resolution
* Unqualified, out-of-scope static extension members are not
  accessible.
* Locally scoped extension members shadow others.
* Static and instance extension members do not conflict.

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

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

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Icd618d044b3857efa24f365c6835d42c0022c176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370323
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-06-14 00:59:57 +00:00
Konstantin Shcheglov b4e30d1b45 CQ. Deprecate unused static members of AnalysisError.
Change-Id: I46e76defbc9a833a867cc3fa2154635f71a6d085
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371422
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 23:39:21 +00:00
Mayank Patke bf83cc30ed [dart2js] Convert VariableUse to a sealed class hierarchy.
Change-Id: I28d71d81031e3e6eefc2b4f6decfe375099a1c32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371185
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-06-13 23:01:34 +00:00
Stephen Adams 18994e6e46 [typed_data] Remove UnmodifiableXXXView classes
In most cases, the (now removed) SDK class was patched so that the constructor redirected to a platform-specific implementation of the unmodifiable view. Uses of the SDK class in the platform code could be rewritten to the more direct use of the implementation class.

The big +/- file changes are from moving the implementation classes from the patch file (typed_data_patch.dart), where they are no longer needed, to the internal file (typed_data.dart).

TEST=ci
Bug: #53785
Change-Id: Iaa7370de25b7fc2d26b24f7733c2892868e593cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370661
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2024-06-13 22:18:29 +00:00
Konstantin Shcheglov 7ae9900059 CQ. Deprecate File.createSource()
Change-Id: I222989d1ef915f7f14d7a3f36eab614a163faec3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 21:11:39 +00:00
Ben Konyi 9304826679 [ DDS ] Refactor DDS entrypoint to allow for overriding behavior in google3
This moves the CLI logic into lib/src/dds_cli_entrypoint.dart so it can
be invoked by a custom google3 entrypoint (bin/dds.dart can't be
imported using a package: URI).

Since google3 will be able to perform some custom configuration of DDS,
google3 related logic (e.g., `BazelUriConverter`) is also removed. This
is technically a breaking change, but should be safe as this
functionality isn't currently being used.

Change-Id: I54d8a9927ff2df70e013ca5c8bc1d510b0b95f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371520
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-13 20:27:22 +00:00
Konstantin Shcheglov 02faed0a9a Prepare to publish analyzer 6.6.0 and _fe_analyzer_shared 71.0.0
Bug: https://github.com/dart-lang/sdk/issues/55870
Change-Id: Ic06f4c0a2cc5dc5f07f72335dd172f203b948cb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 19:56:30 +00:00
Mayank Patke 0ddba91190 [dart2js] Convert SubclassResult to a sealed class hierarchy.
Change-Id: I151c2f6f72dcecaff6a6976f058940b9ddf97f47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371461
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-06-13 19:25:28 +00:00
Konstantin Shcheglov cc073a0782 Macro. Re-export package:_macros/src/executor/response_impls.dart from 'package:macros'.
Change-Id: I89e59cbac52edb5197e409e3000c5a3dedd80b3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371421
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-06-13 19:12:41 +00:00
Ömer Sinan Ağacan 1ec4677870 [dart2wasm] More JSON decoding improvements
- Use unchecked reads when reading from `U8List` chunks.

- Use unchecked reads when reading from "transition table" in UTF16 decoder.

- Fix a typo in a comment.

Tested: performance refactoring, covered by existing tests.
Change-Id: I1b90781f2b419188d6a560994159b48faad16075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371301
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-13 18:49:18 +00:00
Konstantin Shcheglov 9974252ac6 Increment DATA_VERSION.
https://dart-review.googlesource.com/c/sdk/+/371260 should have done this.

Change-Id: I34763f6221ad1c0f098d1c24eb9928935f917c78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371442
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-06-13 18:48:25 +00:00
Danny Tuppeny bf7f5171e5 [analysis_server] Treat field formal parameters and fields equally when finding references in LSP
This changes LSP's Find References to treat fields and field formal parameters as a single entity (matching what Document Highlights (Occurences) and Rename refactor does).

It does this in one direction by resolving the initial element to a field if it's a FieldFormalParameter, and in the other by including FieldFormalParameters when collecting the set of elements in the hierarchy to find references to.

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

Change-Id: I33626a8d58f35d0c3bda574078f32bf98f4bc87c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-13 18:34:33 +00:00
Keerti Parthasarathy 95f90f553f Remove unused code in test method.
Change-Id: I541762501e9546eaaf0f1022ebdebbeefe6413dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371460
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-13 18:30:10 +00:00
Mayank Patke ad3a1a72fd [dart2js] Convert IsTestSpecialization to sealed class hierarchy.
Change-Id: I08552d4dda928259be56e0b99f9f002baeb4d6b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371240
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2024-06-13 18:21:59 +00:00
pq dcf72c0882 quick fix for REPRESENTATION_FIELD_TRAILING_COMMA
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: Ib278e49749618325c8c5fcc7a5627840f87c4553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371401
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2024-06-13 18:02:14 +00:00
Danny Tuppeny 1ea71b4b9b [analysis_server] Handle unexpected types in LSP experimental client capabilities LSP gracefully
Previously if you sent values in experimental capabilities that are different types to what we'd expect, in some cases we'd throw an exception and fail to initialize the server.

Since the experimental section is not specified (it's specifically for off-spec things) the behaviour of sending values should (IMO) be considered server-specific. However, reporting a useful message and continuing to function is clearly better than reporting a cryptic error and failing to initialize.

At least one client (`kak-lsp`) appears to be sending values in `"commands"` intended for the Rust LSP server which uses a different format to we're using (a nested Map where we use a List). This change will prevent the failure for them and instead report a warning. My recommendation is that their client is also updated to not send Rust experimental capabilities to non-Rust servers.

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

Change-Id: I8cba1aa3a5beebf884ff247180f809ffd33b3111
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-13 17:29:49 +00:00
Devon Carew 1a45349ef6 [deps] rev async, convert, crypto, dartdoc, ecosystem, http, http_parser, path, shelf, test, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (4073129..a004370):
  a004370  2024-06-10  Kevin Moore  Bump min SDK, tighten dependencies, test wasm on 3.4 (dart-lang/async#277)

convert (70940e3..0c9eab7):
  0c9eab7  2024-06-10  Kevin Moore  latest lints, require Dart 3.4 (dart-lang/convert#107)

crypto (7a9428a..813e35e):
  813e35e  2024-06-10  Kevin Moore  Update min SDK, test wasm on 3.4 (dart-lang/crypto#174)

dartdoc (3decf1e..14d33d3):
  14d33d3a  2024-06-12  Sam Rawlins  Fix referencing an aliased type parameter. (dart-lang/dartdoc#3784)
  12d271a5  2024-06-10  Sam Rawlins  Combine the two implementations of "library canonicalization" (dart-lang/dartdoc#3781)
  ca61935e  2024-06-10  Sam Rawlins  Revert "Deprecate --resources-dir option. (`#3696`)" (dart-lang/dartdoc#3782)

ecosystem (865b2c5..b2b045f):
  b2b045f  2024-06-12  Devon Carew  remove extraneous quotes (dart-lang/ecosystem#270)
  fdedf3c  2024-06-11  Devon Carew  move to logging; check for safety exceptions (dart-lang/ecosystem#269)
  27574e0  2024-06-10  dependabot[bot]  Bump the github-actions group with 2 updates (dart-lang/ecosystem#268)
  6e53c96  2024-06-10  Devon Carew  updates for the blast_repo tool (dart-lang/ecosystem#267)

http (b522000..e2e2170):
  e2e2170  2024-06-11  David Wimmer  Update README.md (dart-lang/http#1231)
  f8d5bf8  2024-06-12  Anikate De  [pkgs/ok_http] Add functionality to accept and configure redirects. (dart-lang/http#1230)
  93ff4a9  2024-06-11  Anikate De  [ok_http]: Use the Android SDK to generate JNI bindings. (dart-lang/http#1229)

http_parser (551e0e4..53d4041):
  53d4041  2024-06-10  Kevin Moore  blast_repo fixes (dart-lang/http_parser#98)
  1ff06e4  2024-06-10  Kevin Moore  Update min SDK, test wasm on 3.4 (dart-lang/http_parser#97)

path (8fc4c72..04807b6):
  04807b6  2024-06-10  Kevin Moore  Update to latest lints, bump min SDK to 3.4, test wasm on 3.4 (dart-lang/path#168)

shelf (ea3c983..4c54af6):
  4c54af6  2024-06-11  Kevin Moore  [shelf_test_handler] Bump dev deps (dart-lang/shelf#435)

test (83c597e..329c6df):
  329c6dff  2024-06-10  Jacob MacDonald  fix windows failures (dart-lang/test#2244)
  777631bb  2024-06-10  Rexios  Bump min Dart version to 3.4.0 for WASM (dart-lang/test#2242)

webdev (9ada46f..eccc7d8):
  eccc7d87  2024-06-12  Parker Lougheed  Update `package:lints` and clean up library declarations (dart-lang/webdev#2436)

Change-Id: Ic7aede173c9730f0ccd1bc3138f50a92ddf49fce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371440
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 17:15:28 +00:00
Konstantin Shcheglov 09d1522f8a DevX. Issue 39451. Sort (almost) UnlinkedTokenType.
I decided to keep NOTHING at the top still.
The google3 is not an issue any more, AFAIK.

Bug: https://github.com/dart-lang/sdk/issues/39451
Change-Id: Iac96c64326b15527268347ebcadb35c616605279
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 17:10:06 +00:00
pq 9e51c2fa74 quick fix for EMPTY_RECORD_TYPE_WITH_COMMA
(Also improves fix description for `EMPTY_RECORD_LITERAL_WITH_COMMA`.)

See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I742506d8c1a77b10f99861aa84947f8d348916df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-13 17:05:54 +00:00
Derek Xu 92b744d1b2 Fix iso-stress job by preventing --sound-null-safety flag from getting passed to the VM
Runs of this job are currently failing and logging the message "Setting
VM flags failed: Unrecognized flags: sound_null_safety".
e.g. https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/iso-stress-linux/6150/overview

Change-Id: I2fe541dc801794b2e0c12c98bf1bcf6d774e41de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371380
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-06-13 17:02:03 +00:00
Konstantin Shcheglov 4e8af3bb56 DevX. Issue 54497. DeclaredVariablePattern in ForEachPartsWithPattern to final.
Bug: https://github.com/dart-lang/sdk/issues/54497
Change-Id: Ifa195d29a1a4db47fa12c221e6969ed0d8578a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 16:57:51 +00:00
Devon Carew 3d3016ecfa [triage] update the triage workflow to use the dartbot github token
Change-Id: Ib7de276fa13b961e2817fa28db3d3b647062c2aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371420
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-06-13 16:53:26 +00:00
Brian Wilkerson 80ba2a9524 Produce completion locations where previously produced
There are many places where the code is producing a different location
than OpType is, but those can be handled is a separate CL.

Change-Id: Idea7529a3e64ddb25a9b15bb68f7537abd3d19e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371202
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-13 16:44:48 +00:00
Brian Wilkerson aa3f144f1c Remove unnecessary code from some tests
Change-Id: If3ab5e836a1977ab1089cdefdeb661d8992543ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371183
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-13 16:06:09 +00:00
Ben Konyi bcaf745a9b [ package:vm_service ] Add missing code to code generator
Was added originally in https://dart-review.googlesource.com/c/sdk/+/367821

Change-Id: I7873e960319c10e995e24b1bb2514ede0c3299d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371360
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-13 15:03:49 +00:00
Sigurd Meldgaard d055df0383 Bump pub to 9ab905a24e36ef339c99f73bfb6683874feed8ce
Changes:
```
> git log --format="%C(auto) %h %s" df3664d..9ab905a
 https://dart.googlesource.com/pub.git/+/9ab905a2 Fix handling of directories in archives  (4306)

```

Diff: https://dart.googlesource.com/pub.git/+/df3664d17fd146ccd19b32820a022404da91f6d3..9ab905a24e36ef339c99f73bfb6683874feed8ce/
Change-Id: Ib95f00a8bf1306d5f43f37c80e2d5d92f7a427ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371125
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Sigurd Meldgaard <sigurdm@google.com>
2024-06-13 14:24:08 +00:00
Jake Macdonald 57fc55d934 rev the macros version, preps for a new release once publishing the package is fixed, see https://github.com/dart-lang/pub/issues/4305 for context
Change-Id: I8fe93ce7895fc6bb1b2ba896d8256366ae698ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371142
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2024-06-13 14:03:08 +00:00
Martin Kustermann 68229c4e58 [dart2wasm] Make is/as-checker helpers be used even if operand type is not InterfaceType
Right now the optimized is/as-checkers are only used when the operand
type is an [InterfaceType]. That means they don't get used for e.g.

   dynamic obj;
   T obj2;
   obj is String
   obj2 is List<dynamic>;

But we can use the is/as-checkers on any operand type as long as the
type we test against is an [InterfaceType] without arguments or where
the type arguments are equivalent to defaults-to-bounds (i.e. require
no checking).

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

Change-Id: I1adff52b3d880c37c344edb0c42ffd454d7b1164
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371124
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-13 13:18:59 +00:00
Martin Kustermann 6d185d2003 [dart2wasm] Make pkg/dart2wasm/tool/compile_benchmark more similar to dart compile wasm
This allows copy&past'ing commands from `flutter build web --wasm
--verbose` and replacing `dart compile wasm` with
`pkg/dart2wasm/tool/compile_benchmark`.

* We make the shell script recognize `-o` flag.
* We make the shell script recognize different platform being passed.

Change-Id: Iabecc7c87b35d35f073ced5e111a9ca5ea0d9298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371341
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-13 13:18:19 +00:00
Martin Kustermann d150ad8a81 [dart2wasm] Move local constant variable to top-level
The flutter platform file is compiled slightly differently from the way
we compile the normal SDK platform file. This slight difference -
somehow related to how -D environments are used in CFE - results in a
constant `VariableDeclaration` to stay in the kernel in flutter's case
but not in the Dart SDK's case.

(All usages of constant variables / fields will be
`ConstantExpression(<const>)` instead of
`VariableGet(<constant-variable>)`)

That in itself causes the kernel verifier AST visitor (which we call
from `pkg/dart2wasm/lib/compile.dart` in assertion mode enabled) to
report an error.

=> To work around this issue we hoist the only variable affected by this
to top-level.

=> That will allow us to run the dart2wasm compiler in assertions mode
on flutter apps without hitting the verifier problem.

(This has very likely to do with the fact that in flutter's case the
variable must result in an `UnevaluatedConstant` which then at a later
stage gets evaluated whereas in Dart's case we do that eagerly).

There's no easy way to write a test for this, as normal test files will
have an environment and therefore don't result in unevaluated constants
afaik.

Change-Id: I883b91bdc37ede8b45e35a15d0dddc296d9da9ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371340
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-13 13:10:50 +00:00
Sarah Zakarias d289a725a3 Add topics to pubspec.yaml
Closes https://github.com/dart-lang/sdk/pull/55922

GitOrigin-RevId: 5729941116885da445296f09c5de5d097154c53f
Change-Id: I2c4076506ae8d1411550320f12dba4ae2a6dc559
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369510
Commit-Queue: Sarah Zakarias <zarah@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-06-13 13:02:54 +00:00
pq 70f4e89ddf quick fix for EMPTY_RECORD_LITERAL_WITH_COMMA
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: Ifee29c7623f3322d4a35534e1c2a00d1cd6b0b03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-13 13:02:45 +00:00
pq 5cc92cf696 quick fix for STATIC_SETTER_WITHOUT_BODY
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: Id3b704915c03b61d9ba778b96c6e6fc55e1ef3dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-13 12:12:39 +00:00
Ömer Sinan Ağacan 633e7c4b15 [vm_service] Decode incoming JSON in one step instead of two
Currently we decode incoming data as a string, then parse the string as
JSON.

We can do it in one step by fusing a `Utf8Decoder` with a `JsonDecoder`,
which will be faster.

A difference between `jsonDecode` and the fused version is that
`jsonDecode` returns `dynamic`, the fused version returns `Object?`.

To keep changes as small as possible we cast the return value of the
fused verison to `dynamic` in this CL.

However using `dynamic` values is often slower than type casting it to
the right type and then using it. So it might make sense to cast it to
something like `Map<String, dynamic>` in a separate CL.

Change-Id: I76de535a72ae5532db5a27e543929519c48c701c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371080
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-13 11:53:40 +00:00
asiva e23e032406 [test] Fix isolate concurrency test to not pass in sound-null-safety flag
Change-Id: I57f252e427e35fcf4ad5e96465f3ad4e88ababea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371203
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-06-12 22:26:35 +00:00
asiva 7a068fae7d [pkg/kernel-service] Fix invalid index used in expression
TEST=ci
Bug: 55951
Change-Id: I58d3bd361666324f33a0e4b25f5b1e85ffa71440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371182
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-06-12 22:13:29 +00:00
Konstantin Shcheglov 78a0c7a5e1 DevX. Issue 54567. Support for joined cases in 'Convert to switch expression'.
Bug: https://github.com/dart-lang/sdk/issues/54567
Change-Id: Idb6cc7ecd88e1e9e3b14c6a54176c958bac36afa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-12 22:10:47 +00:00
Mayank Patke ca3e67a3b6 [dart2js] Add --interop-null-assertions.
This CL adds a new --interop-null-assertions flag (cf.
--native-null-assertions) with the goal of validating that JS interop
APIs with non-nullable static return types do not return null values.
This flag is currently disabled by default but is intended to assist in
sound null safety migrations.

In general, we don't guarantee type soundness of package:js interop
since users can write incorrect static types which are not backed by
any runtime checks. However, it is likely that during the null safety
migration, some interop APIs which should have been made nullable
weren't. Therefore, we want to offer some additional (but limited)
checking for this case.

For static invocations of functions with non-nullable return types, we
can simply perform a null check on the result of the call.
For instance methods (which could be invoked virtually/dynamically), we
want to perform a null check on the return value in the callee (the
interceptor method) itself when possible.

It's possible for multiple interop bindings to share the same
interceptor method. We produce a null check in the interceptor method
body if all the methods have non-nullable return types. Otherwise, we
insert checks at callsites when appropriate.

Change-Id: Ifd155d7f8326152b6d57d61199e0b7973c4a1211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369784
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-06-12 21:28:23 +00:00
Konstantin Shcheglov bb66bd92c8 DevX. Issue 53744. Remove 'const' that starts implicit constant context, add sibling 'const's.
Bug: https://github.com/dart-lang/sdk/issues/53744
Change-Id: Ie0dbfa420d247be47405f014f5b089bc59dde9f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371022
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-12 21:11:55 +00:00
Jake Macdonald f4899aa62e skip failing macro test
Bug: https://github.com/dart-lang/sdk/issues/55992
Change-Id: Ib2bfaf980d0edc7ac8a0e2a891983a3294ee1588
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371220
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-06-12 20:59:34 +00:00
Ryan Macnak 0713bce1fe [vm, gc] Check for pause requests when marking large arrays.
This was sometimes responsible for the largest GC pause in IsolateSendExitLatency, with a scavenge waiting for a concurrent marker to finish a whole array and pause.

TEST=ci
Change-Id: Ib2d8417ffe6cee3e8436a8c382d2db660e1eef41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371180
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-06-12 20:53:18 +00:00
asiva 418858b725 [VM/Runtime] - Remove unused sound_null_safety command line option.
TEST=ci
Change-Id: I9c471e809b2c218e75be5e938479ee8b6a76908b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365621
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-12 20:51:31 +00:00
Ryan Macnak f3cc30ab41 [vm, profiler] Fix sample representation to account for the change to 20-bit class ids.
TEST=ci
Change-Id: I6ba060d250069d71dcf38e4f7ab1a1ca240ce23d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371200
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-06-12 20:22:41 +00:00
Kallen Tu 0b31d88594 [test][wildcard-variables] Fix typedef record type.
This switch would've failed regardless. This CL switches the types of the typedef R so that this test would pass.

Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: Ic36863a38e3197bd9012907caa9f445faf4945b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371021
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-06-12 18:43:39 +00:00