Commit Graph

23327 Commits

Author SHA1 Message Date
Aravind b5928642ff [vm/ffi] Supporting .address.cast() expression in ffi leaf calls
Closes https://github.com/dart-lang/sdk/pull/56357

GitOrigin-RevId: 605e7d3fa5f4c7ce367539a76402e2e51aa69422
Change-Id: I79524b443326a161afe221d0a2afb6bed5866e59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378221
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-08-28 06:34:09 +00:00
Lasse R.H. Nielsen 310d91aee8 Make async error injection set stack trace on errors.
Also removed a bunch of `CheckNotNullable`s that shouldn't be necessary any more. Any remaining non-sound-null-safety code runs today, and no more should be written. (And if it is, it'll mostly just err somewhere else, with a worse error message.)

Tested: New test added. Removed older tests checking for unsound null-safety.
Change-Id: I28626909cd8c1f91db6c61fc2b93042ed1b085dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-08-27 12:51:26 +00:00
Martin Kustermann 810301045d [dart2wasm] Make JS<....>Array.setRange(..., ...TypedListList()) faster
The fused utf8+json decoder ensures the bytes that it operates on are
U8List:

  void parseChunk(List<int> value, int start, int end) {
    if (value is U8List) {
      chunk = value;
    } else {
      final bytes = U8List(end - start);
      bytes.setRange(0, bytes.length, value, start);
      ...
    }
    ...
  }

This speeds up the `bytes.setRange()` call by using an optimized loop
that copies memory from JS arrays to wasm arrays.

=> This speeds up WasmDataTransfer.FromBrowserBytes.* by 10x
=> This speeds up Json*JS.*.FromBytes benchmarks by up to 3x

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

Change-Id: I99fd1db280f503e91972c53537d7cd1fd4fd49ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382002
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-08-26 08:58:11 +00:00
Daco Harkes 3d44d5598f [dart2wasm][ffi] Don't crash compiler on Native.addressOf
`Native.addressOf` is not implemented in dart2wasm (yet).

However, crashing the compiler means we cannot use packages which use
`Native.addressOf` even if these are not invoked.

This CL changes these expressions to a `throw` at runtime. This enables
using the subset of packages that use `@Native`s.

Implementation note: The existing FfiNative transformer doesn't
recurse into visitors. And it extends the transformer for the VM which
doesn't recurse. So I don't want to change it to recurse over the
whole AST. Instead, this introduces a new transformer that traverses
the whole AST.

TEST=tests/web/wasm/ffi/ffi_native_test.dart
TEST=existing tests with rolling `package:ffi` in via DEPS.

Closes: https://github.com/dart-lang/sdk/issues/56461
Change-Id: If8fab07a852939a4b519ae7cc47b4071adda8a3a
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-firefox-try,dart2wasm-linux-d8-try,dart2wasm-linux-chrome-try,dart2wasm-asserts-linux-chrome-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380260
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-08-26 08:10:23 +00:00
Ömer Sinan Ağacan 9dc575440d [dart2wasm] Fix instantiation context types in instantiation trampolines
Type for a closure with one argument (Closure-0-1) is subtype of type of
a closure with no arguments (Closure-0-0).

This allows calling the closure with no arguments in the generated code.

(This only happens when the Dart types align, i.e. the argument is
optional)

However instantiation vtable functions for e.g. Closure-1-1 currently
can't be as Closure-1-0, resulting in a type cast error in a code like:

    void test<T>([T? x]) {}

    void Function() x = runtimeTrue ? test : () {};
    x();

Relax the instantiation context struct type in instantiation vtable
functions and downcast the generic closure struct type (type of the
instantiation closure) to the right type before calling instantiation
clsoure.

Fixes #56534.

Change-Id: I59f9b019c4dc8d2e26ee21f1f6c3c607af0be4d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-08-23 07:29:47 +00:00
Daco Harkes 6378a26212 [vm] Variable scoping fixes
This CL fixes two bugs related to scoping:
1. Empty variable name lookup in outer functions failing.
2. Let expressions not pushing and popping contexts.

Additionally, this CL introduces a `--print-scoping` debug flag to
ease debugging scoping issues in the future.

Variable lookup is now only using kernel offset, unless the offset
is `kNoKernelOffset`. In that case, the names are used.
All synthetic variables in the VM now use `kNoKernelOffset` as their
offset.

The let expressions not pushing contexts is fixed by pushing context.
The context is only pushed if the scope captures variables. So this
should not lead to performance regressions. (Any lacking pushing of
scopes should have lead to crashes.)

TEST=tests/ffi/regress_56412_2_test.dart
TEST=tests/ffi/regress_56412_test.dart

Closes: https://github.com/dart-lang/sdk/issues/56412
Change-Id: I85fc4a161b833df80ce8f2911d618aa2ac9797eb
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-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-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-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-arm64-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-arm64-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-arm64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-arm64-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/+/380983
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-08-23 07:03:15 +00:00
MarkZ 87f7758b88 [reload_test] Porting more field modification VM tests hot reload suite
Change-Id: I79d8c405295779ad09f55af514a74f7884ea52a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381940
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-08-23 00:09:08 +00:00
Brian Quinlan 9a0eafda2f Skip io/http_big_header_test on simarm
Bug:https://github.com/dart-lang/sdk/issues/52110
Change-Id: I7bb3354b8f2ee1b9466e1b8088d4f18ab494b59c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380581
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-08-20 21:55:43 +00:00
Kallen Tu 371948556d [tests] Update the error test results for wildcard variables.
Update each error test for wildcard variables with their proper expectations.

Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: I2c1e2716f501354afcbb9b5297beb854c3a9598a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381309
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-08-20 19:19:28 +00:00
Brian Quinlan d19ef1227b Fix zlib inflation to ignore data past the ADLER32 trailer.
Bug:https://github.com/dart-lang/sdk/issues/56481
Change-Id: I880ca6f546dd28c408066d6b52dd3d3cfba18dfc
Tested: zlib_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380861
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-08-20 18:13:33 +00:00
MarkZ 80586c8596 [reload_test] Porting VM hot reload tests related to member/field initialization to the hot reload suite.
These aren't fully inclusive, but they're good enough litmus tests.

Change-Id: I4954ac6cb43ea3bdf704c67c5bd70bf305756f55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380286
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-08-20 17:50:56 +00:00
Paul Berry 7f5a698514 UNREACHABLE_SWITCH_CASE: Remove HintCode in favor of WarningCode.
Previously, `HintCode.UNREACHABLE_SWITCH_CASE` was marked as
deprecated, and `WarningCode.UNREACHABLE_SWITCH_CASE` was an alias to
it. This created a slightly confusing situation, because it meant that
all code referring to the diagnostic had to refer to it as
`WarningCode.UNREACHABLE_SWITCH_CASE` (to avoid a deprecation lint),
but the diagnostic still _behaved_ like it was a hint, and therefore
test runner expectations still had to treat it as a hint.

It turns out that it's not really necessary to go through the
deprecation dance when changing the kind of a diagnostic, since (a)
members of `HintCode` and `WarningCode` aren't exposed through the
analyzer public API, and (b) ignore comments don't have to specify
whether something is a hint or a warning.

So the easiest way to clear up the confusion is to just remove
`HintCode.UNREACHABLE_SWITCH_CASE` entirely, and move its implemention
into `WarningCode.UNREACHABLE_SWITCH_CASE` (so that the latter is no
longer an alias).

Change-Id: I9ff7901ad38a2c168c5e54cbe0c1c52bf7c50186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381103
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-08-19 16:09:14 +00:00
Chloe Stefantsova bdc1b37d42 [cfe] Adjust error message for absent super constructor parameter
Closes https://github.com/dart-lang/sdk/issues/56406

Change-Id: I8d1eee0f515a2df912b979c2df0663b3ed23eda8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379604
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-08-19 11:45:02 +00:00
Sigmund Cherem e8a049fd8e [dart2wasm] Make dart.library.js false in conditional imports (attempt 2)
This change removes the implementation of `dart:js` for dart2wasm. The
code is no longer in use and the compiler already provides a static
error if you import `dart:js` internally.

By removing the implementation from the libraries.json spec, we also
show this as unaccessible on conditional imports. This will allow
developers to distinguish JS and Wasm backends

This adapts the original implementation in
https://dart-review.googlesource.com/c/sdk/+/368642 with a few small
changes, but keeps around the existing allowances on `package:js`. Those
can be addressed separately to reduce the disruption from this change.

Closes #55266.

Change-Id: I0d01a424f2fdb4f48879bd1a41c847a92439e74a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380583
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-08-16 16:22:50 +00:00
Martin Kustermann e5704eacfa [dart2wasm] Fix missing type check in implicit field setters if field is covariant
For a class like this:

   class A<T> {
     T? value;
   }

the implicit setter function (`A.value=`) has to check the argument
type.

TEST=language/covariant_field_implicit_setter_test

Change-Id: Ie990b79f631275fb0a7c88ec7d7dd3a82a784148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381000
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-08-16 11:49:19 +00:00
Srujan Gaddam 93cdc5074d [test_runner] Add option to run browser tests with ddc module format
With hot reload, a new module format is being introduced that's
repurposing the ddc module format. This will replace all other
existing formats long-term. For now, we want to enable some test
bots to start running with the new format, so we emit different
HTML based on the format in the test runner.

With these changes, all tests pass when using ddc module format
except for libraries_test. This is due to how DDC may lazily load
libraries with the new format, so this test is reordered to make
it work with the new format.

Change-Id: If52bb64977f96b4c4a287f142026412a4db558cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379750
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-08-15 23:37:21 +00:00
Alexander Aprelev f9c603e76b [io/win] Always use absolute, canonicalized paths.
This ensures that on Windows we take advantage of 32k-character file name limit consistently for all files and directories operations.

TEST=ci
BUG=https://github.com/dart-lang/sdk/issues/56125
BUG=https://github.com/dart-lang/sdk/issues/55972
CoreLibraryReviewExempt: adds windows-specific error code for invalid file name
Change-Id: I83bd3ceac579e589469e47b2cf5216db457cae8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375421
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-08-15 17:51:10 +00:00
Nate Biggs 2f97501551 [js_interop] Fix JsInteropChecks not recursing into constructor's AST children.
The JS interop transformer assumes the entire AST has been checked and ends up trying to cast to FunctionType. If there is malformed, unvisited interop code this results opaque failure (failed type cast) rather than the useful error message from the check.

Bug: https://github.com/dart-lang/sdk/issues/56443
Change-Id: I5b911d0da7a839e3045dce61121496d464b79af9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380381
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-08-15 01:47:34 +00:00
Nicholas Shahan 570ed43611 [ddc] Turning down unsound testing on canary (6)
Stop running co19 suite on the ddc-canary-linux-chrome bot.
Cleanup temporary skips from status file.

These changes are staged across multiple CLs to avoid crashing
the infra when too many tests status changes need to be uploaded
at the same time.

Change-Id: I378954fc0cbb47c0f54edf158b3b7c38744bf0b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379525
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-08-14 21:31:30 +00:00
Brian Quinlan f753fe4144 Throw RedirectException when a redirect is missing a Location header
Bug:https://github.com/dart-lang/sdk/issues/53618,https://github.com/dart-lang/sdk/issues/53158
Change-Id: Ib7ea9503dd58c0d1c233a85d92d4feb0648a9022
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380380
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-08-14 18:17:59 +00:00
Halil Durmus 3d083d2720 [vm/ffi] Allow getters/setters in structs with variable-length inline arrays
Closes: https://github.com/dart-lang/sdk/issues/56399
Change-Id: Ia5da1d950c3b08e0a4b099930ef3ad84f3116601
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379622
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Halil Durmus <durmushalil@proton.me>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-08-14 06:50:43 +00:00
MarkZ f6028e821a Reland "[ddc] Overhauling DDC's generic class representation."
This is a reland of commit e7658520bb

Fixes in the reland + context:
Type parameters emitted in implicit type checks on covariant mixin forwarding stubs may reference type arguments in anonymous classes. We reduce this to their mixin's implementing subclass to avoid generating RTI rules for anonymous classes.

Previous implementations would 'translate' type parameters to that of their mixed in type, but that strategy fails if the implementing subtype  shuffles the order of type arguments relative to its mixed in type (demonstrated in the test - though not actually relevant in the Flutter break).

Original change's description:
> [ddc] Overhauling DDC's generic class representation.
>
> Prior to this change, DDC represented generic classes as closures over type parameters (with type arguments provided at runtime), which tightly coupled generic class definitions with their types and concrete instantiation.
>
> This rewrite decouples this representation, letting us 1) bind type information late and 2) separate generic class definitions from their instantiation.
>
> Notable changes:
> - Generic classes are now declared at top level (rather than within in closures).
> - RTIs are now passed to generic class constructors at runtime (except for JS Interop classes). Only the instantiated class's RTI is required (and it's retained up the type hierarchy).
> - Type signature resolvers are now lambdas that accept a type environment RTI at runtime. While signatures are still attached early, their instances' RTIs are now needed at runtime.
> - Generic classes, constructors, and factories are now evaluated in a 'Class' type environment.
> - An `RtiTypeEnvironment` is introduced to represent lookups on an RTI type environment bound to a parameter. These are used when evaluating type signatures and at constructor/factory bodies.
> - Type recipes now emit Class type parameters with names - but continue to emit method type parameters with de Bruijn indices. This is because indices aren't stable across subtypes.
> - Certain debugger functions now require instances (e.g.,`getClassMetadata`).
> - Adds a special flag for non-external JS interop factory constructors to emit 'true' types (versus 'any').
>
> Change-Id: I7cbeaaf666dd4f9bd5e3ef22a1163a659fc0ee48
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365863
> Reviewed-by: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Kallen Tu <kallentu@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Nate Biggs <natebiggs@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

Change-Id: I9b6f69b7150631f28442675c4230e093e3b821d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379511
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-08-13 18:15:38 +00:00
Nicholas Shahan 213150c745 [ddc] Turning down unsound testing on canary (5)
Stop running co19/LibTest suite on the ddc-canary-linux-chrome bot.

These changes are staged across multiple CLs to avoid crashing
the infra when too many tests status changes need to be uploaded
at the same time.

Change-Id: Id696dd4e7b655ac797fd52409fc07d12c76ec2bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379524
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-08-13 18:01:41 +00:00
Nicholas Shahan a33eb99f67 [ddc] Turning down unsound testing on canary (4)
Stop running co19/LanguageFeatures suite on the
ddc-canary-linux-chrome bot.

These changes are staged across multiple CLs to avoid crashing
the infra when too many tests status changes need to be uploaded
at the same time.

Change-Id: I601867307f7ef9e4653627c8cf5c7766e2d80beb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379523
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-08-12 16:41:39 +00:00
Martin Kustermann f7fc4d0374 [dart2wasm] Fix partial instantiation constants
Partial instantiation constants are closures. Those closures have
vtables with all entries needed for the closure representation
corresponding to the instantiated closure.

The entries of those vtables have to either call the corresponding
method of the generic closure, or are unreachable dummy entries.

Dummy entries can be required due to clustering callees/callers together
where a particular target doesn't support the name combination.

The case that was incorrect is if the particular name combination did
not get clustered with anything for the generic closure representation.

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

TEST=web/wasm/regress_56372_test

Change-Id: Ifbf624e10dd1162f4d5660b43914e5b34ba82294
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380100
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2024-08-12 14:05:04 +00:00
pq 3ad63e5b28 [wildcards] update dead code highlight range
Fixes:

language/wildcard_variables/declarations/local_function_error_test


Change-Id: I96a58730041ad6a6f7bbbb66a9461b984ae4da1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379517
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2024-08-09 20:37:58 +00:00
Nicholas Shahan 849cab7be8 [ddc] Turning down unsound testing on canary (3)
Stop running co19/Language suite on the ddc-canary-linux-chrome bot.

These changes are staged across multiple CLs to avoid crashing
the infra when too many tests status changes need to be uploaded
at the same time.

Change-Id: Iba6d762f97803b609e91116c084430f0a1c3565d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379522
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-08-09 18:43:14 +00:00
Ömer Sinan Ağacan 1b1740e941 [dart2wasm] Pass source maps to wasm-opt when optimizing
To be able to know when we are generating a source map, make `dart
compile wasm` aware of the `--no-source-maps` flag.

The "name" segments of source mappings are also made `null` with this
patch. Browsers don't use that segment and binaryen doesn't support it.

Change-Id: I7b52c8fb7cef92ed60547e97ad137e0cd3967f26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378421
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-08-09 14:23:29 +00:00
Srujan Gaddam ac6588ba60 [dart2wasm] Optimize dartify type-checks
dartifyRaw type-checks are currently a bunch of if
cases where the check is done in JS. Instead of going
back and forth between runtimes, we can do the checks
in JS and return an enum value.

- Replaces the if cases with a externRefType method that
returns an integer that maps to some static const values.
Dart enums are slower so consts are preferred. Speeds up
type-checks by 4-5x and dartifyRaw by 1.1-1.8x for common
types using some quick local benchmarks. Also moves the
array check up as it's more common and groups the typed
array checks together.
- Reuses the externRefType helper in dartify so we don't
type-check the same value twice.
- Moves some tests from basic_test.dart to jsify_dartify_test.dart
and adds more type-checks, casts to assert types, cleans
up property getters, and adds a few missing cases.

Change-Id: Ia5fb9bfef6f9e212ea8da27362b0b4efb4cbf2fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379144
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-08-08 16:12:17 +00:00
Nate Biggs 7a7f446c08 Revert "[ddc] Overhauling DDC's generic class representation."
This reverts commit e7658520bb.

Reason for revert: Causing failures in both Dart->Flutter roller and web_dev package.

Original change's description:
> [ddc] Overhauling DDC's generic class representation.
>
> Prior to this change, DDC represented generic classes as closures over type parameters (with type arguments provided at runtime), which tightly coupled generic class definitions with their types and concrete instantiation.
>
> This rewrite decouples this representation, letting us 1) bind type information late and 2) separate generic class definitions from their instantiation.
>
> Notable changes:
> - Generic classes are now declared at top level (rather than within in closures).
> - RTIs are now passed to generic class constructors at runtime (except for JS Interop classes). Only the instantiated class's RTI is required (and it's retained up the type hierarchy).
> - Type signature resolvers are now lambdas that accept a type environment RTI at runtime. While signatures are still attached early, their instances' RTIs are now needed at runtime.
> - Generic classes, constructors, and factories are now evaluated in a 'Class' type environment.
> - An `RtiTypeEnvironment` is introduced to represent lookups on an RTI type environment bound to a parameter. These are used when evaluating type signatures and at constructor/factory bodies.
> - Type recipes now emit Class type parameters with names - but continue to emit method type parameters with de Bruijn indices. This is because indices aren't stable across subtypes.
> - Certain debugger functions now require instances (e.g.,`getClassMetadata`).
> - Adds a special flag for non-external JS interop factory constructors to emit 'true' types (versus 'any').
>
> Change-Id: I7cbeaaf666dd4f9bd5e3ef22a1163a659fc0ee48
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365863
> Reviewed-by: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Kallen Tu <kallentu@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Nate Biggs <natebiggs@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

Change-Id: I8ea12847bb2a4d096db0799c85f3175f1c5df3be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379420
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-08-07 16:56:26 +00:00
Sigmund Cherem 8a2e2b8186 [tests] skip touch event test in FF and Safari.
This test uses the TouchEvent constructor, which is only available in Chrome.

Until we add the ability to specify browsers in the `// Requirement=` comment,
we use the status file to skip the test instead.

Change-Id: Ie89459f5f939b74a7ae0f42ef20cd894fdfc26db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379141
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-08-06 20:56:15 +00:00
MarkZ e7658520bb [ddc] Overhauling DDC's generic class representation.
Prior to this change, DDC represented generic classes as closures over type parameters (with type arguments provided at runtime), which tightly coupled generic class definitions with their types and concrete instantiation.

This rewrite decouples this representation, letting us 1) bind type information late and 2) separate generic class definitions from their instantiation.

Notable changes:
- Generic classes are now declared at top level (rather than within in closures).
- RTIs are now passed to generic class constructors at runtime (except for JS Interop classes). Only the instantiated class's RTI is required (and it's retained up the type hierarchy).
- Type signature resolvers are now lambdas that accept a type environment RTI at runtime. While signatures are still attached early, their instances' RTIs are now needed at runtime.
- Generic classes, constructors, and factories are now evaluated in a 'Class' type environment.
- An `RtiTypeEnvironment` is introduced to represent lookups on an RTI type environment bound to a parameter. These are used when evaluating type signatures and at constructor/factory bodies.
- Type recipes now emit Class type parameters with names - but continue to emit method type parameters with de Bruijn indices. This is because indices aren't stable across subtypes.
- Certain debugger functions now require instances (e.g.,`getClassMetadata`).
- Adds a special flag for non-external JS interop factory constructors to emit 'true' types (versus 'any').

Change-Id: I7cbeaaf666dd4f9bd5e3ef22a1163a659fc0ee48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365863
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2024-08-06 20:39:26 +00:00
Daco Harkes 965234ccbe [vm/ffi] Variable length inline arrays
Adds a new `@Array.variable()` to specify that the last element of
structs is a variable length inline array.

This CL does not add any checks for passing structs with variable
length inline arrays by value or directly calling them with
`AllocatorAlloc.call`. Instead, the implementation defaults to what
C does, allocate as if there are 0 elements in the variable length
inline array.

TEST=tests/ffi/*

CoreLibraryReviewExempt: VM only
Closes: https://github.com/dart-lang/sdk/issues/55964
Change-Id: I524d8a1d710b1a744b392e05fa884908c3ff1f12
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-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-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-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-arm64-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-arm64-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-arm64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-arm64-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/+/371960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-08-06 07:50:49 +00:00
Daco Harkes f36c714575 [test/ffi] Test generator pointer arguments
This CL extends the test generator to support struct pointers. For
callbacks, only synchronous use of pointers is supported in tests.
(Ownership of memory is _not_ passed to Dart.) We have plenty of other
tests passing ownership. These tests are meant to check the ABIs, for
which sync calls and callbacks suffice.

Split off https://dart-review.googlesource.com/c/sdk/+/371960 to make
the changes in that CL only relate to variable length arrays. That CL
will pass pointers to structs with variable length arrays.

TEST=tests/ffi/*

Change-Id: Ib8ff7b4e1d0f2451892ea693555803682bbf3bc0
tools/find_builders.dart ffi/function_structs_by_value_generated_args_test
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-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-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-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-arm64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-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-arm64-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-arm64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-arm64-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/+/378704
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-08-05 09:26:50 +00:00
Martin Kustermann 2cf3222e4f [dart2wasm] Fix bug in seter type checker argument checking implementation
The CL in [0] introduced a regression: By not performing the type
checking code in -O4 mode it didn't have the side-effect of the type
checking code anymore (setting the `argLocal`) which caused the setter
to store `null` instead of the actual value.

Patchset 1: Fix
Patchset 2: Make type checking code not have side-effects

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

Fixes https://github.com/flutter/flutter/issues/152029

TEST=web/wasm/flutter_regress_152029_test

Change-Id: Ia678d922ba766aa885224e069f5f4e04a4bf457a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378800
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-08-03 07:53:40 +00:00
Srujan Gaddam 50623f0a2d Do simple type tests using T in non-external methods in js_interop_non_external_test
It's possible with changes in how we handle generics in
DDC that T might not be the type we expect at runtime. So,
we should test to make sure that it is by doing some simple
type tests in the body of non-external methods of JS interop
classes.

Change-Id: I0220b2bced4e5769e3728833204dfb3ac19f26d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378572
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-08-02 22:50:22 +00:00
Srujan Gaddam 33dd27771d Add extra type check cases and record current test status in javascriptobject_extensions_test.dart
- Adds some missing type check cases to check whether a Dart
class that implements a JS class properly type-checks and vice
versa. Also adds the generic version of those cases.
- Furthermore, this file contains a number of tests that are
broken in both compilers so it's currently marked as failing
on all configurations. Instead of doing this, we mark the current
status for each individual test in the expectation, and place
the real expected value in a comment next to it. That way, if
the current status changes, we can detect it.

Change-Id: I7b208863fdebdf80b3735fae896943da65ecf69a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378565
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-08-02 22:03:52 +00:00
Srujan Gaddam be9dcae47e Add soundNullSafety checks in js_function_arity_test.dart for cases where we expect a failure when casting the this value to String
The this value can either be a JSObject or null. In JavaScript,
it's only ever null when strict mode is enabled. In DDC,
since strict mode is enabled, these parameter checks
then succeeded when we test unsound mode as null can be
successfully casted to String, and therefore the failure
expectation fails. Instead, we should only enable these tests
when sound null safety is enabled.

Change-Id: I70ab3de98fb81af5c71450d81590c0bf87a029e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378567
Reviewed-by: Nate Biggs <natebiggs@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-08-02 20:26:58 +00:00
Srujan Gaddam ae3dbcdfb1 [dart:js_interop] Add toJSCaptureThis
Closes https://github.com/dart-lang/sdk/issues/54381

- Adds an API to capture the this value so that users
can use it in the callback.
- Adds specialized stubs to dart2js similar to what was
done for toJS.
- Adds generic stub to DDC as these stubs don't get
tree-shaken away and toJSCaptureThis is less likely to be
used.
- Modifies dart2wasm lowerings to add this to the JS
function wrapper if calling toJSCaptureThis.

Change-Id: Ic0a7fd768de1dd6b491998e029ff5eb406ee7992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377160
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-08-01 01:02:47 +00:00
Ömer Sinan Ağacan 273594fe8a [dart2wasm] Fix switch compilation when switched expr is dynamic
When the `switch` expression's type is dynamic, call the equality method
of the `case` expressions.

Fixes #56321.

Change-Id: I25338ffebaf9130c39ce3aa66e7b4a7eb20aac71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377921
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-07-30 16:13:18 +00:00
Nicholas Shahan 77be340ce8 [ddc] Fix the internal type of prototype objects
Ensure that if a prototype object of a native peer class flows
into the program through JavaScript interop, it will be interpreted
as an interop object, instead of the Dart peer class.

Add some regression tests.

Fixes: https://github.com/dart-lang/sdk/issues/56322
Change-Id: Ic84bbdc4784e667a8730a9f1d578527b4bbdd198
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377763
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-07-30 15:33:28 +00:00
Kallen Tu 1d52761950 [cfe] Build a lowered name for wildcard variables.
Each wildcard variable will have a unique name meaning that each local, formal, and type parameter named `_` will be named something similar to `_#wc<index>#<type>`.

This will allow the DDC tests to pass.

Change-Id: Ic5362e46142c4a51cd461280ca33a8a5ba5b910f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373621
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-07-30 15:23:58 +00:00
Nate Biggs e9c7b2b905 Reland "[ddc] Clean up old async logic in ddc compiler."
This is a reland of commit 34de7578d2

Original change's description:
> [ddc] Clean up old async logic in ddc compiler.
>
> This removes any remaining code that was used for async functions.
>
> Change-Id: I3ffa391caf0befa13b67159c35b36daee6f810dc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372040
> Reviewed-by: Mark Zhou <markzipan@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Commit-Queue: Nate Biggs <natebiggs@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>

Change-Id: I3d9d69809825265359074d5637325c227f2e0857
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376001
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2024-07-30 03:13:58 +00:00
Nate Biggs 8bd3690ab0 Reland "[ddc] Update DDC compiler to start using the new async transform."
This is a reland of commit d84f908641

Includes fixes:
--- Catch scope fix ---
Each catch block should define its own scope, but the compiler was not treating the body of these catch blocks as a scope. This was leading to incorrect variable renaming.


--- Duplicate label fix ---
Labels weren't being removed from the _labelNames Map after being used so multiple nodes were getting tagged with the same label. Note: This didn't actually cause any bugs because the label closer to the break statements using those labels was the correct one.

--- addAsyncCallback cleanup ---
The new async semantics actually don't require managing addAsyncCallback and removeAsyncCallback calls (proxies for async_helper.asyncStart and async_helper.asyncEnd). None of the other backends manage these themselves. It's up to tests to ensure they call async_helper.asyncStart and async_helper.asyncEnd.


Original change's description:
> [ddc] Update DDC compiler to start using the new async transform.
>
> Updates compiler.dart to use the new async transformation.
>
> Some key things to note:
> - Dart Let and BlockExpression expressions are represented as IIFEs in DDC compiled code. For non-async code this works fine but this doesn't work when they contain "await" expressions. When these expressions contain awaits we use the same lowering as we would for an async function, but instead apply it to the IIFE function. Then we simply await the IIFE Call expression as the IIFE will return a future after the transform.
> - For async/sync*/async* functions we want to make sure parameter initialization happens synchronously before any of the async logic is hit. To do this we first apply the async transform the user-code function body. We then prepend the paramter initialization logic to the body of the transformed function.
> - We add support for JS_RAW_EXCEPTION which allows the machinery in async_patch to access the wrapped JS exception in a catch block rather than the unwrapped Dart exception.
> - Stacktraces and sourcemaps have some differences. There is still room for improvement in these but they should at least allow users to reasonably step through parts of the async code.
>
>
> There are also several test fixes/updates associated with this change. The test_runner wrapper no longer has to inject in asyncStart/asyncEnd calls, these are handled by the new async logic.
>
> Change-Id: I0f9f547cd9eb52ff7d850d277876d4d57568a14e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374444
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Mark Zhou <markzipan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>

Change-Id: Idfe05c0628b2b91f474d08d99427961381debeb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2024-07-30 03:13:58 +00:00
Nate Biggs 90162cc1f6 [ddc] Fixes for DDC async lowering.
--- Super fix ---
When the arguments to a call contain an async gap (an await in this case), the new lowering will save the receiver to a temp variable so it can be accessed on re-entry to the function body. This is skipped for literals as the literal does not need to be stored in a variable, it can simply be used as-is.

However, the DDC JS AST did not treat "this" or "super" as literals so we ended up with invalid JS like "let temp = super; // do await; temp.foo(...);". In this case "let temp = super;" is invalid, "super" cannot be used as a bare expression.

--- Function scope change ---
The original approach of using TemporaryIds for all the hoisted variables had a large flaw in that it didn't account for scopes captured by closures within async code. Hoisted variables were lifted out of their attached scope and so closures captured the single hoisted declaration and all modified the same variable. See async_scope_capture_test.dart for an example of this breaking.

To fix this we need to box any captured variables into a JS object. We then wrap any closures in an IIFE and pass the correct scope objects in as arguments to "capture" them. This is similar to dart2js's approach of boxing variables for closures. The approach is a little less fine-grained though and we simply box every variable. This makes the logic simpler and provides a better debug experience as users will just be able to look at the available "asyncScope" variables and see all the declarations in the original source code.

--- Add async callback ---
After further study, none of the other backends add implicit calls to 'async_helper.asyncStart' or 'async_helper.asyncEnd'. All the tests (with the exception of the hot_restart_timer_test updated below) are all set up to call asyncStart if they need it. As such we can simply remove and calls in the runtime/sdk to 'addAsyncCallback' (which is then calling 'async_helper.asyncStart'). Ditto with their remove/end counterparts.

Change-Id: Iac9a3774cc43fc2270e3bb2e992893358042e604
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376020
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-07-30 03:13:58 +00:00
Nicholas Shahan 21dee0734f [js_interop] Add tests for Object literal factory
Ensures factories using named arguments to create Object literals
work as expected when the names shadow properties on the native
JavaScript Object prototype.

Issue: https://github.com/dart-lang/sdk/issues/56315
Change-Id: Iaae8390f853a6f32ac6ba891a56643296a394930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377723
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-07-29 18:19:54 +00:00
Daco Harkes 0a8d85eb8d [vm/ffi] Mark tests as slow
Bug: https://github.com/dart-lang/sdk/issues/56330
Change-Id: Ib2e522a39ab780403d9a485344e29d80755136a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377820
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-07-29 12:11:51 +00:00
Daco Harkes 4730365bde [native_assets] Don't tree-shake vm:ffi:native-assets library
Adds a `pragma('vm:entry-point')` to the synthesized library and makes
the tree-shakers respect that pragma on `library`s.

TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: Found in g3.
Change-Id: I1bc63b42ab867a5f1d2e7f9da4842de59f3d5c1d
Cq-Include-Trybots: dart/try:vm-aot-asan-linux-release-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-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-asan-linux-release-arm64-try,vm-msan-linux-release-arm64-try,vm-tsan-linux-release-arm64-try,vm-ubsan-linux-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377442
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-07-29 10:29:29 +00:00
Stephen Adams 24bbfe942e [language] Test for strangely named optional named arguments
A test with names than need care when using the 'bag' method of
passing named optional arguments compiled to JavaScript.

Issue: #56314
Issue: #56315

Change-Id: Ia024e51f443717412e22c70313d1adeeefb284c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377360
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-07-24 23:02:55 +00:00
Stephen Adams 973b4ce7be Regression test for issue 56314
Bug: #56314
Change-Id: I20bad02848e21a3b313c8d8da3e444ff390d4a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377270
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-07-24 22:17:37 +00:00