Commit graph

92355 commits

Author SHA1 Message Date
Sigurd Meldgaard 62324794ca Bump pub to 42819a1e10f803eb7f6296692c5a976e1c647360
Changes:
```
> git log --format="%C(auto) %h %s" 078c7fe..42819a1
 https://dart.googlesource.com/pub.git/+/42819a1e Add missing await (and make downstream async) (3949)
 https://dart.googlesource.com/pub.git/+/c5c34c3e Add (more) trailing commas (3950)
 https://dart.googlesource.com/pub.git/+/a76c7916 Handle non-default hosts in `upgrade --major-versions` (3947)
 https://dart.googlesource.com/pub.git/+/a42800e5 Smallest update in `dependency-services report` (3761)
 https://dart.googlesource.com/pub.git/+/1be821d5 Remove usage of Isolate.packageRoot from tests (3945)
 https://dart.googlesource.com/pub.git/+/a16763a9 Validate that dependency names are valid package names (3940)
 https://dart.googlesource.com/pub.git/+/4a109f30 Expand constraint for `http` (3930)
 https://dart.googlesource.com/pub.git/+/8aee9515 Retry package:http ClientException (3939)
 https://dart.googlesource.com/pub.git/+/d7fa780d Add test for publish --skip-validation (3935)
 https://dart.googlesource.com/pub.git/+/5a3f21b4 Add strict-cast analysis option (3919)
 https://dart.googlesource.com/pub.git/+/fbb6f750 Merge pull request 3934 from sigurdm/cherry_pick_cache_warning
 https://dart.googlesource.com/pub.git/+/0dc18c02 Merge remote-tracking branch 'origin/master' into cherry_pick_cache_warning
 https://dart.googlesource.com/pub.git/+/fe6acca8 Warn about presence of legacy cache (3921)
 https://dart.googlesource.com/pub.git/+/0c2b0bb8 Handle pubspec_overrides.yaml in `add` and `upgrade --major-versions` (3920)
 https://dart.googlesource.com/pub.git/+/3a7dc04e Reinterpret dart sdk constraints when read from a lockfile (3897)

```

Diff: https://dart.googlesource.com/pub.git/+/078c7fea0be2656debc675646806da14fa94f853..42819a1e10f803eb7f6296692c5a976e1c647360/
Change-Id: Ic5a9b1fc1f03f029a36a208e31d919e5e82f0302
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310881
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2023-06-22 14:46:18 +00:00
Konstantin Shcheglov a8a3f3f77e [CMSR] Improve 'get invocation' implementation.
Change-Id: I871eddc1727ea6a51e169f4031d55ba3bc93527d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-22 14:38:38 +00:00
Sam Rawlins f264102869 Bump linter to 3632a3d83488af2ba8eb60e674b7e3b8de82816b
Change-Id: Ifd4937c81db36073ee2ec7f20b8fdfdc3f557cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310766
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-06-22 14:31:57 +00:00
Tess Strickland 0304832202 [vm] Check hash-based caches in the DRT_InstanceOf runtime entry.
We added a hash-based cache check in DRT_TypeCheck until the
SubtypeNTestCache stubs handle hash-based caches to avoid doing
the full runtime check when unnecessary, but did not do so for
DRT_InstanceOf. This fixes that until an upcoming CL that adds
support for hash-based caches in the SubtypeNTestCacheStubs lands.

TEST=Manual inspection of profiles before and after change. Not
adding an automated test as this change is a temporary bandaid
similar to the tested path in DRT_TypeCheck that will be removed soon.

Change-Id: I905a0fc6f501c68d66ae1ee848631c40cad04af2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310882
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-22 12:21:58 +00:00
Tess Strickland 97a09b90c8 [sdk] Add NativeRuntime.buildId to dart:developer.
TEST=vm/dart/build_id

Issue: https://github.com/dart-lang/sdk/issues/51941
CoreLibraryReviewExempt: Native runtime only API
Change-Id: Ib3757480f0eab6d147385a87adf657f4f709ec4e
Cq-Include-Trybots: luci.dart.try:vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-product-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-linux-product-x64-try,vm-aot-win-release-x64-try,vm-aot-win-product-x64-try,vm-aot-win-debug-x64c-try,vm-aot-android-release-arm_x64-try,vm-fuchsia-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307122
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-06-22 11:11:11 +00:00
Brian Wilkerson 1c3011cbf0 Capture a failing case in code completion
Change-Id: I6a21172628462d0f3b569360849f8417e48cad1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-22 05:19:58 +00:00
Brian Wilkerson 5c84db453d Initial framework for completion refactoring
This is some prepration for starting the refactoring of the completion
support. The plan is for `InScopeCompletionPass` to implement the first
pass of the proposed algorithm. My intention is to convert one
contributor at a time (as much as possible), starting with the
`KeywordContributor`.

Change-Id: I206c704f5c2370f4c37b674be01ab7fb55afa65e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-22 05:18:07 +00:00
Konstantin Shcheglov dc01c56e94 [CMSR] Test when the agnostic refactoring updates multiple files.
Change-Id: Ia80d9e31db9d7ad17472aff0e5f5595bf43bc9ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310778
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-22 05:11:55 +00:00
Srujan Gaddam e985d991b1 [dart:js_interop] Fix JSNumber conversions/semantics and JSBoxedDartObject
- Adds toDartInt and toDartDouble to JSNumber
- Changes semantics of int on external functions from truncate to
assert integer value
- Adds tests for number semantics
- Renames JSExportedDartObject -> JSBoxedDartObject to avoid confusion
with @JSExport
- Adds Object.toJSBox

JSNumber.toDart and Object.toJS will be removed in a future CL once
migrations are complete.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I8ff26ee5624c52703e49dd8483f62e829cb6fff0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309081
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-06-22 02:51:13 +00:00
Konstantin Shcheglov 7ecc57ac9e [CMSR] Split into separate files.
Change-Id: I45f1b13a2a025887ee7eb05179934f219097f67c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310776
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-22 01:19:08 +00:00
asiva d29341e1ea Ensure HttpClient.setTimelineLogging does not throw an exception in
product mode.

Change-Id: I38097caac847ac5211b1b12f77f342956eaecc6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309823
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-06-22 01:16:45 +00:00
Marcin Wojnarowski 330106212a Retain surrounding comments in remove comparison quickfix for if-statement
Closes https://github.com/dart-lang/sdk/pull/52544

GitOrigin-RevId: 267e6378cc9a3f64a1a177ec69279ed1baa61b4a
Change-Id: Idb51e14b46708d8b44bc703a4681deea7ec8b42e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-06-22 00:26:27 +00:00
Konstantin Shcheglov 6a65dd0efe [CMSR] Check the second file for ConvertFormalParametersToNamed.
Change-Id: I07a477701939cf2f40c8eeb77faf5a2d38290a5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-06-21 23:03:42 +00:00
Konstantin Shcheglov 1d9846b16f Remove ADD_NOT_NULL_ASSERT
We believe that it is not necessary anymore, with sound null safety.

Change-Id: I18741eafea1bd969139cdae3b94a294dde1b5abd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310769
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-21 22:54:12 +00:00
Danny Tuppeny eafa748a4b [dds/dap] Make hot reload test not flaky on Windows
On my Windows PC, this test often fails because the new content is never hot reloaded because the modification is made too soon after the app starts.

This change does what some Flutter tests do, which is to write a future modified stamp to ensure the file is considered updated when the reload is issued.

Change-Id: If52086fb279897d3e572162dc3a32436fbdb27c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-21 22:46:24 +00:00
Konstantin Shcheglov 55e7119183 [CMSR] Add new command to LSP, to convert selected formal parameter(s) to required named.
Change-Id: I7d86ccfe94cc960ea3a8204daf27f339c4ca767f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310764
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-06-21 22:06:44 +00:00
Konstantin Shcheglov 6a4f127831 [CMSR] Not available if external executable element.
Change-Id: Icf209c8cd844918a62195f8a024f0c0b8922f0d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310705
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-21 19:51:58 +00:00
Kallen Tu b8d8da0183 [analyzer] Refactor visitListLiteral to handle Constants.
Add CONST_FOR_LOOP error message to be clearer that for loops are not
allowed in const contexts.

visitListLiteral handles Constants.

Change-Id: I84465ecf4e1f044c256db45c723fac081b50a40c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306917
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-21 18:20:51 +00:00
Helin Shiah 02b10e1321 Revert "Send DAP events through DDS"
This reverts commit 5292ee8839.

Reason for revert: Causes failure on `sse_smoke_test` because it needs to set up an event handler.

Original change's description:
> Send DAP events through DDS
>
> Change-Id: Ib40306b8e47d74b02b6cbf348c2b5833cfb31a9d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309080
> Commit-Queue: Helin Shiah <helinx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

Change-Id: I62b12de8e2478441d9a7a4177ed1090aa845467f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310740
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-06-21 18:17:16 +00:00
Konstantin Shcheglov c3f3a00465 [CMSR] More checks for not allowed order of formal parameters.
Change-Id: Ida0380afb141873e75c27460b0804a8457c876e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310703
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-21 18:12:48 +00:00
Vyacheslav Egorov 8e6290bcb0 [vm] Remove unused ObjectStore::completer_class()
TEST=ci

Change-Id: I074c69dd81e3ed7b9b79f537a2162573d19c776f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310721
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-21 18:09:13 +00:00
Konstantin Shcheglov 67970cc613 Add failing tests for enum and 'if'.
Change-Id: I23187e0699df36c8a24d066a733382fe090e3b44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-21 17:57:29 +00:00
Brian Wilkerson bf62bc27bc Adjust the definition of coveringNode to favor identifiers
I would like to use `Selection` for code completion, but the current
definition of `coveringNode` too often favors the parent node over the
child node. This will effectively cause the cursor to bind more closely
to an identifier token than to other tokens, making it more useful for
code completion.

If we don't like this change for the general case, I can make these changes in a specialized `coveringNodeForCompletion`, but I'd rather not have two approaches.

Change-Id: I39e70f83ad44d50cec55a8bee1f7061dd83746fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-21 17:55:36 +00:00
Alexander Aprelev 7bdbc0560e [vm/win] Use wide-character api for local hostname on Windows.
Fixes https://github.com/dart-lang/sdk/issues/52701
TEST=test locally

Change-Id: Ia38b67cadea3d15824b06d0a2fc69f0c20192bb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310481
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-06-21 16:57:49 +00:00
Nate Bosch e4b7d100a1 Bump stream_channel to 34804a13bfa3112faecddfcd6a5a4f2b6e184aa4
Changes:
```
> git log --format="%C(auto) %h %s" b1d3384..34804a1
 https://dart.googlesource.com/stream_channel.git/+/34804a1 Fix a race condition in IsolateChannel.connectReceive() (92)

```

Diff: https://dart.googlesource.com/stream_channel.git/+/b1d3384638064a4f25beacef3be770e2c4534408..34804a13bfa3112faecddfcd6a5a4f2b6e184aa4/
Change-Id: Ia891fff9b22e68e829587e1993bb488b52ce5764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310483
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2023-06-21 16:12:58 +00:00
Helin Shiah 5292ee8839 Send DAP events through DDS
Change-Id: Ib40306b8e47d74b02b6cbf348c2b5833cfb31a9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309080
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-21 15:51:24 +00:00
Tess Strickland dfc1b6b16b [vm] Store the number of used inputs in SubtypeTestCaches.
Previously, SlowTypeTestStub would use the incoming instance and
destination type to determine which `SubtypeNTestCacheStub` to call,
where `N` is the number of inputs checked for each entry. The code
for generating `InstanceOf` instructions performs similar work,
inlining some checks and then falling back to checking and updating
an appropriate `SubtypeNTestCacheStub` if the inlined checks fail.

Meanwhile, the runtime would use all available information to
create a new entry when needed, depending on the `SubtypeNTestCacheStub`
called at runtime to ignore the parts of the entry it didn't need.

To illustrate a situation where the runtime might use more
information to create an entry than needed by the stub, consider
the following class header:

```
  class C<T> extends D
```

If no subtype of `D` requires knowing the specific type arguments for
an instance to determine whether that instance is an instance of `D`,
then the compiler can generate a `Subtype1TestCacheStub` call, where
only the class id of the instance is checked.

However, in the runtime, when updating the cache, the runtime will
create an entry that includes the specific type arguments used to
instantiate `C` when the initial cache miss occurred, as the runtime
does not know how many inputs the code that checks that SubtypeTestCache
uses. If the cache has grown to the point that it is hash-based, that
means the runtime uses the instance type arguments of the first cache
miss to determine the correct place to create a new entry.

When the stub only performs a linear search over the cache contents,
this works, as every entry is checked until a matching entry is found,
and thus the stub can ignore unneeded information. However, if a cache
is hash-based, this doesn't work: if the first miss was an instance
of `C<int>`, then the runtime includes all that information in a new
entry. This means the stub has to calculate the instance type
arguments, which it did not have to do before, and if a subsequent
check uses different instance type arguments (e.g., an instance of
`C<String>`), the result may still be a cache miss, and the runtime
adds another entry which has the same information as the previous
entry as far as the stub was originally concerned.

Thus, to limit itself to considering only the inputs used by the
appropriate `SubtypeNTestCacheStub`, the runtime needs to be told how
many inputs are used. This CL adds an additional field to
`SubtypeTestCache`s which contains the number of used inputs, and
changes the places where `SubtypeTestCache`s are allocated in the
flow graph compiler and the `DRT_TypeCheck` runtime entry to pass the
appropriate number of inputs. To ensure that the runtime and stubs
agree on how many inputs should be used, the `SlowTypeTestStub` now
uses the value of this field to determine which `SubtypeNTestCacheStub`
to call.

TEST=vm/cc/STC_{Linear,Hash}Lookup

Bug: https://github.com/dart-lang/sdk/issues/48345
Change-Id: Ie16f2d12c4c5eae856b668f28178818203662d1c
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-product-x64-try,vm-aot-linux-release-simarm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-release-ia32-try,vm-linux-debug-x64c-try,vm-linux-debug-x64-try,vm-linux-debug-simriscv64-try,vm-linux-release-simarm64-try,vm-linux-release-simarm-try,vm-mac-release-arm64-try,vm-mac-release-x64-try,vm-tsan-linux-release-x64-try,vm-reload-rollback-linux-release-x64-try,vm-reload-linux-release-x64-try,vm-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310180
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-21 15:24:30 +00:00
Tess Strickland 24ad7f9000 [vm/tests] Skip vm/cc/TypeArguments_Cache_ManyInstantiations on qemu.
This is just a larger version of another test
vm/cc/TypeArguments_Cache_SomeInstantiations, which does run on
qemu and tests the same paths, so it's okay to skip.

TEST=vm-linux-release-riscv64-qemu

Change-Id: Ie39665c818cc95c934582383b5e57d77f539f46d
Cq-Include-Trybots: luci.dart.try:vm-ffi-qemu-linux-release-riscv64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310680
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-06-21 14:43:25 +00:00
Paul Berry 2ca7380ab0 Flow analysis: fix first phase handling of pattern assignments.
Prior to this change, the first phase of flow analysis, in which flow
analysis "looks ahead" to see which variables are potentially assigned
in each code block, was failing to properly account for variables that
are assigned by pattern assignment expressions. This "look ahead"
information is used by flow analysis to determine the effects of
nonlinear control flow (e.g. to figure out which variables to demote
at the top of a loop, or to figure out which variables are potentially
assigned inside a closure). As a result, it was possible to construct
correct code that would be rejected by the analyzer and compiler, as
well as incorrect code that would (unsoundly) be accepted.

The fix is to call `AssignedVariables.write` from the analyzer's
`FlowAnalysisVisitor`, and from the CFE's `BodyBuilder`, to let flow
analysis know about variable assignments that occur inside pattern
assignment expressions.

Fixes #52745.

Change-Id: I0e6f426a5c5c36f214d5a206aaf5a2de0bfdaac1
Bug: https://github.com/dart-lang/sdk/issues/52745
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310502
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-21 14:33:42 +00:00
Kallen Tu 3deaeb84dd [analyzer] Refactor visitFunctionReference for the const evaluator.
Simple functions can be printed in dart_object_printer.dart.
Moving function reference tests around so they can be easily found together.


Change-Id: If022721f7dca4881d51cbebd65ed968cd89c33c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-06-21 14:29:48 +00:00
Aske Simon Christensen 5838562040 [dart2wasm] Add option and target for stringref.
This adds basic infrastructure for a stringref implementation in
dart2wasm:

- A `--[no-]stringref` option to the compiler
- An option in the `WasmTarget`, controlling the name of the target
- Separate sets of patch files for the two targets
- Separate platform dill files for the two targets

For now, the patch file contents are the same, and the compiler flag
is not used by the backend (only by the `dart2wasm` script to select
the appropriate platform dill file). Both of these will change as the
implementation progresses.

Tested: ci + manual check that the option selects the correct dill
Change-Id: I2c9bb95ba06fd3de3f7007703ef545e3f0c728ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310621
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-06-21 14:25:38 +00:00
Aske Simon Christensen 21d45c0268 [dart2wasm] Put string_patch into its own patch
Change-Id: Iae4c98406eb08fdf39929448bba53879f1fae61e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310580
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-06-21 14:25:38 +00:00
Vyacheslav Egorov 8f6eaeb883 [infra] Pass TEST_COMPILATION_DIR to Android tests
The whole directory is already copied to the device. This makes
it consistent with tests running on the host and allows us to
access various artefacts (e.g. SO files containing DWARF
information).

Change-Id: I9fe20fdbb48ad5a3742286a84c87f87f580f2c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310600
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-21 14:17:34 +00:00
Ömer Sinan Ağacan 2f27fc5ddf [dart2wasm] Update dart2wasm script
When DART_CONFIGURATION is not provided, search in output directory for
a configuration. Code copied from the `dart` script.

Currently the script only works without DART_CONFIGURATION on X64
systems, which is inconvenient when working on macOS or others.

Change-Id: I48c3e32f8824913932aee63e220e5152931b54db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310540
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-06-21 14:15:25 +00:00
Tess Strickland 9a6c33571f [vm] Set page_size_ to 0 after deleting the compressed heap.
When DEBUG is defined, deleting the compressed heap uses the
page size to check alignments.

TEST=*-debug-{x64c,arm64c} builds

Change-Id: Idc0c3fd213d1639234ae52a19466843464790e64
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64c-try,vm-aot-win-debug-x64c-try,vm-linux-debug-x64c-try,vm-win-debug-x64c-try,vm-ffi-android-debug-arm64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310581
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
2023-06-21 11:39:50 +00:00
Stephen Adams b64fc318e7 [dart2js] Update JavaScript global names list
The following would fail unminified because the variable shadowed the
global JavaScript constructor. The fix is to add more global names to
the avoid-list. This is not a problem for js-interop since those are
accessed via `self` or `globalThis`.

```
import 'dart:typed_data';

foo(int Float32Array) => Float32List(Float32Array);

main() => print((foo)(10));
```

Change-Id: I887ece4a888fdab5df437822f9f1f34b384ec24f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310482
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-06-21 01:49:57 +00:00
Robert Nystrom ce9e38fff1 Update package:dart_internal to work with SDK 3.2.0.
Fixes #52742.

Change-Id: I11cebf22f48788632e45cacc1e43c3be069a03dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310323
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-06-21 01:14:38 +00:00
Stephen Adams 5cbba84b91 [dart2js] Better const Maps and Sets
Constant Sets now have their own classes rather than being constructed as a wrapper over a const Map. The new scheme is similar to Maps - using a ConstantStringSet backed by a JavaScript Object 'dictionary' when the elements are all suitable String values, otherwise using a GeneralConstantSet backed by a list of elements that is converted to a lookup map on demand.

Constant Sets and Maps with suitable String keys are backed by a JavaScript Object literal 'dictionary'. The use of the Object literal has been changed so that the property values are no longer the values of the Dart Map, but the position of the key in the order of the entries. The values are provided as a List (Array), so there is an additional indexing operation to access the value on lookup. This does not seem to affect performance.

The advantage of the two-level lookup using the 'dictionary' is that Maps with the same keys (in the same order) can share a 'dictionary'. In order to achieve the advantage, the JavaScript Object is modeled as a first class ConstantValue - JavaScriptObjectConstantValue.

These changes achieve a code size benefit of -0.90% (~130K) on the main unit of a certain large app, and -0.35% for flute/benchmarks/lib/complex.dart

Change-Id: Icad2e6136218486a439e3c5ed0296462e3c3c4e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310020
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-06-20 23:44:08 +00:00
Brian Quinlan 739c9885a2 Bump web_socket_channel to af726526aa3613f5031036eaa64dea47a8428528
Changes:
```
> git log --format="%C(auto) %h %s" eae2258..af72652
 https://dart.googlesource.com/web_socket_channel.git/+/af72652 Make it more clear how `WebSocketChannel.ready` should be used. (272)

```

Diff: https://dart.googlesource.com/web_socket_channel.git/+/eae225866551ea7b51a380064521186a232bc0a4..af726526aa3613f5031036eaa64dea47a8428528/
Change-Id: Ie4568e06f25634b18491fa009a144b1fb60792ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310327
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-06-20 21:51:20 +00:00
Nate Bosch 08b587a715 Bump http to ff1fcfe5d77ea09b82a0aff0d796018504aef59b
Changes:
```
> git log --format="%C(auto) %h %s" 8c25057..ff1fcfe
 https://dart.googlesource.com/http.git/+/ff1fcfe Make StreameRequest.sink a StreamSink (965)

```

Diff: https://dart.googlesource.com/http.git/+/8c250575e7af92ef8131cc9b414e28bad5f7210e..ff1fcfe5d77ea09b82a0aff0d796018504aef59b/
Change-Id: Ib55aa7ebe048be83ca7b6ba5e845c6b92152b51a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310326
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-06-20 21:38:32 +00:00
Ryan Macnak dbd7b967af [fuchsia] Plumbing for the VMEX resource.
TEST=ci
Change-Id: I2e812e6eef2a3c6f91aec955609ece2ca4df15a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308805
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-20 19:28:18 +00:00
Elliott Brooks 70af4a9db0 Add constructor to RPCErrorKind enum
Follow up to https://dart-review.googlesource.com/c/sdk/+/307970

Learned from Kenzie this was possible :) https://github.com/flutter/devtools/pull/5917#discussion_r1231368050

Bug: https://github.com/dart-lang/sdk/issues/52636
Change-Id: Ic244765a6258c000c4171ece35273609c7ee5929
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309831
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-20 18:33:50 +00:00
Danny Tuppeny 421ac46702 [dds/dap] Implement missing "pause" request
Fixes https://github.com/Dart-Code/Dart-Code/issues/4597

Change-Id: Id21baa8428f80f5c9e80840caf836dc05c4f7209
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310343
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-20 18:29:26 +00:00
Devon Carew 053e7b2418 [deps] rev bazel_worker, dartdoc, http, protobuf, source_maps, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

bazel_worker (c14a268..f7b714e):
  f7b714e  2023-06-16  Jacob MacDonald  add firehose publishing workflow (#76)
  0743f11  2023-06-16  Parker Lougheed  Require protobuf 3.0.0 and prepare for 1.0.3 release (#75)

dartdoc (5799424..793d575):
  793d575d  2023-06-14  Sam Rawlins  Remove unused coverage feature (#3444)
  19ad21a4  2023-06-14  Parker Lougheed  Replace `@sealed` meta usage with keyword (#3445)
  8e9d89e3  2023-06-12  Sam Rawlins  Remove all `@deprecated` elements. (#3250)
  2019791c  2023-06-12  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.5.3 (#3442)
  d34c7067  2023-06-12  dependabot[bot]  Bump github/codeql-action from 2.3.6 to 2.13.4 (#3443)

http (ba7eb60..8c25057):
  8c25057  2023-06-16  Nate Bosch  Unskip a skipped test (#966)

protobuf (a9bf79f..e76bd74):
  e76bd74  2023-06-19  Ömer Sinan Ağacan  Remove protoc_plugin exe from repo, update .gitignore (#851)
  4b71e60  2023-06-16  Ömer Sinan Ağacan  Fix a change in protoc_plugin changelog (#846)
  f4ffa1d  2023-06-16  Ömer Sinan Ağacan  Fix missing protobuf import in grpc files (#845)

source_maps (dd5b5cd..58eef30):
  58eef30  2023-06-12  Kevin Moore  Require Dart 3, update lints (#79)

tools (8d6e8b8..02b5cc5):
  02b5cc5  2023-06-16  Brian Wilkerson  Add documentation for server events (#115)
  698bfe8  2023-06-15  Elias Yishak  Introducing new `Event` class that can be send via `analytics.send(Event event)` (#114)

webdev (81ae77a..b58edb7):
  b58edb7d  2023-06-16  Elliott Brooks  Fix the DCM workflow (#2147)
  1551fe6c  2023-06-16  Elliott Brooks  Wrap VM service API methods in an error handler to convert any exceptions into type `RPCError`
(#2144)
  06abe901  2023-06-14  Elliott Brooks  Add more tests to daily testing cron job (#2138)
  5cb2dcf6  2023-06-13  Elliott Brooks  Use new error codes from package:vm_service (#2141)

Change-Id: I6779c6d20fbc69e83848f469df3e0b4d21420a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310322
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-06-20 18:25:47 +00:00
Devon Carew 78da16c5ae [dartdev] fix an issue with the macos process listing
Bug: https://github.com/dart-lang/sdk/issues/52402
Change-Id: I71a9d1112475347beae5a634d0275847a5c7685e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308962
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-20 18:08:44 +00:00
Danny Tuppeny 2d197e4c60 [dap] Regenerate DAP classes based on latest published version of spec
A lot of this change is just documentation comments, but it includes some minor updates such as supporting "lazy" on variables.

All changes are backwards compatible and this should not affect any tests or functionality of Dart's DAP implementation (but provides the ability for us to use the new features).

Change-Id: Ief81927f2f370b4bfb6b5a9acc8659c45c33ea18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310161
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-20 17:29:24 +00:00
Alexander Markov 66f1611fee [vm] Deoptimize code if can-be-Future property of a class changes due to dynamic loading
Sometimes compiler omits type checks for the 'await' and 'return from
async' by relying on the fact that certain classes cannot hold
instances of Future.

In JIT mode, the property 'class-can-be-Future' may change when a new
class is loaded dynamically (e.g. through IsolateMirror.loadUri).

In such a case, the generated code assuming that certain class
cannot be Future should be correctly deoptimized.
This CL implements this deoptimization by adding such classes into
the list of CHA guarded classes.

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

Change-Id: Ib3a3768d073e8562b794186e72cb9d61e9f496fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309822
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-06-20 17:17:34 +00:00
Danny Tuppeny 01c02d6afd [dds/dap] Clear stored thread data on resume
When an isolate is paused, we store some data for things like variables, stack frames, etc. to round-trip an identifier to the client that it can ask about later.

Previously we never cleared these, so over time in a long debug session they could build up. The DAP spec says these references become invalid when execution is resumed:

> To simplify the management of object references in debug adapters, their lifetime is limited to the current suspended state. Once execution resumes, object references become invalid and DAP clients must not use them.

Because it's possible to resume one thread without another, I'm clearing up only the specific thread (isolate)s data when it resumes, rather than all of it.

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

Change-Id: I2ba7d9cd3f23b5a628d9e279e49edf2bee5afd29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310342
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-20 16:41:49 +00:00
William Hesse 98009cf7a7 [test] Report android infra failures correctly when running tests
Any adb failures when test_runner runs tests on android devices,
except an failure of the actual precompiled test when it is run,
should be reported as an infra failure and should shut down the
test runner.

After change https://dart-review.googlesource.com/c/sdk/+/291304
these types of failure were reported as test failures instead.

Fixes: b/281492587
Change-Id: Iea47ccffac81b0b92f3a3fb3780d2181d08fc1d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310260
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-06-20 15:49:38 +00:00
Martin Kustermann ef97228d03 [vm] Make vm/dart/regress_52703_test work on android
Closes https://github.com/dart-lang/sdk/issues/52739

TEST=vm/dart/regress_52703_test on Android

Change-Id: Ia568044d6663483e446c1945de70298c5bc111fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310281
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-06-20 13:31:29 +00:00