Commit graph

99707 commits

Author SHA1 Message Date
Ryan Macnak a4072803b3 [vm] Avoid data race during Dart_IsolateGroupHeapNewUsedMetric.
Precise new-space usage requires looking at all the TLAB pointers and normally only occurs under a GC safepoint. For external queries coarsen the answer to capacity.

TEST=g3
Bug: b/324221135
Change-Id: I0e83bbcddba21ddf539fb2afdedf2959cef2c078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352682
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-14 22:56:49 +00:00
Keerti Parthasarathy 974dfa3071 Finally fix the windows bot failure
Change-Id: I731da6529aebd0679402fa4832ad001b0c1c242e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-14 22:37:59 +00:00
Nicholas Shahan b955d6a628 [ddc] Delete variance tests for old DDC types
- These tests rely on the internals of the old type system.
- Copy some expectations to the language suite when it looks like
  there isn't already coverage for the same test.

Change-Id: I63bfa2bc94fb29b4e4f90c3c02cf0943d19764b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352463
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2024-02-14 22:29:33 +00:00
Konstantin Shcheglov ea8efc6fc1 Augment. Add all library files, fixes search for constructor added by augmentation.
Change-Id: Idb6d489f454a028e7fa971d5b9f46550b5861940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352683
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-14 22:21:32 +00:00
Sigmund Cherem 9a9f23fd35 [tests] update await_for_test to test behavior variations.
This introduces an asyncExpectThrowsWhen to async_helper, similar to
Expect.throwsWhen, to allow specifying semantics under behavior
variations in this test.

We also update await_for_test to no longer skip expectations in dart2js.

Change-Id: Ie147f74f384a0e196e40b75c59fe585f011ede49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351721
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-14 21:43:47 +00:00
Sigmund Cherem 050afd650f [expect] introduce Expect.throwsWhen and Expect.throwsTypeErrorWhen
Today, most tests that touch on a behavior variation end up
skipping expectations or the entirety of a test for some
testing configurations.  Moving forward, we'd like skip less
and try to account for the behavior variations if that's
reasonable.

This CL shows an approach to improve our test coverage for
behavior variations. We introduce two new methods to
[Expect] that allow us to conditionally check that a
function throws, depending on variation predicates.

The CL changes expectations for errors that don't occur
when dart2js omits parameter type checks or implicit
downcasts.

Note: originally I had the intention to introduce a name
parameter to `Expect.throws` and `Expect.throwsTypeError` to
avoid introducing a new API. However, because these APIs are
used for testing core language features, such as function
parameters themselves, we decided to keep the use of
features in these APIs as simple as it can be.

CoreLibraryReviewExempt: no public library semantic change - only improving test coverage under variations
Change-Id: I531657622655778491eaca8b37ba69ffaab559fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351340
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-14 20:12:05 +00:00
Kallen Tu 7a82e8e995 [test_runner] Support new features in Requirements.
Support `checkedExplicitCasts`,`checkedImplicitDowncasts`, `checkedParameters`, `jsNumbers`, and `nativeNumbers`.

dart2js and DDC configs should support `jsNumbers`.
dart2js and dart2wasm (both optimized) do not support checked parameters nor implicit downcasts checks.
dart2wasm optimized does not support explicit cast checks.

This CL adds these features and makes sure certain configs are opting into these features.

Bug: https://github.com/dart-lang/sdk/issues/54798
Change-Id: If61d513569259317b1fb89c27d3fd97e3542697d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352103
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-02-14 19:55:51 +00:00
Robert Nystrom 86146ed6cf Bump dart_internal to allow Dart 3.3.
Change-Id: Ie11f05583cedbbb7a0e91e0d6924cc1ca1871561
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352681
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2024-02-14 19:49:32 +00:00
pq 1fad5e41f6 skip computing lints for macro generated augmentations
Fixes: https://github.com/dart-lang/sdk/issues/54875

Change-Id: Ia1e1f54268ffce82b6348b6edf3d1f0c976298fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-02-14 19:34:37 +00:00
Parker Lougheed 885126e51b [sdk/math] Mark Point, Rectangle, and MutableRectangle as legacy
These can't be deprecated for a while, at least not until 'dart:html' itself is.

In the mean time, we can at least discourage usage of it and direct developers to more appropriate, long-term solutions.

Contributes to https://github.com/dart-lang/sdk/issues/54852

CoreLibraryReviewExempt: Documentation only change that directs developers to more specific, performant, or flexible solutions.
Change-Id: I9d099a49909673f8af23eab480fdd225e56bcab2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351961
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-02-14 18:35:17 +00:00
Daco Harkes 9626a2552f [vm/ffi] Fix Pointer deferred materialization on deopt - fix test
This test deoptimizes, so it can't run in AOT.

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

Fixes: https://github.com/dart-lang/sdk/issues/54913
Change-Id: Ida2c67f20c8cf879db2cc9424f3d37535b76370d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352660
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2024-02-14 17:18:18 +00:00
Keerti Parthasarathy 4ef3c33932 Fix navigation test on windows
Change-Id: I4689e92cc32ca24c3204270bf378ec35d707d4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352480
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-14 15:48:39 +00:00
Daco Harkes 9968419f50 [deps] Roll dart-lang/native
Manuall roll for https://github.com/dart-lang/native/pull/964.

TEST=pkg/dartdev/test/native_assets/

Change-Id: Ie1e762ed57971db105cc9d6d5fa21e9f99e76453
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try,pkg-linux-release-arm64-try,pkg-linux-debug-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352642
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-02-14 15:32:59 +00:00
Daco Harkes db762108fb [vm/ffi] Fix Pointer deferred materialization on deopt
`Pointer`s were not handled in deferred materialization of objects
on deoptimizations. This lead to the address field being written as a
tagged value, causing the actual address to be smitagged.
Subsequent uses of those addresses would lead to segfaults.

This CL handles the `Pointer`s manually to deal with the untagged
address.

`--trace-deoptimization-verbose` before this CL:

```
Deoptimizing [...]
    _typedDataBase@8050071 <- Pointer: address=0x7ffff7488081
    null Field @ offset(8) <- 140736616678128
    null Field @ offset(16) <- TypeArguments: (H39d2e3b4) [Type: Never]
```

after this CL:

```
Deoptimizing [...]
    _typedDataBase@8050071 <- Pointer: address=0x7fa2c0a88081
    pointer@data <- 0x7fa29c16c0e0
    pointer@type_args <- TypeArguments: (H39d2e3b4) [Type: Never]
```

TEST=runtime/tests/vm/dart/regress_54871_test.dart
TEST=tests/ffi/structs_test.dart with --hot-reload-rollback-test-mode
     and --optimization-counter-threshold=50

Closes: https://github.com/dart-lang/sdk/issues/54871
Change-Id: I13b6404c8b098643b8ac0f59ee8e9bc635f33b8d
Cq-Include-Trybots: luci.dart.try:vm-reload-rollback-linux-debug-x64-try,vm-reload-rollback-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352300
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-02-14 14:15:16 +00:00
Jens Johansen 29782f8750 [CFE] Add a few helper utils
These ease my life slightly.
Examples:

Compile to executable to get faster runs:
```
out/ReleaseX64/dart-sdk/bin/dart compile exe pkg/front_end/tool/gitformat_cl.dart -o ~/bin/format_cl
out/ReleaseX64/dart-sdk/bin/dart compile exe pkg/front_end/tool/git_branch_helper.dart -o ~/bin/gitbranch
```

Now I can format my entire CL with
```
$ format_cl
Using file:///path/to/dart-sdk/sdk/out/ReleaseX64/dart
stdout> Formatted 3 files (0 changed) in 0.35 seconds.
```

and get info about my branching with
```
$ gitbranch
├── origin/main
│   ├── add_a_few_cfe_util_tools [ahead 2]
```

Change-Id: I2e89196ab702660a1486894d22678e3cd0c07994
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352641
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-02-14 13:56:18 +00:00
Martin Kustermann af1b5b8044 [dart2wasm] Switch binaryen optimization levels from -O3 to -Os
We want dart2wasm be comparable to dart2js / dart2aot, the ladder two
are much more conservative with inlining compared to current dart2wasm.

The -O3 is described in the binaryen sources as agressive for
performance and therefore willing to compromise code size.

The -Os is more nuanced: It will perform many optimizations that are
done in -O3 (and e.g. not in -O2) but it will make inlining less
agressive.

This reduces flute compile-time by 10% and code size by 10%
This benchmark results are mixed (some things get faster, some things
slower). Naturally there'll be specialized micro benchmarks that
get hit hard by this.

Where performance matters we should rather make dart2wasm use better
inlining heuristics and annotate code with
`@pragma('wasm:prefer-inline')`

Change-Id: Idf7e75e4e385629c9cec66359efe0afe50db3e72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352523
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-14 13:45:13 +00:00
Martin Kustermann 2f0bbd9c09 [dart2wasm] Roll binaryen to newer version
The newer version will contain optimizations that remove `array.len`
instructions of arrays that have a known length

Change-Id: I52a302fdfdc757e082c762c89cbcb68123025795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352524
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-14 13:41:46 +00:00
Parker Lougheed d1553ffda6 [cfe] Focus nullable subtype error messages
Now that the types in the message were recently adjusted to include the '?', I think it's beneficial to focus on what the underlying problem is rather than the syntax.

Change-Id: I7e59ea3cc2ce618fe46052a9c5e04a973a5f6ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349581
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-02-14 13:22:29 +00:00
Martin Kustermann 5d664b4bd4 [dart2wasm] Avoid using allowInterop in Promise<->Future conversion
The dart closures for the then/onError callbacks we use on a JS promise
will not flow back into dart. There's therefore no reason to use the
very heavyweight `allowInterop` mechanism.

This makes (after [0]) asynchronous calls to JS from Dart more than 2x
as fast.

This also aligns the `promiseToFuture` implementation with the extension on
`JSPromise` (see sdk/lib/_internal/wasm/lib/js_interop_patch.dart)
modulo the fact that the API doesn't work on interop types but Dart
types and needs therefore the full JS<->Dart conversion.

=> Maybe it would make sense to deprecate `promiseToFuture` / not offer it
in dart2wasm and make users use instead the extension on `JSPromise`
instead?

[0] https://dart-review.googlesource.com/c/sdk/+/352520

Change-Id: Ibc80bf083e7ec817f000257d6995108954060277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352521
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-14 11:48:15 +00:00
Daco Harkes 13532be38c [deps] Stop auto-rolling dart-lang/native
We're expecting to do multiple breaking changes to native_assets_cli
and native_assets_builder in the foreseeable future. So lets not break
the roller script for DEPS.

Change-Id: I6829de8d11e381fa2c56a974400ac636ec9e84cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350925
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-02-14 10:49:09 +00:00
Srujan Gaddam f20cd26533 Update JSExport docs to refer to createJSInteropWrapper
Also cleans up some wording and better explains all the possible
features of the annotation.

CoreLibraryReviewExempt: Docs for backend-specific library.
Change-Id: Id5f3e1ea09d2ceaf9f727eb7885b38319b978dd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352441
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-02-14 00:36:25 +00:00
kzrnm 47c93a9396 Fix path on Windows test
R=kustermann@google.com, mit@google.com, rmacnak@google.com

Bug: https://github.com/dart-lang/sdk/issues/54903
Change-Id: I132ef3385cdde03ab73df194414a38f9fd9927a9
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try,pkg-linux-release-arm64-try,pkg-linux-debug-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352240
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Kzrnm <gengesa@gmail.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-02-14 00:27:52 +00:00
Nicholas Shahan a92ac0237a [ddc] Delete tests requiring the old type system
These are tests for the specific apis of the old runtime type system
and they will never pass in the new type system.

Change-Id: I740fc06411cdc621b072782d22ec630c5b6bf96a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341784
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-02-14 00:13:57 +00:00
Alexander Markov 9d6b79749b [vm] Remove core-jit snapshots
Core-jit snapshots are no longer used.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47463

Change-Id: Ifadd6e8d913794f3e70cd4dfdc1758b0cd45f3ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352382
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-14 00:08:30 +00:00
Jake Macdonald 2624743bdd handle deserializing metadata diagnostic targets
Change-Id: I47f747baf48d6fc3a0e04871990d0743dbbb41e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2024-02-14 00:03:35 +00:00
Ryan Macnak 48cbd9b322 [vm] Identify the vm isolate etc by construction not by name.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54855
Change-Id: I31699c4343822e99a8fa275ba00dcdfa51cdd06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351220
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-02-13 23:32:01 +00:00
Paul Berry 0ae2ac1277 Language test of record demotion behavior.
When a local variable is promoted to a record type, and then an
assignment statement is used to assign a record literal to that local
variable, if the fields of the new record literal are not assignable
to the fields of the promoted record type, that's not a problem; both
the analyzer and front end agree that the local variable is simply
demoted.

But the spec implies that if the old and new record _shapes_ are the
same, then a compile-time error will occur instead of a demotion. I've
created https://github.com/dart-lang/language/pull/3613 to bring the
spec in line with the implementations. This test demonstrates the
current behavior of the implementations, and makes sure that it
doesn't regress.

Change-Id: I0eacd7ca7f6579a35dbc34687113a2112418f368
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352462
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-13 23:28:19 +00:00
Paul Berry c9e2b012b1 Make the type schema for null-aware spread operations consistent.
Prior to this CL, the CFE used a nullable type schema for null-aware
spread operators in list literals, but a non-nullable type schema for
null-aware spread operators in set and map literals. This was clearly
an oversight; a nullable type schema should be used for for null-aware
spread operators in all kinds of collection literals.

This change brings the CFE into alignment with the analyzer.

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

Change-Id: I0d5aa128656c22211228f0dd35ccee40925b4ef0
Bug: https://github.com/dart-lang/sdk/issues/54828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349921
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-02-13 22:25:41 +00:00
Martin Kustermann 385ab26022 [dart2wasm] Use identity hashmap for allowInterop closure map
This significantly speeds up certain operations as it avoids calling
complex closure equality logic in the hashmap operations.

See also [0] regarding us leaking those closures.

[0] https://github.com/dart-lang/sdk/issues/54908

Change-Id: I046063884b88fbe53bc3cb397b0087693c9b928a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352520
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-13 21:49:58 +00:00
Srujan Gaddam ecec70c6f2 Update web DEPS to use extension types and generics
This will be paired with a hotfix to land in google3. Updating the
DEPS to use the latest version of package:web will be done in a
future commit.

Change-Id: Ia09b34e14250c9b2c2586d1dc369e9ccbab8b331
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349960
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-02-13 21:43:59 +00:00
Nate Biggs 1c5eccdd2b [dart2js] Make KernelImpactConverter state settable.
By making `_impactBuilder` a settable field, it simplifies conditional impact registration.

Change-Id: Icf684f1def18532755218e893bb3037d49de1490
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352181
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-02-13 21:26:46 +00:00
Brian Wilkerson 156eda1723 Verify that outlines work in generated code
Change-Id: I0f8797634bce12943dbb739b7d3904f7cfaa3d39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352102
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-02-13 20:35:19 +00:00
Nate Biggs aead743863 [dart2js] Fix protobuf shaking algorithm.
- Reorganize conditional impacts/uses so that unused impacts only overwrite nodes that no other member condition is satisfying.
- Use `isMemberProcessed` instead of `isLiveInstanceMember` since some member conditions might be static members.
- Update deferred load algorithm to account for conditional uses.

Change-Id: I53ce6d283c5b79e0a7c9e7562fdcfe744e37bbc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-02-13 20:18:01 +00:00
Sigmund Cherem 955c8d63f6 [ddc] shard runtime_debugger_api_test.
This test appears to be timing out consistently in windows.

We split the test in two shards (sound vs unsound null safety)
as an attempt to address this issue.

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

Change-Id: I2230be95b1685ef1e5656eae2e740a94a0eeb320
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352049
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-13 20:10:17 +00:00
Nicholas Shahan 30a94fceaf Reland "[ddc] Fix running d8 with test.py"
This is a reland of commit 244f8cee87
with fixes for the file URIs passed on the command line.

Original change's description:
> [ddc] Fix running d8 with test.py
>
> - Add build targets to compile .dill outlines for common test 
>   dependencies using kernel_worker.dart.
> - Build ddc modules for common test dependencies and move amd versions
>   to a separate subdirectory.
>
> Change-Id: I126b5821f6aea00b753d83560c76f00c6c5edc61
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350081
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

Change-Id: I5a77512984fda1d91c812f1e240e9c10609914f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351622
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-02-13 20:09:58 +00:00
Keerti Parthasarathy 3904a92c40 Add call hierarchy tests for augmentations
Change-Id: I5078dc604f1c5368fde708cd95033d3b134874d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-02-13 20:00:13 +00:00
Konstantin Shcheglov de6d8cb813 Use File instead of String path in AnalysisHoverTest.
Change-Id: I945aef29b2f4284ba47597c13a718ea998f535c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-02-13 19:44:20 +00:00
Brian Quinlan 9967075787 [io] Fix a bug where Process.stdin.add exceptions could not be caught
Change-Id: I2383a74bfa6950ab8f8934087fb68218f06dd681
Bug:https://github.com/dart-lang/sdk/issues/48501
Tested: Unit test
CoreLibraryReviewExempt: dart:io only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351380
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-02-13 18:26:49 +00:00
Derek Xu 6ca01d0854 [package:dds] Prepare to publish v3.2.0
Change-Id: Ife473a673b673ec982ee339242235807530b04fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352340
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-02-13 18:21:35 +00:00
Brian Wilkerson 2a4d527633 Attempt to fix a failure on the windows bot
Change-Id: Icd170157c9b9db4965c47f7540ae80535f572c35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352400
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-13 18:05:29 +00:00
Devon Carew 55f5cd67eb Bump webdev to 629c63214466a77d0994e9b8003120f48af9ef1d
Changes:
```
> git log --format="%C(auto) %h %s" 2539d54..629c632
 https://dart.googlesource.com/webdev.git/+/629c6321 Renaming "legacy" paths and DDC modules to "DDC" paths and modules. (2360)
 https://dart.googlesource.com/webdev.git/+/a67291db Fix failing record kind test (2366)
 https://dart.googlesource.com/webdev.git/+/d9cb5769 Bump actions/cache from 3.3.2 to 4.0.0 (2368)
 https://dart.googlesource.com/webdev.git/+/603ddf0f Bump actions/stale from 8.0.0 to 9.0.0 (2369)
 https://dart.googlesource.com/webdev.git/+/0b5c2090 Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (2367)

```

Diff: https://dart.googlesource.com/webdev.git/+/2539d54bca7143a2dd1a1ec5d55fa38ca481639c..629c63214466a77d0994e9b8003120f48af9ef1d/
Change-Id: I9595962423d95364890df3370df18e702b1213c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352047
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-02-13 17:39:54 +00:00
Ryan Macnak 448b9ef989 [vm] Don't unnecessarily extend lifetime of KernelLoader handles.
ZoneHandles out-live the HANDLESCOPE for class finalization, and can accumulate a lot of objects during FinalizeAllClasses.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54886
Change-Id: Ia1330e0f27770c1a786a1b70e56881127cd936b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352052
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-13 17:30:29 +00:00
Konstantin Shcheglov 106db0d7b4 CQ. ErrorReporter, use atElement() instead of reportErrorForElement()
Change-Id: Ife5f6d04ee7c15e7703db3ad81eb7707c7f00ceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352053
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-13 17:16:07 +00:00
Brian Wilkerson e349b3faef Address a review comment that keeps getting missed
Change-Id: I74b0b77da6524300ee3cd4c6a32ce0b225391eab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352048
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-02-13 17:11:29 +00:00
Dan Chevalier 03f797a85a Solidify dtd lifecycle
- devtools server can now take the dtd uri as a parameter on startup
   - dtdUri is passed to the server handler so that devtools can request it.
- FileService is implemented inside the Dart Tooling Daemon (dtd_impl)
    - Added FileService.setProjectRoots
    - Added unit tests and rpc exceptions
- on startup dtd now prints { uri, secret } so that the caller has the secret that allows them to call FileService.setProjectRoots

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

Change-Id: I7a66aca2f8f06f6a611a46c727a9d5c2485fbe3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346922
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-02-13 16:17:18 +00:00
Lasse R.H. Nielsen 712df96202 Avoid type checks in Future.wait
CoreLibraryReviewExempt: Bypassing because Wasm-approver is OOO.
Change-Id: I484e900c14f181f56083b6e90a0d1f34546c85e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341504
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2024-02-13 16:07:12 +00:00
Alexander Markov a261196ea7 [vm] Remove context allocations for tear-offs
Previously, when taking a tear-off, a separate Context object was
allocated in order to capture receiver. Now, receiver is stored directly
in the Closure object in the 'context' field. This saves 1 object
allocation per tear-off and makes tear-offs cheaper compared to
explicit closures which can share context with other closures.

Benchmarks in AOT mode:

x64:
TearOff.NotInlined +40%
TearOff.NotInlined.InTry +43%
TearOff.Inlined.InTry +47%

arm64:
TearOff.NotInlined +27-43%
TearOff.NotInlined.InTry +29-43%
TearOff.Inlined.InTry +58-94%

arm64c:
TearOff.NotInlined +71%
TearOff.NotInlined.InTry +72%
TearOff.Inlined.InTry +96%

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/54808
Change-Id: I3ad95e8a8a4fc23f856bbc0fe238da58a9d25b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350945
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-13 15:33:38 +00:00
Morgan :) 6d57fe5a1c Revert "[macros] Tweak diagnostic for unexpected macro implementation exception."
This reverts commit 093271880a.

Reason for revert: Breaks some analyzer tests.

Original change's description:
> [macros] Tweak diagnostic for unexpected macro implementation exception.
>
> The only expected exceptions at this point are DiagnosticException and MacroException subtypes; everything else is a bug in the implementation.
>
> Tweak the diagnostic to explain that it's due to a bug in the macro. Add the exception message and stack trace as a context message, and a fix hint to contact the author.
>
> Add a language test.
>
> R=jakemac@google.com
>
> Change-Id: Ieaa6bedb3bc1646e4be61b384619152cc173b7e0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351040
> Auto-Submit: Morgan :) <davidmorgan@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>
> Commit-Queue: Morgan :) <davidmorgan@google.com>
> Reviewed-by: Jake Macdonald <jakemac@google.com>

Change-Id: Ia64c112aad79fdcdd1f6e1a4b800616632107fc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352260
Auto-Submit: Morgan :) <davidmorgan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-02-13 12:38:14 +00:00
Martin Kustermann c0371169b0 Cleanup some code regarding deprecated native syntax
The VM target no longer supports the `foo() native "foo";` syntax. See
final removal in [0].

Dart2Wasm has never really been using it.

* In the sdk dart2wasm uses `external` functions with
  recognizion in the compiler based on the name of the method.
* JS interop is using `@JS` based mechanism.
* Wasm to Wasm interop is based on `@Native<>()` annotations.

This means that only dart2js/ddc are remaining users of the
`foo() native;` syntax (without following string).

So we can clean up some code.

[0] https://dart-review.googlesource.com/c/sdk/+/266387

Issue https://github.com/dart-lang/sdk/issues/28791
TEST=ci

Change-Id: I929789f7a1ea5ed5423b0db0c6a306406e2db2af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351083
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-13 10:41:32 +00:00
David Morgan 093271880a [macros] Tweak diagnostic for unexpected macro implementation exception.
The only expected exceptions at this point are DiagnosticException and MacroException subtypes; everything else is a bug in the implementation.

Tweak the diagnostic to explain that it's due to a bug in the macro. Add the exception message and stack trace as a context message, and a fix hint to contact the author.

Add a language test.

R=jakemac@google.com

Change-Id: Ieaa6bedb3bc1646e4be61b384619152cc173b7e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351040
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-02-13 10:31:11 +00:00