1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 12:06:26 +00:00
Commit Graph

101611 Commits

Author SHA1 Message Date
Daco Harkes
4b2906cdc1 [vm] Move ResolveUri to platform
This will enable the standalone embedder to resolve uris in a follow
up CL:
https://dart-review.googlesource.com/c/sdk/+/361881

The implementation was using zones for allocation, this CL switches
that to using `malloc`. The caller is responsible for freeing the
memory if resolving succeeds.

This CL removes `Dart_DefaultCanonicalizeUrl`.

We don't have a run_platform_tests, so this CL keeps the tests in
run_vm_tests.

TEST=vm/cc/ParseUri
TEST=vm/cc/ResolveUri
TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: https://github.com/dart-lang/sdk/issues/55523
Change-Id: Ifb300d8164eb50506f22ce619fad0811f74ef34c
Cq-Include-Trybots: luci.dart.try:vm-aot-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-win-release-try,vm-aot-linux-debug-x64-try,vm-linux-debug-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-aot-win-debug-x64-try,vm-win-debug-arm64-try,vm-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368423
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-12 16:45:19 +00:00
Ben Konyi
6b788d2a77 [ Service / DDS ] Re-introduce explicit cast to remove dynamic invocation of operator[]
Fixes failures in type flow analysis tests introduced by https://dart.googlesource.com/sdk/+/cf9623f3d9520bc58b7d3cba146934b69dba1d8f

TEST=pkg/vm/testcases/transformations/type_flow/transformer/bench_vector.dart

Change-Id: I401d12d42a64c64537722ef346dd86b1eff78f84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371140
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-12 16:34:17 +00:00
Kallen Tu
8095cb32c6 [cfe] Formal parameter wildcards are non-binding.
This CL changes the following:
- Formal parameter wildcards can have duplicate declarations.
- Formal parameter wildcards will produce an error when used.

Most of this CL is still needed even if we want to keep these parameters in scope. I'm working on that so I'll put this out in the meantime. The tech debt is small compared to getting a move forward on the functionality of wildcards.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: I5a8b6a8081ea6deb4cfd4bf2626280c6e8c98989
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370761
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-12 14:42:51 +00:00
Kallen Tu
2ec0ca25a8 [cfe] isWildcard set only with experiment on.
Only set `isWildcard` on variables when the experiment for wildcards is enabled.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: I54a1f0ba1b9192df6c86e44e92d5ff4bebc9a232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371020
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-06-12 14:25:59 +00:00
Johnni Winther
726f9f1a68 [analyzer] Generate multiple cases in missing cases fix
This pipes multiple witnesses from a non-exhaustive switch expression
or statement to the ADD_MISSING_SWITCH_CASES fix, such that multiple
cases can now be inserted in a single fix.

Change-Id: I5625bbb81c72917f10f4388cfe96d1bd1536c269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371062
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-12 12:45:09 +00:00
Ömer Sinan Ağacan
75f9312a50 [dart2wasm] Small optimization in JSON number parsing
Use `WasmArray<WasmI8>` for number buffer when decoding numbers.

This saves one allocation when growing the number buffer and on initial
allocation of the buffer, and eliminates one layer of indirection when
writing to the buffer.

Change-Id: Ic210bc13072f0dd34918361a1bee8c7b29ce61cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371064
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-12 10:50:27 +00:00
Johnni Winther
5986f91820 [cfe] Split CompilationUnit and LibraryBuilder
This moves CompilationUnit from being a supertype of LibraryBuilder
to only being implemented by DillLibraryBuilder and SourceLibraryBuilder.
This is done in preparation for fully separating CompilationUnit from
LibraryBuilder.

Change-Id: Id2e9488d5f35ab108d5067583541dec433b90cf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371081
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-12 10:46:18 +00:00
Martin Kustermann
dd92e9a0b4 [dart2wasm] Faster search in RTT supers data structure
If the transitive supers graph contains many classes we use a binary
search instead of a linear search.

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

Change-Id: I1018082e8d27090293b67a2239abfaf279270b9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370860
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-12 10:42:22 +00:00
Jens Johansen
c15466034e [status_files] Cleanup status files
Make tool (by default) give error when test entry specified in status
file does not exist. Make -w (by default) remove such entries.

Cleanup most status files, fixing a few entries containing `.dart` and
removing obsolete entries (i.e. entries pointing to nonexisting tests).

This should for instance have given an error in
https://dart-review.googlesource.com/c/sdk/+/370600 saying that the file
I specified didn't exist (in that I shouldn't have specified the `.dart`
part).

TEST=No tests, this is status file maintenance.

Change-Id: Ie977bf15dea2e3dad8d771fd3e99917317e975f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370886
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-06-12 10:21:23 +00:00
pq
86b43dc50c update status of unreported COVARIANT_CONSTRUCTOR
`COVARIANT_CONSTRUCTOR` is not reported by the parser (today) and constructors are treated the same as other members. This change updates fix status bookkeeping making it clear that the diagnostic isn't reported and so is not fixable.

Change-Id: I4944beef64e4c9ee42757430383291a54ae75f6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371061
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-12 09:29:39 +00:00
Sam Rawlins
21829623da linter: move avoid_js_rounded_ints tests
Change-Id: Ie569dba08fa0bf6fc25447b39015be381e79fe7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370461
Auto-Submit: Sam Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-06-12 08:38:35 +00:00
pq
a5cacf80b6 quick fix for STATIC_GETTER_WITHOUT_BODY
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I4a212bc638cc2a36d805af9eedd319fd3dc9c00b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-12 08:17:57 +00:00
pq
f1cf8c22d1 quick fix for LITERAL_WITH_NEW
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I43629f21645ed330b6a4732ae7f3e9ea616b3a97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370840
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-12 07:48:59 +00:00
Konstantin Shcheglov
d0998d6996 DevX. Issue 29106. Don't NON_ABSTRACT_CLASS_XYZ if the concrete extended class also has this problem.
Bug: https://github.com/dart-lang/sdk/issues/29106
Change-Id: Ie676295f104fcbb8458fbb27f3f01ed52e99fef9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-06-12 00:31:59 +00:00
Brian Wilkerson
2c97c6949e Include an empty body when suggesting a name for a top-level declaration that does not have a body
Change-Id: I92875fdb80b0541eaa5505b507e822915181ee52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370980
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-12 00:26:59 +00:00
Konstantin Shcheglov
73cd7c6439 CQ. Deprecate exports from package:analyzer/src/source/source.dart
Change-Id: I6256ad2a8472636fd39a9db7e0360f8d7104da0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369560
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-11 22:49:51 +00:00
Jake Macdonald
fac11694b4 Track async microtasks scheduled by macros, and ensure they have all completed before a macro returns.
Does not track certain events such as async I/O, but will refuse to execute the scheduled callbacks when those do complete.

Bug: https://github.com/dart-lang/sdk/issues/55426
Change-Id: Ie81100e9e4dbe49d050bad875cc9b6a65969863d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370120
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-11 21:02:29 +00:00
Kallen Tu
549a1b1987 [wildcard-variables] More language tests on declarations - classes, enums, extension types.
Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: Id1c48c3f6345d13c9c5f88224085a863e30f5aaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367985
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-11 19:44:41 +00:00
Ben Konyi
cf9623f3d9 [ DDS ] Update DDS launch sites to assume DDS process closes stderr
Removes risk of DDS connection information being split across two stream
events, causing JSON decoding to fail.

Also updates DDS to close stderr, even in the error case.

TEST=Existing service and dartdev tests

Change-Id: I5cceab899aac1fa63bd7578dd658b34096722bd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371000
Reviewed-by: Derek Xu <derekx@google.com>
2024-06-11 18:41:01 +00:00
Devon Carew
b640dffb0a [third_party] misc updates for the gitignore files
Change-Id: Ie3b816725128b27f3b48f9cb11e2c78ff3977652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370981
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
2024-06-11 18:09:59 +00:00
Ryan Macnak
4242ff536f [vm, compiler] Fix clobbered register on strex failure path when dirtying cards.
Add spurious store-conditional failures to the simulators.

TEST=golem
Change-Id: Ice3d18145cbb883cf868ad4ee077a2d1e56b15ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370962
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-06-11 18:00:35 +00:00
Devon Carew
f97004f639 Bump collection to c90b19f07b48391f3b1b4c39dd06ef0177f8e07c
Changes:
```
> git log --format="%C(auto) %h %s" 141d83a..c90b19f
 https://dart.googlesource.com/collection.git/+/c90b19f blast_repo fixes (348)
 https://dart.googlesource.com/collection.git/+/a1d2507 Add flattenedToList and flattenedToSet (328)
 https://dart.googlesource.com/collection.git/+/e9219c7 Deprecate whereNotNull from IterableNullableExtensions (332)
 https://dart.googlesource.com/collection.git/+/9e441f1 Deprecate transitiveClosure (336)

```

Diff: https://dart.googlesource.com/collection.git/+/141d83af3d7586ae9d27de610fd426071c98e5d3..c90b19f07b48391f3b1b4c39dd06ef0177f8e07c/
Change-Id: I9ed24345c132ad92ae65c5e70ab37647fad0ec00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370960
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-06-11 17:27:21 +00:00
Brian Wilkerson
45835b0933 Use the max number of suggestions to limit the number of candidate suggestions being retained
Change-Id: I4a60569fb4efe4af576b9adbb375c6e2e0b1727c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370720
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-06-11 17:03:05 +00:00
Elliott Brooks
22ae1db27f Update third_party gitignore so that package:dap is not gitignored during publishing.
Bug: https://github.com/dart-lang/pub/issues/4300
Change-Id: I0679d5425b90d454e6f2bd7e0de9d0aac9e84581
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370700
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2024-06-11 16:30:26 +00:00
Ömer Sinan Ağacan
455d85f528 [dart2wasm] Port VM JSON parsing improvements
This ports https://dart-review.googlesource.com/c/sdk/+/365803 to dart2wasm.

Benchmarks: https://golem.corp.goog/Revision?repository=dart&revision=110551&patch=19222

Change-Id: Id4a8e0f44abcde3552c50605d9b329443d43d1d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370821
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-11 16:10:23 +00:00
Ben Konyi
d96ff605e2 [ CLI / DDS ] Close stderr for dart development-service after connection details have been printed
This will simplify logic in clients parsing this information by
providing a clear signal that all connection data has been sent over the
stream and is ready to be decoded.

Change-Id: Iae3779fe13662bf15187e9fa41febba94af4f2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370940
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-06-11 16:06:47 +00:00
Ömer Sinan Ağacan
efc59ee300 [vm/libs][dart2wasm] Add some missing type arguments to convert_patch List types
Tested: existing tests
Change-Id: Ib19748e947ef9a80852ef80f7726b5d1c987a26e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370920
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-11 15:03:49 +00:00
Danny Tuppeny
b8cb98d0bb [dds/dap] Prevent duplicate values showing in variables views when a class has both a field and a getter with the same name
When a class contains both a field and getter with the same name, we'd include both in the `variables` response. In most cases these are the same value (although it's not guaranteed).

I've chosen to just hide the field in this case and always show the result from evaluating the getter (since I think that's what the user would expect, even in the case where they happen to have different values). Another option could be to show both (but change the name so that fields/getters are shown differently), however in that would change the display (for example adding `get ` in front of all getters) we should probably only do that if it's clear there is demand for it.

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

Change-Id: I9e23d22a844ee22c38988456b1f275422c5c9e04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370640
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-06-11 14:43:15 +00:00
Johnni Winther
2820e96b3c [cfe] Add repro/regeneration command to macro test
This prints the commands needed to reproduce or generate expectations
for the macro application test.

Change-Id: Idf62ec8d8bdc846d2b043328b447f51839984c48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370883
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-06-11 14:11:22 +00:00
Ömer Sinan Ağacan
e7d3b7820a [dart2wasm] Port VM JSON decoding improvements
This ports https://dart-review.googlesource.com/c/sdk/+/358445 to
dart2wasm.

The only difference from the VM patch is that we use `U8List` instead of
`Uint8List` for the chunk type in `_JsonUtf8Parser`, to avoid parsing
slow dart2wasm `Uint8List` subclasses (`JSUint8ArrayImpl`,
`_SlowU8List`).

Benchmarks: https://golem.corp.goog/Revision?repository=dart&revision=110551&patch=19217

Change-Id: I2af7131e72014587e97bab09e80e920c445b2c32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370820
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-11 13:41:20 +00:00
Ömer Sinan Ağacan
4796b25a30 Reland "[dart2wasm] Check import/export pragmas in user code"
This is a reland of commit 35bc17a0fa

Changes from the original CL is that we now allow packages in
`allowedInteropLibrariesInDart2WasmPackages`.

Original change's description:
> [dart2wasm] Check import/export pragmas in user code
>
> Change-Id: I926d108a4571d685c67d3a174a8e506910cce8f7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369020
> Commit-Queue: Ömer Ağacan <omersa@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I69f61ecf246dfdbfcab372c6c2adb2a64f2d0b36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370900
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-11 13:12:27 +00:00
Jens Johansen
5a49a95b39 [CFE] add --updateExpectations to coverage suite
So running `pkg/front_end/test/coverage_suite.dart --updateExpectations`
will update `pkg/front_end/test/coverage_suite_expected.dart` and a `git
diff` will give an overview of what changed.

Also save both number of hits and number of misses in the
"expect-file". If nothing else it will give some context
about what has changed.

Also cleanup json coverage output to be sorted and not
include "misses" that are also "hits" (the VM can give
this information).

Change-Id: I426681dde3d4d2ad0a9a7dfa474292c699223d68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370520
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-06-11 12:36:05 +00:00
Sigurd Meldgaard
4be693af0b Bump pub to df3664d17fd146ccd19b32820a022404da91f6d3
Changes:
```
> git log --format="%C(auto) %h %s" 6171682..df3664d
 https://dart.googlesource.com/pub.git/+/df3664d1 Reject overrides of workspace packages (4303)

```

Diff: https://dart.googlesource.com/pub.git/+/61716827b14e1848d82f1070ed5be881650c511d..df3664d17fd146ccd19b32820a022404da91f6d3/
Change-Id: I288c4cc3dc79028301872e26f6e8f664a3423e9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370801
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-06-11 11:20:08 +00:00
pq
19c5914ce5 quick fix for COLON_IN_PLACE_OF_IN
See: https://github.com/dart-lang/sdk/issues/55917


Change-Id: I2dbe760dd0d123fc4b1bf493c8f7699baaea376c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370503
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-11 11:00:14 +00:00
Chloe Stefantsova
55a12750ec Reland [cfe] Account for compilation stage in invocations post-processing
Closes https://github.com/dart-lang/sdk/issues/55849
Closes https://github.com/dart-lang/sdk/issues/55755

This is a reland of https://dart-review.googlesource.com/c/sdk/+/369063

Change-Id: I9033935b3b352108c8c28b7ae09eaa9673b0a6fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370560
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-06-11 10:48:15 +00:00
pq
fb3016a584 quick fix for INVALID_MODIFIER_ON_SETTER
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: Ieabdb7b9d12ef409d99497a32b6701a89c936434
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370481
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-11 09:28:47 +00:00
Martin Kustermann
847c35612a [dart2wasm] Make dart compile wasm compiled apps disable dart.library.ffi
This is a follow-up to [0]. That CL changed dart2wasm's modular
transformer to issue an error if `dart:ffi` is imported.

Users of packages that have specialized code for the VM (which supports
FFI) use conditional imports based on `dart.library.ffi`. We don't want
the VM-specific code to be used for web in dart2wasm (as dart2wasm
doesn't support the entirety of `dart:ffi`).

As a result we're going to make `dart.library.ffi` be false in
coditional imports (as well as in
`const bool.fromEnvironment('dart.library.ffi')`).

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

Issue https://github.com/dart-lang/sdk/issues/55948
Issue https://github.com/flutter/flutter/issues/149984

Change-Id: I70a775278ab701d1fd2596521e378cb6364edac2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370580
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-06-11 09:28:40 +00:00
Tess Strickland
324ba0c11f [vm/compiler] Extend Assembler::AddScaled to take a base register.
Add an additional base argument to Assembler::AddScaled so it now
computes:
  dest <- base + (index << scale) + offset

If base is kNoRegister (or ZR when available), then it emits
instructions optimized for computing:
  dest <- (index << scale) + offset
(i.e., its previous implementation)

Add AddScaled to AssemblerBase to ensure the same interface across all
architectures.

Rework the backend of CalculateElementAddress to use AddScaled
appropriately, which unifies it across architectures.

TEST=ci (refactoring)

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-debug-simriscv64-try,vm-mac-debug-arm64-try,vm-aot-mac-release-arm64-try
Change-Id: I33c8f99604b68360f10b79050bd66ceb9d65ac9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370504
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-06-11 08:33:29 +00:00
pq
9544fe9641 [wildcards] local and parameter scopes
Update wildcard variable scopes.

See:  https://github.com/dart-lang/sdk/issues/55862 and https://github.com/dart-lang/sdk/issues/55680.

See discussion on related/ updated co19 test (`co19/LanguageFeatures/Wildcards/wildcards_do_not_shadow_A01_t04`) here: https://github.com/dart-lang/co19/issues/2698.





Change-Id: I388895ef7bac69617700504a964ce9f3021b2d24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368526
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-06-11 08:14:35 +00:00
pq
7ead4b5786 quick fix for MISSING_TYPEDEF_PARAMETERS
See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I9b81940c1c515bf923ceecb83d5aaad1d416dab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370482
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-11 08:03:15 +00:00
Jens Johansen
49e0c0b33e [vm_service] Skip vm_service/test/coverage_closure_call_after_optimization_test.dart in aot (2nd try)
I by mistake added ".dart" in the status file in the first go, making it
not match.

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

Change-Id: Ibc0b9163b0a14766cf9cc6b43746f0bd6bc4ad90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370800
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-06-11 06:58:24 +00:00
Brian Quinlan
33563e5cf9 [io,doc]: Point out that exit does not kill child processes.
Bug:https://github.com/dart-lang/sdk/issues/53772
Change-Id: I38d18e97036b5684982a78f44f03634c5b3dceea
CoreLibraryReviewExempt: documentation only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370320
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-06-10 22:58:28 +00:00
Alexander Markov
6ab01427bd [pkg/vm] Consolidate kernel compilation options to an object
TEST=ci

Change-Id: Ic9a8801bff140b1393decde61917e8c61ab1945d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370721
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-06-10 22:56:50 +00:00
Konstantin Shcheglov
31a4bb7f60 DevX. Issue 22915. Show instantiated type alias in diagnostics.
Bug: https://github.com/dart-lang/sdk/issues/22915
Change-Id: I733bcb6021a167825840027df371fd22cfc71ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370701
Reviewed-by: Sam Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-10 21:19:08 +00:00
Ryan Macnak
ea9eb67d54 Roll Clang to 3809e20afc68d7d03821f0ec59b928dcf9befbf4.
Re-run clang-format.

TEST=ci
Change-Id: Ic277ea6baefa42bcc49ebce4f1099b910066cd4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370680
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-06-10 20:38:30 +00:00
pq
6cfe153e1e [wildcards] quick fix to convert UNUSED_LOCAL to wildcard
Fixes: https://github.com/dart-lang/sdk/issues/55965

Change-Id: I3585ce3823e0b7f7d2232611b27bb086b8b30d14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370505
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-10 19:42:06 +00:00
Kallen Tu
141bb5417b [kernel] Add isWildcard flag to VariableDeclaration.
Adds the `isWildcard` flag to variables. Will be using this for producing better errors.

TEST= Existing expectations tests for wildcards pass with new flag.
Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: If2f7a5555e7cc26e84d1b1e63e4261c81a157d78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370062
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-10 19:33:39 +00:00
Paul Berry
172bbe09cd Add type tracking to type inference logging.
This commit updates the type inference logging logic introduced in
https://dart-review.googlesource.com/c/sdk/+/369788 so that it
additionally tracks the context and static type for each inferred
expression.

Tracking the context for each expression is easy, since it is an input
to the type inference algorithm, passed in to each `visit` method of
`ResolverVisitor` through the named parameter `contextType`. However,
there were a few expression types for which the context type *wasn't*
passed in, because it wasn't used (for example
`ResolverVisitor.visitBooleanLiteral`, since boolean literals always
have the same meaning regardless of their context). `contextType`
parameters have been added to these `visit` methods for consistency
with the other expression visit methods, so that the type inference
log shows the context for all expressions, whether it makes a
difference to inference or not.

Tracking the static type for each expression is a little trickier,
since it's not an explicit output of the type inference algorithm, but
rather the static type of each expression is set as a side effect of
the type inference mechanism. To make things more tractable, the
`ExpressionImpl.staticType` field is made private, and instead of
setting it directly, the resolver must set it by either calling
`recordStaticType` or `setPseudoExpressionStaticType`. The former is
used when resolving a real expression; the latter is used for
situations where the analyzer assigns a static type to an AST node
even though that AST node isn't really serving as an expression
according to the official language specification. (For example, when
analyzing the method invocation `x.foo()`, the analyzer stores a
static type on the SimpleIdentifier `foo`, even though according to
the language spec, `foo` in this context actually isn't an expression
in its own right).

Splitting the code paths that set static types into `recordStaticType`
and `setPseudoExpressionStaticType` allows for the type inference
logging mechanism to check some useful invariants: it verifies that
every expression that the resolver visits is either assigned a static
type exactly once through a call to `recordStaticType`, or it's
determined to not be a true expression (and hence not assigned a
static type at all); I believe the latter happens mostly when
analyzing erroneous code, or when the resolver visitor is called upon
to assign a type to an identifier that's in a declaration context.

Change-Id: Icdf023d03fba3c87dbec3a72d00d0e9c7d1da5fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370322
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-06-10 18:07:01 +00:00
Devon Carew
8e219fcd08 [deps] rev collection, convert, dartdoc, ecosystem, http, mime
Revisions updated by `dart tools/rev_sdk_deps.dart`.

collection (586a5e8..141d83a):
  141d83a  2024-06-07  Graciliano Monteiro Passos  `CanonicalizedMap`: added constructor `fromEntries`. (dart-lang/collection#347)

convert (302af1b..70940e3):
  70940e3  2024-06-10  Alex Li   Upper-cast the return type of the decoder (dart-lang/convert#99)

dartdoc (ddb8fb4..3decf1e):
  3decf1ed  2024-06-07  Sam Rawlins  Restrict validation of runtime renderer files to a single, target version of (dart-lang/dartdoc#3778)

ecosystem (bc25c0c..865b2c5):
  865b2c5  2024-06-07  Devon Carew  update docs and metadata for package:sdk_triage_bot (dart-lang/ecosystem#266)
  268b516  2024-06-06  Devon Carew  initial version of a sdk issue triage bot (dart-lang/ecosystem#264)

http (a3567f8..b522000):
  b522000  2024-06-08  Anikate De  fix inconsistent test server behavior (dart-lang/http#1227)

mime (8d2d559..4ca2f5e):
  4ca2f5e  2024-06-10  Sarah Zakarias  Add `topics` to `pubspec.yaml` (dart-lang/mime#126)

Change-Id: I6b6279a4ff0af5ba19cc3c4180389b949f48d623
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-06-10 17:50:50 +00:00
Alexander Markov
9a3ca8ffd4 [vm,dart2wasm,tfa] Support dynamic interface in TFA
TEST=pkg/vm/testcases/transformations/type_flow/transformer/dynamic_module_extendable.dart

Change-Id: I6ef43053d86b1a12259f1cb4d0b542c9519591f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370143
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-10 17:28:10 +00:00