Commit graph

114 commits

Author SHA1 Message Date
Aske Simon Christensen b85443e333 [dart2wasm] Skip selectors with no implementations in dispatch table
This fixes a case of an empty selector in the dispatch table in
`lib/js/static_interop_test/mock/mockito_test`.

Change-Id: Ia4e409b4d45c71de8691f1290a853017bc56399f
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259741
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-09-21 09:56:36 +00:00
Srujan Gaddam 8a081b95c6 [pkg:js] Add type/conformance checking for createStaticInteropMock
Bug: https://github.com/dart-lang/sdk/issues/49351

Adds checks for the following cases:
- Type arguments to createStaticInteropMock are correct
- No missing members in implementing class
- Inherited and non-overridden @staticInterop members are implemented
- Dart class can implement through inheritance and mixins
- Implemented members are correct subtypes of @staticInterop members
- Potential extension member conflicts that are attempted to be
resolved through subtyping rules

Change-Id: Iacbe5846040ba7fab41459aa19be77351cf1efca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-09-16 20:13:30 +00:00
Joshua Litt 8429f01593 [dart2wasm] Implement optional parameters for JS interop callbacks.
Also added tests of optional parameters for static interop functions.

Change-Id: Id23237b96d0de5a4a4b948b3f23fd1bfe40b218e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259101
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-14 22:33:02 +00:00
Aske Simon Christensen 35e35f5786 [dart2wasm] Support different default values within the same selector
Default parameter values are implemented in dart2wasm via caller-side
substitution. When the same parameter has different default values
across different implementations within the same selector, a
special sentinel value is passed by the caller, and the callee
checks for this value and substitutes the actual default value.

Change-Id: I8235145f93c2aee7e9ef603456380253b836fcef
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259040
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-14 13:43:52 +00:00
Aske Simon Christensen 99ad190028 [dart2wasm] Implement super tear-offs
Change-Id: I7686a1a1ae4f91e1ffe6f6dd6c3d2f7c4341f80b
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258924
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-14 13:43:52 +00:00
Aske Simon Christensen 33a5b3e270 [dart2wasm] Implement instantiation constants
Change-Id: If602ecc06fabf2581484b90547d0dbcfbb5d30e0
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257362
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-14 13:43:52 +00:00
Aske Simon Christensen 72797a3761 [dart2wasm] Make type parameters available in async return types
Change-Id: I117647010dfe2f6b60b5124d99ad250af4a491be
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258805
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-09-13 07:03:18 +00:00
Aske Simon Christensen 98055e5b86 [dart2wasm] Fix vtable offsets for closures with named parameters
Change-Id: I4a2916e52d371937d11b2b6d5c878355b55e742b
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258804
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-09-13 06:49:08 +00:00
Aske Simon Christensen 51c4e03928 [dart2wasm] Type parameters and optional parameters for closures
Changes the representation of closures to include a vtable with entry
points for the various ways in which the function can be called.

For each combination of type parameter count and positional parameter
count, the names of named parameters occurring together with that
combination are partitioned into clusters such that any combination of
names that occurs together is contained within a single cluster.

Each combination of type parameter count and positional parameter
count gets a vtable layout for signatures without named parameters,
plus one for each cluster of parameter names belonging to the
combination.

Each vtable layout will have an entry for each number of positional
arguments from 0 up to the maximum number for the signature, followed
by an entry for each (non-empty) combination of argument names from
its cluster that occurs in a function call in the program.

This layout scheme is consistent with function subtyping in the sense
that if signature B is a subtype of signature A, then the Wasm struct
for the vtable layout corresponding to B is a subtype of the Wasm struct for the vtable layout corresponding to A, i.e. the fields in the layout
for A is a prefix of the fields in the layout for B.

Change-Id: I36569be5251cc0cca4373b08c48d37c214478c3c
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256822
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-12 10:04:46 +00:00
Aske Simon Christensen 0cb91b9824 [dart2wasm] Produce wrapper functions for closures
Instead of using top types for the parameters and return of the
implementation function for a function expression or local function,
use precise types and generate a wrapper function with top types that
casts the parameters and calls the implementation function.

This unifies the wrapper function generation with tear-offs, setting
the stage for the upcoming generalization to support type parameters
and optional parameters.

The change also brings some benefits in its own right:
- Arguments to closures are converted once instead of at every use
- Direct calls to local functions avoid the conversion of arguments

Also add source location to closure function names and generally avoid
parentheses in function names, as they are confusing in stack traces.

Change-Id: If83073bb2e2dd17554ffa03fa2596e79d730fb67
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256665
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-12 10:04:46 +00:00
Aske Simon Christensen 25b1bfe7a6 [dart2wasm] Print source location on exception during code generation
Change-Id: I870ee48707f6c353e2bd2c64505474d1d0e90130
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257344
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
2022-09-12 10:04:46 +00:00
Aske Simon Christensen 82f163fa4f [dart2wasm] Trivial test for subtype of Object
Saves some 27k code size (and redundant computation) on barista3.

Change-Id: I2c917ca54c356e754eaf555c93f05f008770654f
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258543
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-12 09:28:26 +00:00
Srujan Gaddam e7b2038f8f [wasm] Change transitive JS imports to be a set
Avoid duplicates from the transitive import lists.

Change-Id: I681b3c25f74ac15ef48e909f93de8bc9cd2a869e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258662
Commit-Queue: Joshua Litt <joshualitt@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-10 04:25:24 +00:00
Joshua Litt 014818bf8e [dart2wasm] Implement js_util.instanceof.
Also fixes performanceNow for Chrome.

Change-Id: I1b70610a8a1a44c0f0e3ce7b166f32f9915324c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258504
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-09 20:40:34 +00:00
Aske Simon Christensen 9af959c167 [dart2wasm] Coerce types on imports/exports to externref or funcref
Change-Id: Id7fe0775e14b7ed16c925819ffc9c41dea863e4d
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258001
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-09 18:10:34 +00:00
Joshua Litt 708264289d [dart2wasm] Use WasmExternRef for JS interop.
Change-Id: I01138d48ba9cc67954ef086968af90dae173fda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257880
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-07 20:55:27 +00:00
Joshua Litt eb540194ad [dart2wasm] Implement promiseToFuture.
Change-Id: I265441c5c78933f8bdace53f956d22677442d7fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257803
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-07 17:56:17 +00:00
Joshua Litt 2b85e02c5d [dart2wasm] Implement == for JSValue.
Change-Id: I45af5bdabfb0dfa12b6b39094843b9394f4fe510
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257923
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-09-07 16:37:17 +00:00
Joshua Litt f0ab6fb6ef [dart2wasm] Fix memory definition.
Size is number of 64kb pages.

Change-Id: I4c2876ebee553d0dc219e8dd8bb6b1169799a465
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257260
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-09-06 18:25:36 +00:00
Aske Simon Christensen 3f66deda68 [dart2wasm] Fix update of per-iteration closure context in for loops
Change-Id: If124d70e4db679376359deaab5e8b2dd6426453b
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256501
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-30 06:46:57 +00:00
Joshua Litt 9ed6ac86e2 [dart2wasm] More robust library lookup.
Change-Id: I3320b4e421961a68bf6e6c8fbe1f63bdc4e92064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256218
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-29 21:01:56 +00:00
Lasse R.H. Nielsen 8a883fa54d Change : to = for default values in pkg.
Leaves some in parser test:
 pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart

TEST=Refactoring, covered by existing tests.

Change-Id: I7a83ef95df3cbd283878b3685b5c747bd89a1b16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256125
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-08-24 15:57:16 +00:00
Aske Simon Christensen f16805e072 [dart2wasm] Support main taking parameters and supply dummies
Change-Id: I97d27db54413c5d752444d32467a7d33d30ac43d
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255997
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-08-23 10:20:00 +00:00
Aske Simon Christensen 7aebb788bf [dart2wasm] Support IntersectionType in translateStorageType
Fixes breakage of barista3 introduced in
https://dart-review.googlesource.com/c/sdk/+/253665

Change-Id: Ia4a6bf4da51d450de4184c7daff50aa9f3848df5
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255996
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-23 10:20:00 +00:00
Joshua Litt 8009c39d61 [dart2wasm] Implement dynamic naively.
Change-Id: I905a81faead20b4339309521018291d0b4d90dda
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250786
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-22 21:33:29 +00:00
Joshua Litt 1d6407fc3f [dart2wasm] Align semantics of jsify / dartify.
Change-Id: If4a5fc90093c35476a58e5f4755ef58ed9d9d889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255766
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-22 19:54:29 +00:00
Joshua Litt 6052fe0ca2 [dart2wasm] Implement await / for as lowering.
Change-Id: Ic41f016490c993f27c3e5873ad1a4b3e8a902f13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255822
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-22 18:08:31 +00:00
Srujan Gaddam 9f10a3bc16 [pkg:js] Add JsInteropChecks to Wasm backend
Also cleans up and unifies some behavior across the backends:

- avoiding reinstantiating JsInteropChecks for every library
- having the native classes as a member instead of recomputing on dart2js

Now that these checks exist, we can add lib/js/static_interop_test to
the test directories the wasm trybot runs.

Change-Id: I912aae988afe7915e80cc13d00b8c47818dfa520
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255760
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-08-19 17:48:38 +00:00
Aske Simon Christensen a85157e233 [dart2wasm] Convert to/from externref via Wasm instructions
This adds support for the newly added `extern.externalize` and
`extern.internalize` instructions and uses these for converting to/from
`externref` instead of a JS round-trip.

Change-Id: If18d8f44ddf013d4c26bf1597be91bcd0db41c5a
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255462
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-19 07:11:18 +00:00
Aske Simon Christensen 02d1255d75 Update d8 to 10.6.166
The API for the JS Promise integration API has changed to be part of
the `new WebAssembly.Function` constructor. This requires parameter
types to be specified explicitly. Apparently, these types currently
must be all `externref`.

Change-Id: Ifae634f65cfa377441be4b2dc0643c34b702fbe7
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255061
Reviewed-by: Stephen Adams <sra@google.com>
2022-08-19 07:11:18 +00:00
Aske Simon Christensen b1c0992199 [dart2wasm] Implement the three-pronged WasmGC type hierarchy.
This splits the type hierarchy into three separate hierarchies with
the top types `any`, `func` and `extern`.

Update d8 to 10.6.91, which switches to the new type hierarchy.

Also, all ref shorthands for abstract heap types are now nullable, so
the type emitter in the `wasm_builder` is updated to follow that scheme.

To reduce confusion about the nullability of abstract reference types,
these now all require the nullability to be specified explicitly.

Change-Id: I4774d08cbed18307e481c466b2e3402a8d8fb6bd
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255060
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-19 07:11:18 +00:00
Aske Simon Christensen bde8430b97 [dart2wasm] Initial async/await support based on Promise integration
This implementation has a number of limitations:

- Returning a Future from an async function is not supported.
- Every async call switches to a new stack. A later optimization will
  stay on the same stack if the call is directly awaited.
- Exceptions that cross async boundaries do not receive full stack
  traces including the async suspension points. The stack trace of the
  final exception just reflects the stack trace for the outermost
  async call.

Change-Id: I2a5d5e30d6e955999ba55842c8b2ca3427cbf954
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241010
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-19 07:11:18 +00:00
Aske Simon Christensen 43e003ba04 Update d8 to 10.6.51
The Promise integration API has been updated to automatically
instantiate suspenders when an async export is called, which enables
the async/await implementation in dart2wasm to avoid a limited-size
stack pool.

Also, the --experimental-wasm-nn-locals options has been removed,
since non-nullable locals are now always enabled.

This is the last version before the (backwards-incompatible) change
over to the three-pronged WasmGC type hierarchy.

Change-Id: Ide164d83059877fa32f4ada9907290dd3d091b7a
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254924
Reviewed-by: William Hesse <whesse@google.com>
2022-08-19 07:11:18 +00:00
Joshua Litt 4810c8930b [dart2wasm] Initial regexp support.
Change-Id: Ia461c77979785bbc0510052a31f94bdd83babc01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250582
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-18 19:49:34 +00:00
Joshua Litt 2c4ee2895f [dart2wasm] Implement toString methods on double using JS interop.
Change-Id: I5843e9cae59b8f152b922a01796eaf05494808a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250681
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-17 00:23:52 +00:00
Joshua Litt 591ef06a29 [dart2wasm] Implement unimplemented Uri methods.
Change-Id: I54b8633d39df64d1760a7face5dda38c3aa95d5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251592
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-08-16 22:38:02 +00:00
Joshua Litt 3923013b81 [dart2wasm] Implement some missing members on String.
Change-Id: I37db0a4fa2ebdd0101832e0e4025cb5a38434dc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251720
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-16 20:34:54 +00:00
Aske Simon Christensen 26053f4d51 [dart2wasm] Fix nullable downcast from types above dataref
When casting down from `anyref` or `eqref`, an intermediate
`ref.as_data` instruction is needed. However, this instruction traps on
`null`, so for nullable casts, explicit null handling is required.

Change-Id: I835f1b59d291f848a008c855843f286f0d11d5fb
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255242
Reviewed-by: Joshua Litt <joshualitt@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-16 16:29:07 +00:00
Aske Simon Christensen 5ea5e3f0b2 [dart2wasm] Remove RTT support and emit isorecursive types
Relatedly, remove the --nominal-types and --runtime-types options and
eliminate the instruction and type wrappers that abstracted over these
options.

Rename instructions to the names in the latest WasmGC working draft.

Change-Id: Icd0e4bbcf444d5a3cea1f88f4e3bf8dd2926f70f
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254902
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-16 08:31:57 +00:00
Joshua Litt 90478c34c4 [dart2wasm] Support typed data conversions across JS interop boundary.
Change-Id: Ie8aca2027ac47dafd79636d8ac06f3466817b8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253841
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-08-10 20:23:41 +00:00
Joshua Litt b99140115b [dart2wasm] Fix some js interop related issues.
Change-Id: Id189c53c7a4c536c703b0b9e83265a81d0c14094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253609
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-08 17:29:40 +00:00
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