Commit graph

23249 commits

Author SHA1 Message Date
Kallen Tu 70b9b4637b [wildcard-variables] Add async rethrow test and wildcard patterns.
Fix follow up comments with an async rethrow test.
Tests that wildcard patterns still work while mixed with wildcard variables.

Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: If6ab4de68ff27ad51215427a7183f1aed7229947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367501
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-05-24 18:40:47 +00:00
Simon Binder 6b71aa1f3e [dart2wasm]: Add compile-time define identifying tool
Knowing whether Dart code is running in a WebAssembly context is useful
to potentially select different code paths exploiting differences in
JavaScript and WASM behavior or simply to report the information to
users (e.g. for crash reports).

Without such a constant, one has to rely on implementation differences
such as `identical(0, 0.0)` or check the available `dart:` libraries.
Both are error-prone, so having a reliable constant as an alternative
makes this easier.

Closes https://github.com/dart-lang/sdk/issues/55694

Change-Id: Ia969641e4b78223c394cbf251805cf77a30cb0fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365822
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-23 10:51:50 +00:00
Sam Rawlins c386ca52d7 Clean up ex-multitest: number/identifier_test
I convert the `noSuchMethod` tests to (imho) simpler tests of what
property access of `e` or `d` or `D` would look like on an int, via
extension getters.

The noSuchMethod test as it was written cannot be executed at runtime,
because (as of Dart 2, I think, maybe earlier), property access on
expressions is a compile-time consideration. And I think as a compile-
time error test, it's hard to see what it's testing.

Change-Id: I5c0ca728e6e812b8f35adb80b288be351c4b076a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367461
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2024-05-23 01:19:59 +00:00
Paul Berry 14c15d936a Fix detection of record field name mismatch in subtype matching.
Fixes #55802.

Bug: https://github.com/dart-lang/sdk/issues/55802
Change-Id: I9f9488cb09243679965ee891c45bee293af5056a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367462
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-05-22 14:22:00 +00:00
Stephen Adams fb057ea4e0 [js_runtime, js_dev_runtime] Implement microsecond field of DataTime
- Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.

- Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.

- The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.

- Both implementations report better errors.

- Fixed VM bug with in-range sentinel.


Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-05-22 05:18:52 +00:00
Kallen Tu bd8f87d477 [wildcard-variables] Test non-binding behaviour with top-level declarations.
Added a little section for late wildcard variables too.

This CL tests mixing top-level wildcard declarations with local wildcard declarations and the non-shadowing, non-binding behaviour.

Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: I72e7cfb1b2d80a3934af355579c36252881cf3fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367241
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-05-21 22:15:11 +00:00
Kallen Tu 03ea9eb524 [wildcard-variables] Basic language tests for non-binding locals.
Making language tests in small batches. These are very basic ones to test that you can have multiple local declarations named `_` in the same namespace without a collision error.

Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: I4d00e9072ba745b363d68db72505c599953c41ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366022
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-05-17 17:25:41 +00:00
Martin Kustermann 8fa0675a6d [dart2wasm] Make optimized builders run with --use-sdk (and therefore dart compile wasm)
This gives some more coverage for `dart compile wasm`

Change-Id: I62e7f9c6ecbdf80a1445c35d1733a7f89e6bcf54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366623
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-17 13:08:31 +00:00
Martin Kustermann e6e9b4e595 [dart2wasm] Only share type parameter fields if nullability allows
Closes https://github.com/dart-lang/sdk/issues/55741

Change-Id: I1e542041496d07714431ed40871031a117030736
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366940
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-17 12:07:56 +00:00
Devon Carew 2837647bea [wiki] move the https://github.com/dart-lang/sdk/wiki to the docs/ dir
Change-Id: I28db796fadcc111d97d3589bf3988ea0bbb8e18a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366682
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-05-16 18:19:40 +00:00
Paul Berry c734d583c1 Prevent .call tearoff on expressions whose type is a nullable type variable.
Note that this is not a breaking change, since the CFE already
correctly flags the error condition.

Fixes #55734.

Bug: https://github.com/dart-lang/sdk/issues/55734
Change-Id: I5570e0840ce20c2a761d88f698b9876f7543bd8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-05-16 16:44:29 +00:00
Stephen Adams 762ca98456 [corelib] Update date_time_far_away_dates_test
Bug: #37442
Change-Id: I0c04136bc4fdbf2908154a608f09311c5c511da5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366720
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-05-16 14:19:18 +00:00
Lasse R.H. Nielsen b06a34fc5a Don't allow completing a _Future with itself.
This never worked. It was silently accepted, at least if the future had no listeners, then any later attempt to use the future would cause a stack overflow or other impossible results.

Moves some `_Future._complete` call out of try-catch.
The `_complete` shouldn't throw (but before this fix it could).
Moving them out of the `try`/`catch` makes such errors be reported
as unhandled, instead of catching them and trying to complete the same
future again with an error, when it's possibly in an inconsistent state.

Fixes #43662.
Based on https://github.com/dart-lang/sdk/issues/43662#issuecomment-2058870247

CoreLibraryReviewExempt: No response.
Bug: http://dartbug.com/43662
Change-Id: I96a4f01bcd5b6cee93bba267299852569a9b905c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363060
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-14 15:44:07 +00:00
Martin Kustermann 3dfee274cc [dart2wasm] Use TFA-inferred types also for static fields
Currently the type of a static field is only based on the dart type, not
inferred types. This can mean that the type of such field is e.g.
`dynamic`.

Though the return type of the initializer function used the unboxing
information.

=> There was an invariant that if we use `null` to signal uninitialized
in the global, then calling the initializer will also result in a
non-nullable reference type.

=> This was invariant was broken by recent changes to dart2wasm that
take advantage of TFA-inferred unboxing information.

=> We fix this inconsistency by ensuring the wasm global's type is the
same as the initializer function's return type.

Change-Id: I9c27c0b28d2f81f888b4c9afc59dad42af2229ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365825
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-14 07:29:53 +00:00
Paul Berry 5b020f2ee6 [cfe] Make type inference for if-null expressions consistent with analyzer.
Fixes https://github.com/dart-lang/language/issues/3650.
Fixes https://github.com/dart-lang/sdk/issues/55436.

Bug: https://github.com/dart-lang/language/issues/3650
Change-Id: I30b39221c85713aab10f2edc35625f38e34cae5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362100
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-05-08 20:05:18 +00:00
Paul Berry 497d6105df [cfe] Make the context for await expressions consistent with analyzer.
Fixes https://github.com/dart-lang/language/issues/3649.
Fixes https://github.com/dart-lang/sdk/issues/55418.

Bug: https://github.com/dart-lang/language/issues/3649
Change-Id: Ifb2fe47bb343a357e2338843775f140c01bd8a88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361302
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-05-08 17:10:52 +00:00
Martin Kustermann bb044733cd [vm]/[dart2wasm] Fix list factory specialization code
The list factory specialization code can only know constant values
passed to `growable: <xxx>` if the variables are local and not
parameters.

TEST=corelib/list_factory_specialization_regression_test

Change-Id: I2c425108fd266fea6b443a7adee86c5a2b33a4d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365584
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-05-08 08:59:01 +00:00
Lasse R.H. Nielsen 281241ea71 Retire inference-update-3 experiment introduced in Dart 3.4.
The expriment is now retired in Dart 3.5, and the flag
stops being valid.

Change-Id: I1ecb087d45b90e98a7f0d3c15a6c8038a1c6982e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365260
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-05-03 12:26:59 +00:00
Martin Kustermann 74fbb380e2 [dart2wasm] Use concrete classes for wasm type representation selection
For example code that uses `Completer` in parameters/fields/...
used to be represented as `Object` in wasm type system, which we
can now represent instead as `_Completer`.

Change-Id: I35b2d8cb45717e58a813756dfa6278804552fbcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365020
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-05-02 12:28:48 +00:00
MarkZ 842c0981b2 [reload_test] Adding several new reload tests.
Change-Id: Ia654e827d7758d44ece6e52f4d8a15aae4f90e97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365122
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-05-01 20:01:19 +00:00
Paul Berry b026068313 Flow analysis: fix handling of list pattern type promotion.
When analyzing the type test implied by a pattern, flow analysis uses
three variables to control promotion behavior:

- `matchFailsIfWrongType`, which indicates whether flow analysis needs
  to account for the possible control flow path resulting from the
  type test failing. (This is `false` for cast patterns, because in
  the case where a cast pattern fails, an exception is thrown).

- `matchMayFailEvenIfCorrectType`, which indicates whether flow
  analysis needs to account for the possible control flow path
  resulting from the type test succeeding, but some other check
  causing the match to fail. (This is `true` for most list patterns,
  because the list pattern will fail to match if the list has the
  wrong length).

  (Note that `matchMayFailEvenIfCorrectType` doesn't account for the
  fact that a pattern match might fail due to failure in a subpattern
  match; this is automatically handled by the fact that flow analysis
  walks through the complete pattern in the order in which it
  executes.)

- `coversMatchedType`, which indicates whether the type test is
  guaranteed to succeed due to a subtype relationship between the
  matched value type and the type being tested (e.g. a `num x` pattern
  is guaranteed to succeed if the matched value type is `int`).

In the case where `matchFailsIfWrongType` is `true`,
`matchMayFailEvenIfCorrectType` is `true`, and `coversMatchedType` is
`false`, flow analysis must account for the fact that there are two
ways that the pattern match might fail: the type test might fail, or
the type test might succeed but then the pattern match might fail for
some other reason.

Before this change, this was done incorrectly, and flow analysis only
accounted for the possibility of the type test failing.

Fixes #55543.

Bug: https://github.com/dart-lang/sdk/issues/55543
Change-Id: I86603ec5f940402313f32177212b7960878db97f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364942
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-05-01 17:12:00 +00:00
Konstantin Shcheglov 33f0388776 Test. Support for optinal 'deferred as' to find URIs.
Change-Id: I923b65931de5d7ac56bea0b356474113ebb9a778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364627
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-01 15:45:58 +00:00
Martin Kustermann 24370b42b0 [dart2wasm] Represent ffi compounds as actual Dart objects (they are views on the actual memory)
This fixes issues where structs are accessed dynamically
or simply accessed in a nullable fashion, e.g. with `MyStruct? foo`

dart2wasm does not yet support using structs-by-value as arguments
or return values when calling linear-memory wasm functions.

dart2wasm also doesn't support structs-by-value created in dart
that are backed by WasmGC memory (e.g. arrays).

Change-Id: I9b9c60002d2d32db3f235f1cec25fe3b35fcc17b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365140
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-05-01 10:33:20 +00:00
Ryan Macnak d42a4b7219 [test] Run FFI tests on Fuchsia ARM64.
- Compile tests to kernel and use that instead of source for the Fuchsia test package.
 - Skip multitests instead of the running them and approving the failures.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/38752
Change-Id: Idd9bef0f6026c6d882712eb1083e88433bb53b13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333121
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-04-30 17:37:45 +00:00
Ryan Macnak 1ff4f72ebc Mark file system event tests as slow.
Restore timeout for windows-arm64, which did not get faster.

Change-Id: I9f032c25fc69454929348f0589d35200a4728142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364625
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-04-26 23:46:17 +00:00
MarkZ 6357371c0a [reload_test] Adding diffs to existing tests.
Change-Id: Icf7135ae46159ca834a54849c72405eec83f9b4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364384
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2024-04-26 23:05:10 +00:00
Ryan Macnak f02007839d [test_runner] Reduce timeouts.
We've roughly doubled bot speeds; half timeouts to provide pressure against this simply getting filled with slower tests.

Change-Id: I812da7adc6c08e6d484732c2558e0d3f63b2694a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364385
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-04-26 21:39:34 +00:00
Srujan Gaddam 307d739158 [dart:js_interop] Fix lowerings of ExternalDartReferences
Closes https://github.com/dart-lang/sdk/issues/55549
Closes https://github.com/dart-lang/sdk/issues/55340

Fixes several issues around using ExternalDartReferences:
- Better inlining of interop methods is enabled when this
type is used. This also indirectly improves inlining when
using JSAny.
- Adding some missed inlining for setting properties in
general.
- Allows opaque references of Dart functions to be passed
to JS
- Allows type parameters that extend ExternalDartReference
to be used in interop methods.
- Fixes up parent pointers of nodes in transforms.

Change-Id: I8cbd163ee3c1b98e733c35a61e6e83a0787d334c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364580
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-04-26 19:08:13 +00:00
Lasse R.H. Nielsen b464fc9037 Reland "Tweak expect.dart library."
This reverts commit cd2c566bcf.

Reason for revert: Updating to not remove field used by Flutter engine.

Original change's description:
> Revert "Tweak `expect.dart` library."
>
> This reverts commit ff5f391c0a.
>
> Reason for revert: The expect library is used by Flutter engine, and some of its tests use assertStatementsEnabled. There should be a migration path that doesn't require an atomic change, like adding the replacement api before removing the old one.
>
> Original change's description:
> > Tweak `expect.dart` library.
> >
> > Make API more consistent for a few methods.
> > Reduce the number of language features used in tests:
> > * Never iterating an iterable, always converting it
> >   using `.toList()` first and iterating using indices
> >   (fx `setEquals`).
> >   Also require a `List` in places where an `Iterable`
> >   wasn't necessary.
> > * Avoid doing complicated computations that are also
> >   used for the error message. Do simple check first,
> >   then recompute to get better error messages
> >   (fx `allDistinct`).
> >
> > Renamed some rarely used members for consistency
> > (`stringContainsInOrder`->`containsInOrder`,
> > where other string-contains functions just start
> > with `contains`, and `containsOneOf` -> `containsAny`
> > to match `Iterable.any` phrasing, and also it accepts
> > if containing at least one, not precisely one.)
> >
> > Removed a function that wasn't used anywhere.
> >
> > Moved `assertStatementsEnabled` to `variations.dart` as `asserts`.
> > Removed `typeAssertionsEnabled` and `checkedModeEnabled`. The former used in one place, where it was replaced with `checkedImplicitDowncasts` from `variations.dart`, the latter wasn't used anywhere.
> >
> > Deprecates `package:expect/minitest.dart`. It was never intended
> > to be used for new tests, only as a help to convert existing tests
> > written against `package:unit_test`.
> > All existing imports marked as `// ignore: deprecated_member_use`.
> >
> > Change-Id: I07e21d4c0f3ccf11b82ee34af2668fdbb22264d2
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352360
> > Reviewed-by: Slava Egorov <vegorov@google.com>
> > Reviewed-by: Ömer Ağacan <omersa@google.com>
> > Reviewed-by: Nate Bosch <nbosch@google.com>
> > Reviewed-by: Stephen Adams <sra@google.com>
> > Commit-Queue: Lasse Nielsen <lrn@google.com>
>
> Change-Id: I360b4347470a0bb2b63c3108e2b83ee2a771bf3f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362020
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Reviewed-by: Ömer Ağacan <omersa@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: William Hesse <whesse@google.com>

CoreLibraryReviewExempt: Reland
Change-Id: I53db40edc0733842a008839c3913d51c885e39ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362502
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-04-26 15:28:26 +00:00
Johnni Winther dd3fbffac7 [cfe,analyzer] Support new as identifier in metadata
The parser didn't support 'new' as identifier in this context.

The CL also adds the reporting of tear-offs as metadata for the CFE.
This was already handled by the analyzer.

Change-Id: I7ab5868fa83e5f216d0e7be7ae9cec4a2c865e80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364480
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-04-26 14:00:04 +00:00
Martin Kustermann 350954ae9d [dart2wasm] Fix this restoration code in sync* handling.
Noticed that the same bug that was fixed in [0] also exists in other
places.

=> Remove duplicated code & share in macro assembler.
=> Make use of this in async & sync* generator.

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

Change-Id: Id424ab5e8ed8ab70d19977d10cf80fb8b44b3872
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364441
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-04-25 10:38:35 +00:00
Daco Harkes 4b66657b98 [vm/ffi] address of operator for FFI leaf calls
During FFI leaf calls, the Dart GC will not run. This means that we
can pass pointers into `TypedData` to FFI calls that take `Pointer`
arguments.

After this CL, we have three types of arguments that can flow into
`Pointer` argument in an FFI call:
* `Pointer`.
* `TypedData`: Any typed data including views.
* `_Compound`: A TypedData/Pointer and an offset in bytes.

The is only possible for `@Native external` functions, `asFunction`
does not support passing in `TypedData`. (See related GitHub issues
for discussion. TLDR: FFIgen should generate bindings without config.)

`.address` expressions on `TypedData` and `Array` elements do _not_
introduce bounds checks, even though `TypedData` and `Array` have
bounds information. E.g. `ffiNative(Uint8List(10)[20].address)` does
not throw.

Implementation details:

The CFE analyzes call-sites to `@Native external` functions. If the
arguments are `.address` expressions, it transforms the call site to
pass the compound or `TypedData`. If an additional offset needs to be
applied, the CFE constructs a new `_Compound` with the correct offset
in bytes.

The CFE then also creates a new `@Native external` function which have
`TypedData`s and `_Compound`s parameters. To avoid name clashes, these
functions are postfixed with `#` and `P`, `T`, or `C` for each Pointer
parameter.

TEST=pkg/vm/testcases/transformations/ffi/address_of_*

In the VM, `TypedData` arguments are passed as tagged values, and the
address is loaded inside the `FfiCallInstr`. `_Compound` arguments
turn into two IL definitions, one for the `TypedDataBase` (tagged),
and one for the offset in bytes (unboxed). The address is then loaded
inside the `FfiCallInstr` and the offset in bytes is applied.

Adding the offset in bytes required an extra temp register for ia32.
Also, it uncovered that the temp register in arm32 was conflicting
with the argument registers. However, TMP should suffice instead.

TEST=tests/ffi/address_of_array_generated_test.dart
TEST=tests/ffi/address_of_struct_generated_test.dart
TEST=tests/ffi/address_of_typeddata_generated_test.dart

Closes: https://github.com/dart-lang/sdk/issues/44589
Closes: https://github.com/dart-lang/sdk/issues/54771

CoreLibraryReviewExempt: VM only, unsupported in dart2wasm
Change-Id: I01fb428cfd6f9096a34689c2819c124a8003cb6b
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360882
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-04-25 10:06:16 +00:00
MarkZ 9d08a13721 [reload_test] Adding support for negative tests in reload suite.
* Extends the frontend server controller to validate/reject compile errors in compiles/recompiles.
* Extends the config to permit an 'expectedError' entry.
* Adds a handful of tests to the suite (adapted from the VM's hot reload tests).

Change-Id: I47d814e375c4c72d0406ebf5bdfee3f1975c64f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363800
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2024-04-24 12:45:44 +00:00
Martin Kustermann e44bc22ca3 [dart2wasm] Fix bug in restoration of this in async functions.
When entering async functions we read the suspend-state's context and
populate local variables with the context parent chain as well as the
this pointer.

This restoration code assumed that `this` is stored in the outermost
context, which isn't necessarily the case.

In constructors the outermost context can contain the type parameters.

TEST=tests/web/wasm/capture_type_and_this_test.dart

Change-Id: Ie8e3c8732203aea4964d48cb78c97578d0322b2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364321
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-04-24 10:03:00 +00:00
William Hesse c10ecb8fe5 [test] Convert most lib/mirrors multitests to static error tests
Change-Id: I4f3b728a94291bf0a31a5f38af9d8b877a9900af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363702
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-04-23 23:33:48 +00:00
William Hesse d6c9c9f8bf [test] Convert syntax_native_test to a static error test
Multitests of compile-time errors should be converted to static
error tests, so they don't run on runtime configurations.
Static error tests also test for all the static errors,
their positions, and error message, in a single test run.

This test is currently failing on the common front end,
and on all runtimes, and passing on the analyzer. The
change keeps the failure on common front end by adding
expectations for an error to be reported at the right places.

Bug: https://github.com/dart-lang/sdk/issues/54153
Change-Id: Ic64961f6e0e575ec60626d4f70a0fdc5d71d024e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363085
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-04-23 23:11:17 +00:00
Alexander Markov 73783847fd [gardening] Fix corelib/weak_reference_test
This test incorrectly expects that WeakReference.target should be
cleared for a weakly reachable object. WeakReference specification
doesn't guarantee that:

a9f684e624/sdk/lib/core/weak.dart (L75-L76)

This change fixes the test to give up after certain number of
iterations instead of hanging forever.

Issue: https://github.com/dart-lang/sdk/issues/55518
Change-Id: Ief0ebe1452c83058a35fc1ba87e5a83924d43919
TEST=corelib/weak_reference_test
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363960
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2024-04-22 18:00:19 +00:00
Martin Kustermann 149db7eced [dart2wasm] Make commandline JS runner (run_wasm.js) initialize location.href
By initializing `location.href` in the commandline JS runners we allow
programs running in D8 to use `Uri.base` (which depends on
`location.href`).

That in return will allow running some Dart programs in D8 that would
otherwise not run (e.g. code using `package:test/test.dart` - which uses
`Uri.base`)

TEST=tests/web/wasm/location_href_test.dart

Change-Id: Ie219f8d9ece3b92f2442200539557f116d2c84ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363700
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-04-19 12:40:23 +00:00
Martin Kustermann 98808385d0 [dart2wasm] Fix bug in [Finalizer] implementation
The recent rewrite of [0] kept the existing semantics of the finalizer
implementation but migrated to the new interop semantics.

Turns out in that existing semantics there's a bug, namely that it
casted the peer object of to a non-nullable [Object] which is incorrect.

This CL
* fixes the cast to non-nullable [Object]
* moves the (currently) web-specific tests for
  [Finalizer]/[WeakReference] into `corelib` so it runs on all backends
* expands the finalizer tests to check finalizers get invoked
* expands the weak reference test to ensure weak reference is cleared

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

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

Change-Id: Ibd8c186b39100cff9e2f437f1a737034a5364830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363581
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-04-19 11:35:27 +00:00
Sam Rawlins a862d9d745 analyzer: Correct message about const addition operator
Fixes https://github.com/dart-lang/sdk/issues/54578

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Fixed: 54578
Change-Id: Iebc9e04539a172e58024758e33ffd93e48cb1a81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-18 17:21:29 +00:00
Ömer Sinan Ağacan eabb2b3aca [dart2wasm] Catch JS exceptions in async functions
When generating `try` block around a CFG block of an async state
machine, generate `catch_all` if the Dart `catch` blocks wrapping the
CFG block can catch JS exceptions.

`catch_all` bodies are identical to the `catch` bodies we already
generate.

The check for whether to generate `catch_all` is reused from the
non-async code generator without changes.

Fixes #55457.

Change-Id: I9d89593599da592106e12efb77c07d68b6cfce5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-04-18 08:57:39 +00:00
Martin Kustermann a133b75438 [dart2wasm] Enable weak reference / finalization tests on dart2wasm
This enables the currently dart2js/ddc-only tests for [WeakReference] /
[Finalizer] on dart2wasm.

As part of that we add a polyfill for the two implementations (just like
dart2js/ddc) do, to make the polyfill test pass.

We also migrate the implementation to use static interop.

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

TEST=tests/web/wasm_js_shared/weak_reference_*test.dart

Change-Id: Ic08ae41b6fc78fd9857172ca24695a7f91e06a78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363082
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-04-18 07:55:38 +00:00
Daco Harkes c0b938c228 [vm/ffi] Fix variadic arguments on MacOS Arm64
Non-variadic arguments on the stack on MacOS Arm64 are aligned to
the value size (which can be smaller than word size). However, for
varargs, the arguments on the stack seem to be aligned to the word
size.

This CL introduces an alignment strategy constant for primitives on
the stack in varargs and uses it in the native calling convention
calculation.

TEST=runtime/vm/compiler/ffi/native_calling_convention_test.cc with
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_macos.expect

TEST=tests/ffi/function_varargs_generated_native_leaf_test.dart

Closes: https://github.com/dart-lang/sdk/issues/55471
Change-Id: I51d20c3933a2cea9b110954ddec92fb91b9c3ecd
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362762
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-04-17 15:42:16 +00:00
Ömer Sinan Ağacan 55f2754d6b [dart2wasm] Fix JSStringImpl trim methods, add tests
Fix trim methods returning a new string (instead of the argument) when
there's nothing to trim.

A second bug fixed in NEL handling in `trim`: the last line should be
`result.substring(...)` instead of `this.substring(...)`. The bug wasn't
caught by any of the tests: NEL needs to be handled specially on the
browser, but mixing NEL with other whitespace wasn't tested in the
existing tests `string_trim_test` and `string_trimlr_test`, so a new
test file added with this case.

Change-Id: Ibf84e185de1b26c9811e3ea58c2ad3f223da8515
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363081
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-04-17 14:41:52 +00:00
Mayank Patke 159906059d [dart2js] Preserve is/as in ConstantTransformer with SNS checks enabled
Also amend SSA type builder to only optimize away casts to *sound* top
types when SNS checks are enabled.

Fixes: b/330884266
Change-Id: Ic619877b7f1e01e1065f4767549880aab2f81106
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363162
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-04-16 23:30:10 +00:00
Daco Harkes 51a67b8176 [vm/ffi] Reformat generated tests
`clang-format` has decided to format things slightly differently.
To prevent a huge diff on CLs touching
runtime/bin/ffi_test/ffi_test_functions_generated.cc, run a reformat
eagerly.

The generation script now explicitly uses the the clang-format from
the buildtools/ dir. (It was likely using the one on PATH.)

Also, clean up Dart imports to use single quotes, and generate an
ignore to prevent warnings.

TEST=tests/ffi

Change-Id: I54e24d62fe742770fb041bba73110c5285250fb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362763
Reviewed-by: Hossein Yousefi <yousefi@google.com>
Commit-Queue: Hossein Yousefi <yousefi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2024-04-15 10:55:46 +00:00
Daco Harkes 3fbf46c376 [test/ffi] Test native assets with assembly snapshot
Test the assembly snapshot flow with native assets.
This is a prerequisite for using the native linker in follow up CLs.

TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: https://github.com/dart-lang/sdk/issues/49418
Change-Id: Ib14c3e1edb652ac0eefeefd0b46fa0dd69c7fa67
Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362501
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-04-12 17:29:22 +00:00
Alexander Aprelev 8af6f94b61 [vm/datetime] Fix construction of '1 microsecond before epoch' DateTime.
TEST=corelib/date_time_extremes_test
Fixes https://github.com/dart-lang/sdk/issues/55438

Change-Id: I87f5c01450089a76703ae6a3326fc188f2b90903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362301
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-04-11 22:01:29 +00:00
Daco Harkes 3b07865faf [vm/ffi] AOT kernel concatenation with native assets
gen_snapshot can now consume a concatenated dill file.

Restrictions:
* The first dill file must be the main program.
* The subsequent dill files must only contain dummy libraries with
  objects which are recognized classes in the VM and not treeshaken
  in the main program.

This will enable compiling Dart AOT first, then using the tree-shaking
information to tree-shake native assets, and then embedding the native
assets mapping in the kernel file before running gen_snapshot.

TEST=tests/ffi/native_assets/asset_relative_test.dart

Closes: https://github.com/dart-lang/sdk/issues/50152
Bug: https://github.com/dart-lang/sdk/issues/55377
Change-Id: Id562aa39840d5eb467198efaa4cf3152d860f8b5
q-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362381
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-04-11 17:55:26 +00:00
Daco Harkes 2c952516a8 [vm/ffi] Test JIT kernel concatenation with native assets
The kernel_front_end will now allow passing in no Dart main program
when compiling a native-assets file.

The test now tests concatenating the dill files.

(A follow up CL will attempt the same for AOT dills.)

TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: https://github.com/dart-lang/sdk/issues/55377
Change-Id: Icbc6ab87d0015809f978966914064dbc6ab564a1
Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362340
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-04-11 17:55:26 +00:00
Ömer Sinan Ağacan c7834b6764 [dart2wasm] Fix array.new_fixed calls with too large size
Currently `array.new_fixed` has the upper size limit of 10,000.

Larger arrays need to be initialized with `array.new` or
`array.new_default`.

We handle this correctly in constant list and strings, but we didn't
handle it in `WasmArray.literal` consturctor. This CL fixes it.

Fixes #55396.

Change-Id: Icc79a3596c8ff544464a0142f3e0c9c63e39f63f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361780
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-04-10 11:00:31 +00:00
Jake Macdonald ddca3d2386 Use less static types, just check names and library URIs of declarations.
Also adds some additional "parallelizatoin" of async tasks.

Overall speedup of >50%, definitions phase in particular is about 75% faster.

Before:

[time: 16043 ms]
(name: <scheduler>, count: 0, elapsed: 0:00:00.000000, elapsedSelf: -0:00:15.823859)
  (name: analyzeFile, count: 104, elapsed: 0:00:15.823859, elapsedSelf: 0:00:01.428470)
    (name: libraryContext, count: 104, elapsed: 0:00:14.395389, elapsedSelf: 0:00:00.272344)(bytesPut: 5386317, cycleCount: 9, libraryCount: 115)
      (name: link, count: 9, elapsed: 0:00:11.027694, elapsedSelf: 0:00:00.529548)
        (name: computeLibraryScopes, count: 9, elapsed: 0:00:00.305524, elapsedSelf: 0:00:00.126633)
          (name: buildMacroApplier, count: 9, elapsed: 0:00:00.178642, elapsedSelf: 0:00:00.178642)
          (name: executeMacroTypesPhase, count: 9, elapsed: 0:00:00.000249, elapsedSelf: 0:00:00.000249)
        (name: executeMacroDeclarationsPhase, count: 9, elapsed: 0:00:00.367608, elapsedSelf: 0:00:00.367608)(constructorsOf: 100, methodsOf: 100)
        (name: executeMacroDefinitionsPhase, count: 9, elapsed: 0:00:09.226594, elapsedSelf: 0:00:00.002483)
          (name: executeDefinitionsPhase, count: 315, elapsed: 0:00:08.188795, elapsedSelf: 0:00:08.188795)(constructorsOf: 300, methodsOf: 300, resolve: 42000, typeDeclarationOf: 1200)
          (name: addMacroResults, count: 200, elapsed: 0:00:01.035316, elapsedSelf: 0:00:01.035316)
        (name: mergeMacroAugmentations, count: 9, elapsed: 0:00:00.598420, elapsedSelf: 0:00:00.598420)
      (name: macroCompileKernel, count: 1, elapsed: 0:00:03.095351, elapsedSelf: 0:00:03.095351)

After:

[time: 7774 ms]
(name: <scheduler>, count: 0, elapsed: 0:00:00.000000, elapsedSelf: -0:00:07.582758)
  (name: analyzeFile, count: 104, elapsed: 0:00:07.582758, elapsedSelf: 0:00:01.049135)
    (name: libraryContext, count: 104, elapsed: 0:00:06.533623, elapsedSelf: 0:00:00.232088)(bytesPut: 5385998, cycleCount: 9, libraryCount: 115)
      (name: link, count: 9, elapsed: 0:00:03.198967, elapsedSelf: 0:00:00.309712)
        (name: computeLibraryScopes, count: 9, elapsed: 0:00:00.184852, elapsedSelf: 0:00:00.079394)
          (name: buildMacroApplier, count: 9, elapsed: 0:00:00.105297, elapsedSelf: 0:00:00.105297)
          (name: executeMacroTypesPhase, count: 9, elapsed: 0:00:00.000161, elapsedSelf: 0:00:00.000161)
        (name: executeMacroDeclarationsPhase, count: 9, elapsed: 0:00:00.301573, elapsedSelf: 0:00:00.301573)(constructorsOf: 100, methodsOf: 100)
        (name: executeMacroDefinitionsPhase, count: 9, elapsed: 0:00:01.823845, elapsedSelf: 0:00:00.001162)
          (name: executeDefinitionsPhase, count: 315, elapsed: 0:00:01.101564, elapsedSelf: 0:00:01.101564)(constructorsOf: 300, methodsOf: 300, resolve: 400, typeDeclarationOf: 41200)
          (name: addMacroResults, count: 200, elapsed: 0:00:00.721119, elapsedSelf: 0:00:00.721119)
        (name: mergeMacroAugmentations, count: 9, elapsed: 0:00:00.578985, elapsedSelf: 0:00:00.578985)
      (name: macroCompileKernel, count: 1, elapsed: 0:00:03.102568, elapsedSelf: 0:00:03.102568)

Change-Id: I88f390ec01469e96ca8a43a49897e3e5b173b731
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362041
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-04-09 19:56:01 +00:00
William Hesse cd2c566bcf Revert "Tweak expect.dart library."
This reverts commit ff5f391c0a.

Reason for revert: The expect library is used by Flutter engine, and some of its tests use assertStatementsEnabled. There should be a migration path that doesn't require an atomic change, like adding the replacement api before removing the old one.

Original change's description:
> Tweak `expect.dart` library.
>
> Make API more consistent for a few methods.
> Reduce the number of language features used in tests:
> * Never iterating an iterable, always converting it
>   using `.toList()` first and iterating using indices
>   (fx `setEquals`).
>   Also require a `List` in places where an `Iterable`
>   wasn't necessary.
> * Avoid doing complicated computations that are also
>   used for the error message. Do simple check first,
>   then recompute to get better error messages
>   (fx `allDistinct`).
>
> Renamed some rarely used members for consistency
> (`stringContainsInOrder`->`containsInOrder`,
> where other string-contains functions just start
> with `contains`, and `containsOneOf` -> `containsAny`
> to match `Iterable.any` phrasing, and also it accepts
> if containing at least one, not precisely one.)
>
> Removed a function that wasn't used anywhere.
>
> Moved `assertStatementsEnabled` to `variations.dart` as `asserts`.
> Removed `typeAssertionsEnabled` and `checkedModeEnabled`. The former used in one place, where it was replaced with `checkedImplicitDowncasts` from `variations.dart`, the latter wasn't used anywhere.
>
> Deprecates `package:expect/minitest.dart`. It was never intended
> to be used for new tests, only as a help to convert existing tests
> written against `package:unit_test`.
> All existing imports marked as `// ignore: deprecated_member_use`.
>
> Change-Id: I07e21d4c0f3ccf11b82ee34af2668fdbb22264d2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352360
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Ömer Ağacan <omersa@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>

Change-Id: I360b4347470a0bb2b63c3108e2b83ee2a771bf3f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362020
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-04-09 18:10:57 +00:00
Lasse R.H. Nielsen ff5f391c0a Tweak expect.dart library.
Make API more consistent for a few methods.
Reduce the number of language features used in tests:
* Never iterating an iterable, always converting it
  using `.toList()` first and iterating using indices
  (fx `setEquals`).
  Also require a `List` in places where an `Iterable`
  wasn't necessary.
* Avoid doing complicated computations that are also
  used for the error message. Do simple check first,
  then recompute to get better error messages
  (fx `allDistinct`).

Renamed some rarely used members for consistency
(`stringContainsInOrder`->`containsInOrder`,
where other string-contains functions just start
with `contains`, and `containsOneOf` -> `containsAny`
to match `Iterable.any` phrasing, and also it accepts
if containing at least one, not precisely one.)

Removed a function that wasn't used anywhere.

Moved `assertStatementsEnabled` to `variations.dart` as `asserts`.
Removed `typeAssertionsEnabled` and `checkedModeEnabled`. The former used in one place, where it was replaced with `checkedImplicitDowncasts` from `variations.dart`, the latter wasn't used anywhere.

Deprecates `package:expect/minitest.dart`. It was never intended
to be used for new tests, only as a help to convert existing tests
written against `package:unit_test`.
All existing imports marked as `// ignore: deprecated_member_use`.

Change-Id: I07e21d4c0f3ccf11b82ee34af2668fdbb22264d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352360
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-04-09 14:49:17 +00:00
Jake Macdonald f48b8c6908 Support prebuilt macros in the incremental compiler mode for DDC
Also adds support for modular tests with precompiled macros, and one test exercising that.

Change-Id: Ie372ea7fcb270ecd55baa54c4ed1c4ae5a527df4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361261
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-04-09 07:37:26 +00:00
Ömer Sinan Ağacan b449e99118 [dart2wasm] Fix async* transformation of nested async* functions
With nested `async*` functions, the state of whether we're in an
`async*` function should be restored as the previous state after leaving
the nested function, instead of as `false`.

Fixes #55397.

Change-Id: I5f2a964847ae34e98584f3adad6df7857b81e474
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361600
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-04-08 12:42:29 +00:00
Daco Harkes 2e1a56f264 [vm/msan] Fix MemCopyInstr instrumentation
The MemoryCopyInstr on x64 in MSAN mode when forward copying was
unpoisoning at the wrong pointer. The `rep mov` changes the
destination register.

Now we unpoison _before_ the `rep mov` if it's a forward copy, and
_after_ the `rep mov` for backwards copies. This way the destination
register contains the start of the memory in both cases.

TEST=tests/ffi/msan_test.dart

b/266213262
Change-Id: I37688802e63797f650a8242b6ba8b884813ebbd0
Cq-Include-Trybots: luci.dart.try:vm-msan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361420
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-04-08 10:40:23 +00:00
MarkZ df75a619c8 [reload_test] Adding support for VM hot reload tests.
VM hot reload are run via:
1) We first emit a dill for every generation ahead of time (full dill on gen 0, incremental deltas subsequently).
2) We start a VM process at generation 0.
3) The VM process runs until it hits a `hotReload` command. It then uses the VM service protocol to connect to itself and reload the next generation.
4) The VM exits when the next generation isn't found.

* Adds config files to reload tests that allow runtime filtering.
* Implements VM-side hot reloading
* Adds several VM-specific hot reload tests

Change-Id: I1c6ad5c4eed426a0189c1b4af31297c9c1dba717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-07 16:39:49 +00:00
Alexander Aprelev 03a2f7da12 [vm/asserts] Allow --enable-asserts flag in product builds.
Product builds of gen_snapshot are used by dart cli tools. So if we are to allow --enable-asserts for 'dart compile' commands, we need to allow this flag in product mode.

BUG=dartbug.com/53343
TEST=ci

Change-Id: I6252b6ee42ed45a25df2046f4a6642c880e8ee14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361122
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-04-05 22:48:17 +00:00
Srujan Gaddam 2631319edf [dart2wasm] Use node's enclosing library annotation for lowerings
Closes https://github.com/dart-lang/sdk/issues/55359

The current library's annotation is used for the interop lowerings
in dart2wasm. For most members, this is okay because we emit the
equivalent JS code for the member when we visit the procedure and
not when we visit the invocation. However, for methods, the invocation
determines the resulting JS call due to the existence of optional
parameters. In that case, if the invocation was not in the same
library as the interop member declaration, it results in using the
wrong library's annotation value.

Adds tests for this case and does some cleanup of existing tests.

Specifically:
- Adds a consistent naming scheme for test libraries that are
namespaced.
- Adds code to delete the non-namespaced declarations so that the
namespaced interop methods don't accidentally call those declarations.
- Removes differentArgsMethod which was already tested in
js_default_test.
- Removes use of js_util in favor of js_interop_unsafe.

Change-Id: Iac2abe7f11b17b149fb6726c007e1ffa434c3c5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361241
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-05 17:43:48 +00:00
Ömer Sinan Ağacan 6de879e0f5 [dart2wasm] Fix exception handling in async functions
Fixes #55347.

Change-Id: I9ced2a4c06e6cb9714dc47e3661f5582c70cdeb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361063
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-04-05 14:23:00 +00:00
Paul Berry 34561fac0a Additional improvements to inference-update-3 tests.
This CL makes the following improvements (suggested in the code review
of https://dart-review.googlesource.com/c/sdk/+/356303):

- Add parenthetical comment "(Testing this case here. Otherwise
  continued below.)", to reduce confusion for a reader reading the
  tests for the first time.

- In all test cases using a promotable variable `o`, declare `Object?
  o;` first, then assign `o = ... as Object?;`. This makes the test
  cases more symmetrical, since `o = ... as Object?;` now appears in
  every test case, rather than getting coalesced with the variable
  declaration in some test cases but not others.

- Consistently use `e` rather than `E` to refer to the whole
  expression being tested.

- Expand on the explanation for how each test case matches up to the
  type metavariables K, T1, T2, etc., and why the expected result
  occurs.

- Remove tickmarks around type metavariables.

- Clarify that the type S is chosen, rather than T, only when the
  feature is enabled.

Change-Id: I149b323daeac9fc44104681370cea33ee010faa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357204
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-04-04 21:24:34 +00:00
Nicholas Shahan 5532568778 [ddc] Add configuration to compile with asserts
- Assertions are enabled in the compiler itself. DDC already enables
  assertions in the test code by default. 
- Runs tests in d8.

Change-Id: Ibdf285d9ab182c3859f4724b4c0740579d6d2377
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349361
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-04-04 14:40:30 +00:00
Nicholas Shahan eda91b407d [tests] Add implicit downcast requirements
Some expectations in these tests rely on implicit downcasts throwing
errors at runtime.

Fixes: https://github.com/dart-lang/sdk/issues/55353
Change-Id: Ie1923e26552b95ddb3d4199e0f8f5a2a05e2c124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361004
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-04-04 00:42:24 +00:00
Nicholas Shahan 2379cdc080 [ddc] Enforce more null safety on js interop
- Add a runtime flag to enable checks on non-nullable APIs that
  return values from non-static JavaScript interop.
- Call a new helper method at the call site when these APIs are
  detected to perform the null check.
- Add test file for the cases we can detect and enforce.

NOTE: This does not make non-static JavaScript interop sound.
This only adds more checks to enforce soundness with respect
to nullability in some cases. There are still holes that will
never be closed due to the permissive nature of this form of
JavaScript interop.

Change-Id: I2f88d1543a683fdc84d764e2b0eaafeb0ca73107
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358581
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-03 23:20:15 +00:00
Paul Berry a52ab579af Use an OWNERS file to restrict editing of tests/corelib to language team.
Change-Id: Ia42a8d9b7be44465e880685c790fe193721c2c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360900
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-04-03 15:57:20 +00:00
Jackson Gardner d0061b65fc [dart2wasm] Include file, line, and condition text in assertion's toString()
This fixes https://github.com/dart-lang/sdk/issues/55317

Change-Id: I2371423a9715059b8a4c4ede2ef567a4b6293287
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360460
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2024-04-03 14:14:08 +00:00
Nicholas Shahan add2f411e6 [web] Add static js interop .call() tests
These tests should help:
 - avoid regressions in the existing behavior
 - highlight incremental improvements towards implementing the
   desired behavior (with corresponding changes to the expectations)
 - identify the differences between the JavaScript and wasm compilers

Change-Id: Ie95233868a13b7ffffc2688ab7c973dcd14ed721
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359246
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-04-02 17:03:12 +00:00
Nicholas Shahan 8ca97716cc [dart2js,ddc] Add package:js .call() tests
Some expectations in these tests do not match the language 
specification or are undefined.

These tests should help:
 - avoid regressions in the existing behavior
 - highlight incremental improvements towards implementing the 
   desired behavior (with corresponding changes to the expectations)
 - identify the differences between the JavaScript compilers

Change-Id: Icaa7371b3cf8c4221e4348176f712b3d03196720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359245
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-02 00:41:23 +00:00
Nicholas Shahan 235b84418f [dart2js,ddc] Add .call() tests
Some expectations in these tests do not match the language 
specification.

These tests should help:
 - avoid regressions in the existing behavior
 - highlight incremental improvements towards implementing the 
   desired behavior (with corresponding changes to the expectations)
 - identify the differences between the JavaScript compilers

Change-Id: If7710d0559f5a481e0daf25b5a6a67b0f2082ccc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359244
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-04-02 00:41:23 +00:00
Daco Harkes eb50c2683c [vm/ffi] Throw on attaching NativeFinalizer to deeply immutable object
This CL

* adds a `kind` to `CheckWritableInstr`,
* starts using `CheckWritableInstr` in JIT mode, and
* adds support for `CheckWritableInstr` ia32.

TEST=tests/ffi/vmspecific_native_finalizer_deeply_immutable_test.dart

Closes: https://github.com/dart-lang/sdk/issues/55067
Change-Id: I0b397daba12cfc8b885401169889f7cd7c040166
Cq-Include-Trybots: dart-internal/g3.dart-internal.try:g3-cbuild-try
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359223
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-03-28 11:24:36 +00:00
Konstantin Shcheglov 36c0788137 add package:_macros (SDK vendored) and package:macros (pub published)
add sdk_packages.yaml file (describes SDK vendored package locations)

delete old macro code in _fe_analyzer_shared, move tests/benchmarks

adds a top level `pkg` directory to the Dart SDK, which is where vendored packages live

BUG: https://github.com/dart-lang/sdk/issues/54976
Change-Id: Ib3503a27fb5644fa8a39ab5a3e5b568df330cfd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359040
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2024-03-26 18:40:00 +00:00
Srujan Gaddam d1a949a8e5 Add static tests for external extension members on extension types
We have tests for whether external extension members are allowed
on certain classes, but not extension types.

Also rewords the error to be more accurate.

Change-Id: I61c1fa4c101971986b6c8e7cc778aca94908816a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358380
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-03-26 15:43:19 +00:00
Srujan Gaddam 1232260158 [dart:js_interop] Add ExternalDartReference
Closes https://github.com/dart-lang/sdk/issues/55187

Adds a faster way for users to pass opaque Dart values to
JS without the need for boxing like in JSBoxedDartObject.
This does mean, however, that this new type can't be a JS type,
and therefore cannot have interop members declared on it.
Refactors existing code to handle that distinction.

CoreLibraryReviewExempt: Backend-specific library that's been reviewed by both dart2wasm and JS compiler teams.
Change-Id: Ia86f1fe3476512fc0e5f382e05739713b687f092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358224
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-03-26 15:43:19 +00:00
Daco Harkes 77d10f2ed9 [vm] Split DartReturnInstr and NativeReturnInstr
Renames `ReturnInstr` to `DartReturnInstr`, and introduces a new
`ReturnBaseInstr` to be the common parent of `DartReturnInstr` and
`NativeReturnInstr`. (Before this CL, `NativeReturnInstr` was a
subtype of `ReturnInstr`.)

In a follow up CL, the `NativeReturnInstr` will get up to two inputs.
https://dart-review.googlesource.com/c/sdk/+/354226
Therefore, the `ReturnBaseInstr` does not inherit from `TemplateInstr`
with 1 input, but instead only inherits from `Instruction`.

TEST=SDK build
TEST=*_il_test.dart

Change-Id: I017eb7802ae6c902b64f1cda20edf4a11408dbe1
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358904
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-03-26 11:12:38 +00:00
MarkZ d30283f0a1 [ddc] Adding tests for pkg:reload_test and enabling reload tests in test bots.
* Adds tests for the memory filesystem
* Enables hot restart/reload tests
* Adds flags to the hot reload suite
* Makes path resolution logic windows-friendly
* Adds test-reporting logic for trybots to hot reload tests

Change-Id: Ic51a0b8a3c6f8b6de20b58b2ac185dacf444cf47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353788
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2024-03-25 23:58:26 +00:00
Brian Quinlan 97d8445e5f Revert "[io] Fix a bug where Process.stdin.add exceptions could not be caught"
This reverts commit 9967075787.

Reason for revert: Ignoring `done` is asymmetrical with other IOSinks.

Original change's description:
> [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>

Bug: https://github.com/dart-lang/sdk/issues/48501
Change-Id: Ib5356c640d4dddc30e561b9d60d93f794a935103
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359680
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-03-25 21:03:12 +00:00
Srujan Gaddam 47f08fb143 [dart:js_interop] Change several operators back to JSBoolean
Related issues:
https://github.com/dart-lang/sdk/issues/55024
https://github.com/dart-lang/sdk/issues/55267

These operators were initially broken in 3.3 and were exposed
as returning JSBoolean but implemented as returning bool. They
were fixed to return bool in the public API, but we should
prefer to have them return JS types as they're likely to be used
in cases where implicit conversions are not useful.

CoreLibraryReviewExempt: Fixing type mismatch in backend-specific library.
Change-Id: I3b0e60550dcac78918f8399d11238dcfa34982cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359180
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-03-25 17:05:36 +00:00
Lasse R.H. Nielsen 5acb2132f8 Constant evaluator won't assume all dart.library.x entries exist.
The existing implementation assumed, hardcoded, that the compilation
environment had an entry for any string of the form `dart.library.`+X,
with a value of either `"true"` or `""`.
This did not match the runtime behavior of the standalone VM,
which allows non-constant access to the compilation environment.

Changed to only have entries with value `"true"` for libraries
which exist.
This changes the value of `bool.hasEnvironment` or a
`String.fromEnvironment` or `bool.fromEnvironment` with a
non-default `defaultValue`.
The existing behavior was that `bool.hasEnvironment` was always true,
and that the other constructors ignored the `defaultValue`,
so most likely such tests or `defaultValues` aren't used anyway.

Fixes #53815

Bug: https://dartbug.com/53815
Change-Id: I995bb34b5ab04b39a8a588d6a59c0027a0fe855c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331261
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-03-23 11:18:46 +00:00
Tess Strickland 1cebdcb2da [vm/ffi] Use untagged pointer representations for FFI pointers.
Previously, the FFI used unboxed integers as a native representation
for pointers in FFI code, as the compiler only handled very specific
uses of untagged pointers flowing between instructions. Since then,
this restriction has been removed for untagged pointers that do not
point to memory managed by the GC, like FFI pointers, so now they can
have a more precise representation.

By being precise about when untagged (untagged pointers to freshly
allocated Handles and the contents of Pointer data fields) and tagged
(TypedData objects constructed to hold the byte representation of
compound data) values are expected, we can remove the need to have
untagged pointers to GC-movable objects and/or having untagged
pointers escape as unboxed integers in the generated IL.

This CL also renames kUnboxedFfiIntPtr -> kUnboxedAddress and limits
its uses specifically to where the unboxed integer represents the
numeric representation of an untagged pointer.

This CL changes CCall to take Representations for the arguments and
return value instead of what looks like an arbitrary
NativeCallingConvention. However, the serializer and deserializers for
CCall, used in IL tests, originally assumed that the argument and return
representations were kUnboxedFfiIntPtr, so providing an arbitrary
NativeCallingConvention which didn't match that assumption would cause
failures during IL tests. That assumption came from the fact that
the only creator of CCall instructions was in kernel_to_il.cc, and there
that was the case.

Now CCall builds the native calling convention during construction
and deserialization from the argument and return representations and
stores both the representations and built native calling convention
internally. In the future, if we want to create CCall instructions with
more arbitrary native calling conventions, then we'll need to handle
serialization/deserialization of arbitrary native calling conventions,
and also add consistency checks that the provided representations
appropriately match the native calling convention.

TEST=ffi vm/dart/regress_306327173_il vm/dart/address_local_pointer_il

Issue: https://github.com/dart-lang/sdk/issues/54710
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try
Change-Id: I34effe8fbdc80288b703e0152d5ba67ce2343400
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353101
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-03-22 10:20:48 +00:00
Paul Berry f7d5d0cfbe Remove special analyzer behavior for await expressions with "null context".
In the front end, type inference of an expression always takes place
with respect to a type schema (the "context"). In the analyzer, type
inference of an expression sometimes takes place with respect to a
context, but sometimes takes place with respect to no context at all;
the latter circumstance arises when the analyzer uses its standard
AstVisitor mechanism to call one of the visit methods in the
ResolverVisitor class, and so the visit method's contextType argument
takes on the value null. Because of this I am calling this situation a
"null context".

In all the circumstances where the analyzer infers an expression using
a null context, the front end infers the same expression using a
context of _. Furthermore, prior to this change, all but one of the
analyzer's visit methods treated a null context the same as they
treated a context of _. The one exception was visitAwaitExpression: in
this method, if the context was the null context, then the analyzer
analyzed the await expression's subexpression using a context of _;
otherwise, it analyzed it using a context of FutureOr<_>. Whereas the
front end, lacking any notion of a "null context", analyzes the await
expression's subexpression using a context of FutureOr<_> in the same
circumstances.

This change brings the analyzer behavior into line with the front end.

Fixes https://github.com/dart-lang/language/issues/3648.

Bug: https://github.com/dart-lang/language/issues/3648
Change-Id: Ifd77988010d4387ce48eaa20dff4356beec03753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-03-20 17:33:28 +00:00
Johnni Winther 4b21f58d39 [cfe] Don't emit warnings on null-aware access on non-nullable
Change-Id: I94f3011f69330f5b2d8998f29eb9511517e1fffa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357301
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-03-20 14:04:29 +00:00
Jake Macdonald 17454cb118 make ConstructorMetadataAnnotation.type be a TypeAnnotation
Change-Id: I9013340307f6fa3a100b2263e0edaef69c05c437
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358500
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-03-19 16:22:52 +00:00
Vyacheslav Egorov 4cb67eb009 [tests] Remove debug prints from corelib/date_time7 test
R=whesse@google.com

CoreLibraryReviewExempt: Test changes only
Change-Id: I1013a0a60cb60ef769e041668bac342b0d44283e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357604
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-03-19 12:30:56 +00:00
Erik Ernst 8c3a7b0414 Add two bit operation tests.
Add `bitops_unsigned_js_test.dart`, testing JS semantics with bit operations, and add `bitops_unsigned_shared_test.dart`, testing the semantics of bit operations in the subdomain (uint32) where the results coincide with webNumbers and with native numbers.

CoreLibraryReviewExempt: Is web specific, does have an area-web review.
Change-Id: I35ad1f78161a282780c3ec73da7823fee05c506c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158014
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-03-16 12:56:21 +00:00
Srujan Gaddam 7685ec3e0e [dart:js_interop] Better error reporting for invalid external types
Closes https://github.com/dart-lang/sdk/issues/54320

Several improvements to the error reporting:

- Split errors to avoid parametrizing error strings.
- Use one error per member/toJS invocation.
- Highlight the invalid types in the signature.

Extra tests are added to get coverage for things like operators.

Change-Id: I6d8ac3cf0124730e7c2c0dab3a107da5d0263f7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347226
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-03-15 23:36:22 +00:00
Daco Harkes 51ed0e5b07 [vm/test] Fix imports
Reduces the number of warnings originating from runtime/tests/vm/dart.

Change-Id: I0f6f527145c9b389952b5fa09a9d4e03824b9bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357900
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2024-03-15 17:21:30 +00:00
Paul Berry 6d12146e75 Additional tests of ??= coercion behaviors for inference-update-3.
The tests for the language feature `inference-update-3` are adjusted
to verify that the following hold true for an if-null expression of
the form `e1 ??= e2`:

- If the static type of `e2` is not a subtype of the write type of
  `e1`, but it is assignable via a coercion, then the coercion is
  performed, and the coerced type of `e2` is used to compute the
  static type of the whole `??=` expression.

- If `e1` is a promoted local variable, then coercions are performed
  based solely on the declared (unpromoted) type of `e1`.

These behaviors apply regardless of whether feature
`inference-update-3` is enabled; accordingly, this commit updates both
the `_test.dart` and `_disabled_test.dart` variants of the tests. I've
manually verified that even with the work on `inference-update-3`
reverted, the `_disabled_test.dart` tests continue to pass, so we can
be reasonably certain that these behaviors pre-date the work on the
`inference-update-3` feature.

Note: the diff is large due to the fact that the front end has 6
different code paths for handling `??=`, depending on the form of the
LHS, so to make sure that we have adequate test coverage, there are
tests for every possible LHS form. However, the diffs for all the
tests are pretty much the same except for
`if_null_assignment_local_disabled_test.dart` and
`if_null_assignment_local_test.dart`, which have extra test cases to
cover promotion behaviors.

Bug: https://github.com/dart-lang/language/issues/1618
Change-Id: I711d62d9dc00fc20a2efd3967d60066d9bfaec03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356303
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-03-12 22:45:28 +00:00
David Morgan e38f4fa4ac [macros] Tweaks to macro_build test.
Run on `release`, not `debug`, the release bot runs by default on PRs so it's more convenient.

Increase the test step timeout from 30s to 60s, I've seen an occasional timeout.

Change-Id: Ie7ce062b4d326763a651b8b607d1aef90e1f65f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356840
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-03-12 12:46:19 +00:00
Slava Egorov c2e9ceeb6b [vm/io] Cleanup long path handling on Windows
* Switch to `std::unique_ptr<wchar_t[]>` to represent a
dynamically strings instead of wrappers like
`StringRAII` and `Utf8ToWideScope`;
* Avoid back and forth conversion between UTF8 and UTF16:
convert to UTF16 first then work on that. This also simplifies
code - previously it tried to work with strings allocated in
different ways uniformly, which is actually unnecessary if
resulting string needs to be converted to UTF16 (and allocated
with `malloc`) anyway;
* Fix a bug in `File::CreateLink`: it was handling relative
links with long paths incorrectly. Change file_long_path_test
to cover this case and make it run on non-Windows systems as
well to ensure that all behavior that can match actually
matches.

TEST=ci

Change-Id: I1279aff1d2cdace5e2ce8633c2f7ea69a34fe41a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356680
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-03-12 08:29:36 +00:00
Daco Harkes e7daade291 [gardening] Fix test
TEST=tests/ffi/deeply_immutable_c_api_finalizer_test.dart

Closes: https://github.com/dart-lang/sdk/issues/55165
Change-Id: I8e5925b978db4591442ca36d57a6a98f85501bbd
Cq-Include-Trybots: luci.dart.try:vm-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356801
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-03-12 08:03:30 +00:00
Slava Egorov b0236fdde5 [vm] Fix DateTime.timeZoneName on Windows
It needs to look at the given moment to decide whether to use
summer time zone name or standard time zone name.

Previously it was looking at the current time to make this decision
which produced incorrect result: e.g. given
`DateTime.parse(2012-01-02T13:45:23)` its `timeZoneName` should be
returning standard name corresponding to the current time zone even
if we are currently running in summer time (e.g. it should
return PST if machine it is running on is in PDT).

This is revealed by a test which started to fail on Windows
because our Windows bots entered PDT.

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

TEST=corelib/date_time7_test.dart

CoreLibraryReviewExempt: No core library changes.
Change-Id: Ic938baf837c2f6130ec3f9604631701267369f87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356681
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-03-11 20:14:49 +00:00
Daco Harkes 8682ca72ce [vm/ffi] Example with deeply-immutable Finalizable and dart_api_dl
A test exercising isolate group finalizers with `Finalizable` and
`pragma('vm:deeply-immutable')`.

Note that we cannot fully do without C code due to the signature of
`Dart_HandleFinalizer` which also passes a
`void* isolate_callback_data` in addition to the peer.

TEST=tests/ffi/deeply_immutable_c_api_finalizer_test.dart

Bug: https://github.com/dart-lang/sdk/issues/55062
Bug: https://github.com/dart-lang/sdk/issues/55120
Change-Id: Ibaf4899ca678ffb0c5d227ac4f10deb38d49fe6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356720
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Hossein Yousefi <yousefi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-03-11 15:51:46 +00:00
Lasse R.H. Nielsen 06d6ef38a9 Fix bug in Uri.resolve with IPv6 addresses.
The `resolve`/`resolveUri` operation would take the
`.host` of the URI reference and include it verbatim
in the output. Since the `.host` getter returns IPv6
addresses *without* their `[`...`]` braces, that would
become invalid.

Also make sure to normalize the parts of the URI reference
that are used, if it is not a platform URI.

Fixes #55085

BUG= https://dartbug.com/55085

Change-Id: I3dbc8af953af0974346e38ba3203796647069ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355781
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
2024-03-11 14:48:24 +00:00
David Morgan 261e16e822 [test_runner] Support static error test expectations in augmentation libraries.
R=eernst@google.com

Change-Id: I52fd157be6ba561f571170ce393d80820b2744dc
Bug: https://github.com/dart-lang/sdk/issues/44990
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356401
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-03-08 12:59:59 +00:00
David Morgan 6f7f571989 [macros] Fix basic macro compile with DDC, add e2e test.
The e2e test is for "how DDC is used in the language tests", more
realistic setupts to follow.

R=jakemac@google.com, nshahan@google.com

Change-Id: Iece44740d2e4d91748a7deef59f4e18ad42ac853
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356241
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-03-08 11:37:46 +00:00
Daco Harkes 8de00e2137 [vm] Introduce pragma vm:deeply-immutable
This CL introduces a way to mark all instances of a class as deeply
immutable.

In order to statically verify that all instances of a deeply immutable
class are immutable, a deeply immutable classes must have the following
properties:

1. All instance fields must
   1. have a deeply immutable type,
   2. be final, and
   3. be non-late.
2. The class must be `final` or `sealed`. This ensures no
   non-deeply-immutable subtypes are added by external code.
3. All subtypes must be deeply immutable. This ensures 1.1 can be
   trusted.
4. The super type must be deeply immutable (except for Object).

Note that instances of some classes in the VM are deeply immutable
while their class cannot be marked immutable.

* SendPort, Capability, RegExp, and StackTrace are not `final` and
  can be implemented by external code.
* UnmodifiableTypedDataViews do not have a public type. (It was
  recently deprecated.)

See runtime/docs/deeply_immutable.md for more details.

Use case:

This enables attaching a `Dart_FinalizableHandle` to a deeply immutable
object and the deeply immutable object with other isolates in the same
isolate group.

(Note that `NativeFinalizer`s live in an isolate, and not an isolate
group. So this should currently _not_ be used with `NativeFinalizer`s.
See https://github.com/dart-lang/sdk/issues/55062 for making a
`NativeFinalizer.shared(` that would live in an isolate group instead
of in an isolate.)

Implementation details:

Before this CL, the `ImmutableBit` in the object header was only ever
set to true for predefined class ids (and for const objects). After
this CL, the bit can also be set to true for non const instances of
user-defined classes. The object allocation and initialization code has
been changed to deal with this new case. The immutability of a class is
saved in the class state bits. On object allocation and initialization
the immutability bit is read from the class for non-predefined class
ids.

TEST=runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart
TEST=runtime/vm/isolate_reload_test.cc
TEST=tests/lib/isolate/deeply_immutable_*

Bug: https://github.com/dart-lang/sdk/issues/55120
Bug: https://github.com/dart-lang/sdk/issues/54885
Change-Id: Ib97fe589cb4f81673cb928c93e3093838d82132d
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try
Cq-Include-Trybots: dart-internal/g3.dart-internal.try:g3-cbuild-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354902
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-03-07 18:33:58 +00:00
David Morgan ffe61b76d8 [macros] Tests find SDK out instead of hard coding it.
R=whesse@google.com

Change-Id: I0ecdf8ef53e79234f8d2957ac680e8ec103e496a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356042
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-03-07 14:32:47 +00:00
David Morgan a85689758e [macros] Fix flake: use the SDK that was actually built.
Currently these two tests only passes by chance, if a `release` build
happens to be available.

R=whesse@google.com

Change-Id: I6048c6ed8ea2f299c88eaf9a6c6b2add8a03dfa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356083
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-03-07 11:50:41 +00:00
David Morgan ebcae76d0d [macros] Replace hardcoded skip with status file skip.
R=whesse@google.com

Change-Id: I50a41ebadd71b65761613e2ac2259152d1433ddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355923
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-03-07 10:33:08 +00:00