Commit graph

73 commits

Author SHA1 Message Date
Srujan Gaddam 61abaeda3f [CFE/web] Move static interop erasure and remove outline stubber
Deletes the outline stubber as it's not necessary on any backend.
DDC should compile the entire sources and outline dill in one step.
dart2wasm operates similarly, and so only needs the modular transformer.
dart2js moves the erasure to a global transform.

Also, this CL reverts now unnecessary plumbing that was needed for the
outline stubber.

Change-Id: Ic085c4fad5a6bdfc7d6916f7fa575c6ef9b20110
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253000
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-08-01 18:17:44 +00:00
Joshua Litt 15a2ef2449 [dart2wasm] Add noSuchMethod forwarders.
Change-Id: I30ac0bf31969a6b2930323dae73f52389702ab2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251588
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-07-28 02:18:34 +00:00
Joshua Litt e1933cd4a0 [dart2wasm] Implement NoSuchMethodError.
Change-Id: I1a799255f93449fef011cb0bc9b92cd63f3437c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250791
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-28 01:20:40 +00:00
Aske Simon Christensen 9814b569ba [dart2wasm] Remove support for not using non-nullable locals.
With the decision to support non-nullable locals in WasmGC as per
https://github.com/WebAssembly/function-references/issues/44 the
support in dart2wasm for forcing all locals to be nullable is no
longer needed.

This CL removes that support and cleans up some related nullability
issues. Specifically:

- Remove the `--local-nullability` and `--parameter-nullability`
  commandline options. These are now always enabled.
- Clean out special cases around forced nullable locals throughout the
  compiler.
- Make `thisLocal` and `preciseThisLocal` always non-nullable.
- Make `returnValueLocal` (for storing the return value of `return`
  statements inside `try` blocks with `finally`) always defaultable,
  since its initialization flow crosses control constructs.
- Make type argument parameters non-nullable.
- Make non-nullable `FutureOr` translate to a non-nullable Wasm type.
- Implement the "initialized until end of block" validation scheme
  in the Wasm instruction validator.
- Run tests with the `--experimental-wasm-nn-locals` option. This
  is likely going away soon, but for now we need it.

Change-Id: I05873dd70510af5944d86d37cb5765c7bdef73a9
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252600
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-07-27 22:47:30 +00:00
Aske Simon Christensen e75be087e5 [dart2wasm] Fix handling of null values in some non-nullable contexts
Change-Id: Id25f4899d0898686ee30bf05f7e57a9ef84fb818
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252740
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-27 22:47:30 +00:00
Joshua Litt 9683862a4e [dart2wasm] Minor fixes to unblock building Flutter.
Change-Id: I58b9554b94f8a35432a04a27a7bf1b39701f45d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251781
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-07-27 17:31:28 +00:00
Joshua Litt 63a9057f12 [dart2wasm] Implement unimplemented methods in DateTime.
Change-Id: Ia84d2e65ab6207fc70f6f8380c18ba3b89f7400f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251590
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-27 00:50:47 +00:00
Joshua Litt 9e83c53c61 [dart2wasm] Implement constant symbols.
Change-Id: I758576a7a35c6ffe127fd02eb394e97719750476
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250776
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-26 17:40:07 +00:00
Joshua Litt 3e22f16204 [dart2wasm] Fix some uses of void.
Change-Id: Ia05014c2ce155834b0b3a327a40e500cd0c2941d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250540
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-25 23:05:16 +00:00
Joshua Litt 9ac9025e48 [dart2wasm] Fix minor bug in set.
Change-Id: I127539ae7c99d9b5ef519ed10077f33f019504b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251502
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-07-25 21:20:46 +00:00
Joshua Litt b9dc9a7fbe [dart2wasm] Support environmental constants.
Change-Id: I2e66c35c209b6c0a0e56b4fd7a5eefd8c3e15c5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250482
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-25 20:13:02 +00:00
Joshua Litt d8d8403a90 [dart2wasm] Trivial fix for visitThis in closures.
Change-Id: I4eda2430adb89d328dcec8b18e7acf1652f86c10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251501
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-25 17:29:59 +00:00
Joshua Litt e45f73dd6d [dart2wasm] Use VM's bigint implementation.
Change-Id: Ie0cfa40ec4497ee9d6eacff07bc479fe7d74537c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250485
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-25 17:16:29 +00:00
Aske Simon Christensen 6918c02ebe [dart2wasm] Fix parsing of commandline flag options
Change-Id: Iac05ade693c7596fe41c0ba3d37eb7e5d2e5f9fe
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252607
Reviewed-by: Joshua Litt <joshualitt@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-25 15:39:09 +00:00
Joshua Litt c8728d92e3 [dart2wasm] Switch to package args for command line parsing.
Change-Id: I6ca7846e7dd2f41d4b04dcba1fce8ac8e7b1391f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250481
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-25 02:24:58 +00:00
Joshua Litt f6f29df4b5 [dart2wasm] Enable RTI tests for oddball and interface types.
Change-Id: I4b92d4cf30779b78f3eab1acd18193fdd58ab452
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249641
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-23 00:56:38 +00:00
Joshua Litt a04e69716c [dart2wasm] Fix some missed conversions on _TypedData getters.
Change-Id: Ib246388aa0b48dff2ebf4704633b7ffc79b1b40a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250560
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-07-23 00:06:47 +00:00
Joshua Litt a13ef8a5d5 [dart2wasm] Fix the case of an exported main.
Change-Id: Icf6b2b37a30b68f70c191394b6107e39dd060bde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250561
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-22 18:06:59 +00:00
Joshua Litt 7a937a12c8 [dart2wasm] Fix closure capture of super properties.
Change-Id: I79f4c44da607379191718aba85b4a7a854f472fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250541
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-22 18:05:30 +00:00
Joshua Litt 5e733dec66 [dart2wasm] Fix minor bug with redirecting initializers.
Change-Id: I747ad702d2189b7c113e9202f77ad19a4b72c14a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250580
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-07-22 17:57:27 +00:00
Joshua Litt a6b15c8f4a [dart2wasm] Handle switch without cases.
Change-Id: Ie2ccdf69e3cf276769b1b2a2e22faa1bb9e089d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250484
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-22 00:30:16 +00:00
Aske Simon Christensen eaac498a9a [dart2wasm] Don't downcast the receiver in Object methods
Methods on Object can be called on the box classes, whose Wasm
representations are not subtypes of the Object struct. Thus, the
downcast of the receiver for the preciseThis local will fail for
instances of these types.

Since the only addition in the Object struct is the identity hash
code, and this is only accessed through the _getHash and _setHash
intrinsics, no Object members need access to the precise receiver.

Change-Id: Ice8d4292019618b71ee6aaf7550010f6d1d29d01
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252380
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-21 18:13:26 +00:00
Joshua Litt 2c891cda56 [dart2wasm] Fix bug in algorithm to reuse super _typeArguments.
language/type_variable/promotion_test starts failing because
`joinReplaceAllResult` isn't implemented yet.

Change-Id: Ifd7ff6d94486499b8cf398dd2c749d10500e242a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250480
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-07-21 01:57:33 +00:00
Joshua Litt f8ac4a19b3 [dart2wasm] Fix minor bug in for statement context management.
Change-Id: Ib3b4e624d9c44e0c8c464cc7b55b100374b4c92e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250447
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-21 01:53:45 +00:00
Joshua Litt 30883121e9 [dart2wasm] Weaken assertion for Constant objects in switches.
We have to support arbitrary constants in switch statements. For
example:

language/implicit_creation/implicit_const_context_list_test
language/implicit_creation/implicit_const_context_map_test

Change-Id: I339c4e3be0299923bc747f458deeaa5ab28b5bfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250445
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-07-20 17:00:55 +00:00
Joshua Litt 1dd12d45c7 [dart2wasm] Add support for stub dart:io.
Change-Id: Ic6c7e7dc230023d5aee35529ff8ab600f1d0ec3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250444
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-07-20 16:51:25 +00:00
Aske Simon Christensen d8d9e06804 [dart2wasm] Support defining, exporting and accessing Wasm tables
Tested: Added tests/web/wasm/table_test.dart
Change-Id: I3971f4432a7a59bd6bc9874fc96202a7a9f2283d
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248586
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-19 13:06:54 +00:00
Devon Carew ea43dfee36 [pkg/dart2wasm] use package:lints for analysis
Change-Id: I5a17a8e8a5213dc30f4a2dd29fafac0a2030c722
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250780
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-07 00:16:01 +00:00
Srujan Gaddam b372fd4c52 [CFE/pkg:js] Find reference of stub if it already exists
Fixes #49301

From https://github.com/dart-lang/sdk/issues/49301#issuecomment-1165536192

Adds referenceFromIndex to outline transformations so that the eraser
can use it to find the reference for the stub if it was already created.
This is needed when the module where the stub exists is invalidated.
Since references in other modules should still be valid, we should
attempt to get that reference.

Change-Id: I5905a002480444aecd57de650cd439bdc34d4eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249729
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-28 18:36:02 +00:00
Joshua Litt 51e38cb554 [dart2wasm] Correctly generate type arguments for InterfaceType.
Change-Id: I8b6429827e691f09875df90ea32ba91021ab2418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245286
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-06-24 20:07:20 +00:00
Johnni Winther 391540c889 [cfe] Make (Abstract)Super*.interfaceTarget non-nullable
This is a step towards improving the semantics of these nodes.

TEST=existing

Change-Id: I95bdb86790414b38af73e9e932cc228b3c0f1f6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249040
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-23 09:16:55 +00:00
Srujan Gaddam 459d57c8b8 [package:js] Add static interop stub for outlines
Fixes b/235393918

@staticInterop replaces factories with a new named node, a static
method. In order to persist this transformation in modular
compilation, this needs to be done to outlines that can then be
consumed by the source library. In order to allow erasure at the
time of 'performOutlineTransformations', coreTypes is added to that
API.

Change-Id: I90d17fff8bbe143982fcd12cfb06dc3e8d58781a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247928
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-06-17 19:58:49 +00:00
Joshua Litt 05dfe9047d [dart2wasm] Build type rules for interface type arguments.
Change-Id: I4017d14ff9b32b2a556592f5074cdd3401c7d961
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243960
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-06-16 18:50:59 +00:00
Joshua Litt 76ccc89a10 [dart2wasm] Fix a number of minor JS interop issues.
This CL fixes a number of minor JS interop issues.
* `dartify` was moved to Dart, so we can control implicit coercion from JS
* All JS types are 'correctly' handled in `dartify` though a few are boxed
  as opaque types that could be exposed.
* The logic to convert a JS array is now driven from the Dart side.
* Function, Number, and Boolean can now make the roundtrip through Dart.
* The wrapper for Dart functions in JS is now a regular JS function.

Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try

Change-Id: Ifcd7a447419bca2adf78070e07750c1b3c5c6a18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247925
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-06-14 17:32:39 +00:00
Aske Simon Christensen 90a45668d5 [dart2wasm] Support all import and export kinds in wasm_builder
Also makes table type explicit and fixes a bug in element serialization
for tables beyond index 0.

Change-Id: I7c27071e00331c41010da771ae0075e798e457a9
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247545
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-06-10 12:41:45 +00:00
Joshua Litt 3fd96e2cb8 [dart2wasm] Wire up stubbed out dart:js on dart2wasm
Change-Id: Ia06db4b1b2f3d07278819936842a4185cc9a45f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247329
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-06-08 20:38:52 +00:00
Aske Simon Christensen 79abd5ea56 [dart2wasm] Emit unreachable as default case when switch is exhaustive
The front-end variable initialization analysis considers a variable
definitely initialized if it's initialized in all `case` branches of an
"explicitly exhaustive" `switch` statement, i.e. a `switch` statement switching on an enum value where the `case` branches cover all variants
of the enum.

In order for the emitted Wasm code to validate according to the
flow-sensitive non-nullable locals validation scheme being discussed in
https://github.com/WebAssembly/function-references/issues/44 this
definite initialization must be reflected in the static control flow of
the Wasm code. Thus, such a switch statement must not have static
control flow exiting the switch statement through the (dynamically
unreachable) default case.

Change-Id: I53628d2c6e9690214ffb4c60498c4f2b895f33e7
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245985
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-06-07 10:45:39 +00:00
Ömer Sinan Ağacan 1456af7b97 [dart2wasm] Implement backward jumps in switch statements
Change-Id: I1c39722edb72d7fb5128bb9fe7e4d03ce4041849
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246443
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-06-07 08:30:29 +00:00
Joshua Litt d872e74a6d [js] Support js_util on Dart2wasm.
This CL consists of:
1) Moving most of the contents of `js_util_wasm_patch` to
   `js_util_patch` and `js_helper`.
2) Addressing the inconsistencies between `js_util` and `js_util_wasm`.
3) Fixing a minor bug with nested `allowInterop` in
   `js_util_wasm_optimizer`.
4) Removing hardcoded eval.

Change-Id: Ie43cdc91d344745ef9b40e273192b34af2a84138
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246380
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-06-06 18:18:20 +00:00
Devon Carew f7c46f145c [pkg] prefer 'any' deps for package dev dependencies
Tested: CI validation
Change-Id: If65cc156130a65ffe00c6f1660ac320e2921afae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246053
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-05-27 01:34:59 +00:00
Aske Simon Christensen 1fbbbf3c97 [dart2wasm] Support accessing function type parameter from within lambda
This completes the implementation of runtime access to type arguments.

Generic function expressions and local functions are now explicitly
rejected, which causes a number of new failures. These tests were
previously spurious passes, since generic functions are not supported.

Change-Id: Ibbf8bde94cddf2c0f86e3740a798c1602897f631
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244402
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-05-20 12:34:12 +00:00
Nate Bosch 6ebd2633cd Use any deps for all unpublished packages
It should not be necessary to ever run `pub get` for a package which is
not published. All packages used in the SDK are controlled by a single
package config, so it's not necessary to declare versions or paths for
any packages.

Remove all dependency overrides.

R=devoncarew@google.com

Change-Id: Icb328813b471f35ee4c99995f4e90aac4d8ed438
Tested: Covered by existing static analysis.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244767
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2022-05-17 01:22:25 +00:00
Joshua Litt 5729605e18 [dart2wasm] Implement FunctionType Type.
Change-Id: I65cf6f18ef3ca4892d1940ba8b67ca98ca0395da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243935
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-05-16 21:36:07 +00:00
Aske Simon Christensen 6c7604291c [dart2wasm] Build platform dill and compile dart2wasm to AOT snapshots
This adds a --platform= option to dart2wasm to read the SDK libraries
from that dill file instead of compiling them from source every time.
If the option is not given, the SDK libraries are compiled, like before.

Also adds a "dart2wasm" build target, which will build the dart2wasm
platform dill and compile dart2wasm to two AOT snapshots (with and
without asserts). The dart2wasm scripts in sdk/bin are updated to run
via these snapshots and use this platform dill.

This speeds up test runs for the dart2wasm-hostasserts-linux-x64-d8
configuration by approximately 45x.

Change-Id: If2c7750a6eb39725310745f887792784d0dfc583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243624
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-05-10 10:06:06 +00:00
Joshua Litt d753b61535 [dart2wasm] Implement runtime type test for FutureOr.
Change-Id: I9ad00f5e9b1ca77f52f03e24115f8f4bae5910b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243166
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-05-09 16:13:22 +00:00
Joshua Litt b0f7dea9d9 [dart2wasm] Pass NnbdMode.Strong to CFE.
Change-Id: I27b6d5708f22cb89474a0a262cc0c4404f57ec50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243043
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-05-02 10:26:13 +00:00
Joshua Litt 6055226a21 [dart2wasm] Initial scaffolding for runtime type checking.
Change-Id: I6ae0cadf5d626ebd22e6613f0d790b5fff6d0f38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241401
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-04-30 01:18:41 +00:00
Aske Simon Christensen c6a061f41d [dart2wasm] Implement set literals in the backend
Change-Id: I678a6c16248bfafce2e39c6c3e39505109250f35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242861
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-04-29 15:02:51 +00:00
Aske Simon Christensen e31cc74d54 [dart2wasm] Fix some type errors in the for-in loop transformation
These errors don't affect code generation, but they produce invalid
kernel which can't be serialized, so fixing them is a prerequisite for
emitting a platform dill for dart2wasm.

Also run the kernel verifier on the post-TFA kernel when asserts are
enabled. Due to the TFA tree shaking, this has a relatively minuscule
effect on the run time of the compiler.

Change-Id: I6e7ae0e098703695bc85cddf11050f68f6cd0c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242545
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-04-29 15:02:51 +00:00
Aske Simon Christensen 89e485cd2e [dart2wasm] Refactor generate method into individual kinds
Change-Id: I6c41931232f6b3805271c85e544431763d2c747d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241966
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-04-26 09:00:03 +00:00