Change in dart/sdk[main]: [dart2wasm] Initial commit for the Dart-to-WasmGC compiler.

194 views
Skip to first unread message

Aske Simon Christensen (Gerrit)

unread,
Feb 14, 2022, 6:47:25 AM2/14/22
to rev...@dartlang.org

Attention is currently required from: Aske Simon Christensen.

Aske Simon Christensen uploaded patch set #68 to this change.

View Change

[dart2wasm] Initial commit for the Dart-to-WasmGC compiler.

This is work in progress. Several language features are still
unimplemented or only partially implemented, and the interfaces to
running the compiler and its output are preliminary and expected to
change.

The history of the prototype that this is based on can be seen here:

https://github.com/askeksa-google/sdk/tree/wasm_prototype

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

Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
---
M .dart_tool/package_config.json
M .packages
M README.md
A pkg/dart2wasm/bin/dart2wasm.dart
A pkg/dart2wasm/bin/run_wasm.js
A pkg/dart2wasm/dart2wasm.md
A pkg/dart2wasm/lib/class_info.dart
A pkg/dart2wasm/lib/closures.dart
A pkg/dart2wasm/lib/code_generator.dart
A pkg/dart2wasm/lib/compile.dart
A pkg/dart2wasm/lib/constants.dart
A pkg/dart2wasm/lib/constants_backend.dart
A pkg/dart2wasm/lib/dispatch_table.dart
A pkg/dart2wasm/lib/functions.dart
A pkg/dart2wasm/lib/globals.dart
A pkg/dart2wasm/lib/intrinsics.dart
A pkg/dart2wasm/lib/param_info.dart
A pkg/dart2wasm/lib/reference_extensions.dart
A pkg/dart2wasm/lib/target.dart
A pkg/dart2wasm/lib/transformers.dart
A pkg/dart2wasm/lib/translator.dart
A pkg/dart2wasm/pubspec.yaml
M pkg/smith/lib/configuration.dart
M pkg/test_runner/lib/src/command.dart
M pkg/test_runner/lib/src/command_output.dart
M pkg/test_runner/lib/src/compiler_configuration.dart
M pkg/test_runner/lib/src/configuration.dart
M pkg/test_runner/lib/src/runtime_configuration.dart
M pkg/test_runner/lib/src/test_suite.dart
A pkg/wasm_builder/LICENSE
A pkg/wasm_builder/lib/src/instructions.dart
A pkg/wasm_builder/lib/src/module.dart
A pkg/wasm_builder/lib/src/serialize.dart
A pkg/wasm_builder/lib/src/types.dart
A pkg/wasm_builder/lib/wasm_builder.dart
A pkg/wasm_builder/pubspec.yaml
A sdk/bin/dart2wasm
A sdk/bin/dart2wasm_developer
M sdk/lib/_internal/vm/lib/compact_hash.dart
M sdk/lib/_internal/vm/lib/typed_data_patch.dart
A sdk/lib/_internal/wasm/lib/bool.dart
A sdk/lib/_internal/wasm/lib/class_id.dart
A sdk/lib/_internal/wasm/lib/core_patch.dart
A sdk/lib/_internal/wasm/lib/date_patch.dart
A sdk/lib/_internal/wasm/lib/developer.dart
A sdk/lib/_internal/wasm/lib/double.dart
A sdk/lib/_internal/wasm/lib/expando_patch.dart
A sdk/lib/_internal/wasm/lib/function.dart
A sdk/lib/_internal/wasm/lib/growable_list.dart
A sdk/lib/_internal/wasm/lib/hash_factories.dart
A sdk/lib/_internal/wasm/lib/identical_patch.dart
A sdk/lib/_internal/wasm/lib/immutable_map.dart
A sdk/lib/_internal/wasm/lib/int.dart
A sdk/lib/_internal/wasm/lib/internal_patch.dart
A sdk/lib/_internal/wasm/lib/list.dart
A sdk/lib/_internal/wasm/lib/math_patch.dart
A sdk/lib/_internal/wasm/lib/object_patch.dart
A sdk/lib/_internal/wasm/lib/patch.dart
A sdk/lib/_internal/wasm/lib/print_patch.dart
A sdk/lib/_internal/wasm/lib/string_buffer_patch.dart
A sdk/lib/_internal/wasm/lib/string_patch.dart
A sdk/lib/_internal/wasm/lib/timer_patch.dart
A sdk/lib/_internal/wasm/lib/type.dart
M sdk/lib/libraries.json
M sdk/lib/libraries.yaml
A sdk/lib/wasm/wasm_types.dart
A tests/language/language_dart2wasm.status
M tools/bots/test_matrix.json
68 files changed, 15,781 insertions(+), 1 deletion(-)

To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
Gerrit-Change-Number: 175728
Gerrit-PatchSet: 68
Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
Gerrit-CC: Commit Bot <commi...@chromium.org>
Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
Gerrit-MessageType: newpatchset

Aske Simon Christensen (Gerrit)

unread,
Feb 15, 2022, 4:51:48 AM2/15/22
to rev...@dartlang.org

Attention is currently required from: Aske Simon Christensen.

Aske Simon Christensen uploaded patch set #69 to this change.

View Change

[dart2wasm] Initial commit for the Dart-to-WasmGC compiler.

This is work in progress. Several language features are still
unimplemented or only partially implemented, and the interfaces to
running the compiler and its output are preliminary and expected to
change.

This commit also adds a dart2wasm-hostasserts-linux-x64-d8 testing
configuration to run the compiler over the test suite.
68 files changed, 15,784 insertions(+), 1 deletion(-)

To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
Gerrit-Change-Number: 175728
Gerrit-PatchSet: 69

Aske Simon Christensen (Gerrit)

unread,
Feb 15, 2022, 1:09:33 PM2/15/22
to rev...@dartlang.org, Dart CI, Joshua Litt, Commit Bot

Patch set 70:Commit-Queue +1

View Change

24 comments:

  • Patchset:

    • Patch Set #70:

      Thanks, Joshua. I agree that it works better to not formulate the comments as questions, so I have reformulated them in various ways.

  • File README.md:

  • File pkg/dart2wasm/lib/class_info.dart:

    • Patch Set #67, Line 245: represetations

      representation? Though do you mean 'type representations' or is a 'representation type' something el […]

      It's "repesentation types". The type used to represent the class.

  • File pkg/dart2wasm/lib/closures.dart:

  • File pkg/dart2wasm/lib/code_generator.dart:

  • File pkg/dart2wasm/lib/constants.dart:

  • File pkg/dart2wasm/lib/dispatch_table.dart:

    • Patch Set #67, Line 52: representation types

      'type representations'? Please ignore if a 'representation type' has some meaning I'm not aware of.

      It's "representation types".

  • File pkg/dart2wasm/lib/translator.dart:

    • Patch Set #67, Line 48:

      ///
      ///

      Are these two new lines intentional?

      I actually meant to write some more text here but forgot about it. :)

  • File pkg/wasm_builder/lib/src/instructions.dart:

    • Patch Set #67, Line 92:

        /// When emitting instructions, should a textual trace of the instruction
      /// stream be recorded (provided asserts are enabled)?

      'Whether or not a textual trace of the instruction stream should be recorded when emitting instructi […]

      Done

    • Patch Set #67, Line 99: /// Should the textual trace contain a byte offset for each instruction?

      'Whether or not the textual trace should contain byte offsets for each instruction'?

      Done

    • Patch Set #67, Line 122: /// Is the current point in the instruction stream reachable?

      'True if the current point in the instruction stream is reachable'?

      Done

    • Patch Set #67, Line 125: /// Has the instruction sequence been completed by the final `end`?

      'True if the instruction sequence has been completed by the final `end`'?

      Done

  • File pkg/wasm_builder/lib/src/serialize.dart:

  • File pkg/wasm_builder/lib/src/types.dart:

    • Patch Set #67, Line 11:

        /// Is this type a subtype of the [other] type, i.e. can this type be used
      /// as input where [other] is expected.

      'True if this [StorageType] is a subtype of [other], i.e... […]

      Done

    • Patch Set #67, Line 15: /// What is the *unpacked* form of this storage type

      'The *unpacked* form of this storage type... […]

      Done

    • Patch Set #67, Line 19: /// Is this a primitive (i.e. not reference) type?

      'True if this [StorageType] is a primitive... […]

      Done

    • Patch Set #67, Line 22: what is the size in bytes of a value of this type?

      '... […]

      Done

    • Patch Set #67, Line 39: Is this type nullable?

      'True if this type is nullable. […]

      Done

    • Patch Set #67, Line 46: Is this type defaultable?

      'True if this type is defaultable'?

      Done

    • Patch Set #67, Line 272: Is this heap type nullable by default

      'True if this heap type is nullable by default'?

      Done

    • Patch Set #67, Line 278: /// Is this heap type a declared subtype of the other heap type?

      'True if this heap type is a declared subtype of the other heap type'?

      Done

    • Patch Set #67, Line 281: /// Is this heap type a structural subtype of the other heap type?

      'True if this heap type is a structural subtype of the other heap type'?

      Done

To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
Gerrit-Change-Number: 175728
Gerrit-PatchSet: 70
Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
Gerrit-CC: Commit Bot <commi...@chromium.org>
Gerrit-Comment-Date: Tue, 15 Feb 2022 18:09:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Aske Simon Christensen <ask...@google.com>
Comment-In-Reply-To: Joshua Litt <joshu...@google.com>
Gerrit-MessageType: comment

Joshua Litt (Gerrit)

unread,
Feb 15, 2022, 1:19:18 PM2/15/22
to Aske Simon Christensen, rev...@dartlang.org, Dart CI, Commit Bot

Attention is currently required from: Aske Simon Christensen.

Patch set 70:Code-Review +1

View Change

1 comment:

  • Patchset:

To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
Gerrit-Change-Number: 175728
Gerrit-PatchSet: 70
Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
Gerrit-CC: Commit Bot <commi...@chromium.org>
Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
Gerrit-Comment-Date: Tue, 15 Feb 2022 18:19:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Dart CI (Gerrit)

unread,
Feb 15, 2022, 1:41:24 PM2/15/22
to Aske Simon Christensen, rev...@dartlang.org, Joshua Litt, Commit Bot

Attention is currently required from: Aske Simon Christensen.

go/dart-cbuild result: SUCCESS

Details: https://goto.google.com/dart-cbuild/find/d24b970fe08daeaec54d884eacd1c751277c3056

View Change

    To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
    Gerrit-Change-Number: 175728
    Gerrit-PatchSet: 70
    Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
    Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
    Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
    Gerrit-CC: Commit Bot <commi...@chromium.org>
    Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
    Gerrit-Comment-Date: Tue, 15 Feb 2022 18:41:20 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Aske Simon Christensen (Gerrit)

    unread,
    Feb 16, 2022, 4:21:53 AM2/16/22
    to rev...@dartlang.org

    Attention is currently required from: Aske Simon Christensen.

    Aske Simon Christensen uploaded patch set #71 to this change.

    View Change

    [dart2wasm] Initial commit for the Dart-to-WasmGC compiler.

    This is work in progress. Several language features are still
    unimplemented or only partially implemented.

    Instructions for running the compiler and its output can be found in
    pkg/dart2wasm/dart2wasm.md. These interfaces are preliminary and
    expected to change.

    The best version of d8 to use for this version of dart2wasm is 10.0.40,
    as explained here: https://dart-review.googlesource.com/c/sdk/+/232097


    This commit also adds a dart2wasm-hostasserts-linux-x64-d8 testing
    configuration to run the compiler over the test suite.

    The history of the prototype that this is based on can be seen here:

    https://github.com/askeksa-google/sdk/tree/wasm_prototype

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

    Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
    ---
    M .dart_tool/package_config.json
    M .packages
    67 files changed, 15,780 insertions(+), 1 deletion(-)

    To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
    Gerrit-Change-Number: 175728
    Gerrit-PatchSet: 71
    Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
    Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
    Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
    Gerrit-CC: Commit Bot <commi...@chromium.org>
    Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
    Gerrit-MessageType: newpatchset

    Aske Simon Christensen (Gerrit)

    unread,
    Feb 16, 2022, 6:09:52 AM2/16/22
    to rev...@dartlang.org

    Attention is currently required from: Aske Simon Christensen.

    Aske Simon Christensen uploaded patch set #72 to this change.

    View Change

    [dart2wasm] Initial commit for the Dart-to-WasmGC compiler.

    This is work in progress. Several language features are still
    unimplemented or only partially implemented.

    Instructions for running the compiler and its output can be found in
    pkg/dart2wasm/dart2wasm.md. These procedures are preliminary and
    Gerrit-PatchSet: 72

    Aske Simon Christensen (Gerrit)

    unread,
    Feb 16, 2022, 6:10:38 AM2/16/22
    to rev...@dartlang.org, Dart CI, Joshua Litt, Commit Bot

    Attention is currently required from: Aske Simon Christensen.

    Patch set 72:Commit-Queue +2

    View Change

      To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: sdk
      Gerrit-Branch: main
      Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
      Gerrit-Change-Number: 175728
      Gerrit-PatchSet: 72
      Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
      Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
      Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
      Gerrit-CC: Commit Bot <commi...@chromium.org>
      Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
      Gerrit-Comment-Date: Wed, 16 Feb 2022 11:10:33 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      Commit Bot (Gerrit)

      unread,
      Feb 16, 2022, 6:11:30 AM2/16/22
      to Aske Simon Christensen, rev...@dartlang.org, Dart CI, Joshua Litt

      Commit Bot submitted this change.

      View Change



      70 is the latest approved patch-set.
      No files were changed between the latest approved patch-set and the submitted one.

      Approvals: Joshua Litt: Looks good to me, approved Aske Simon Christensen: Commit
      [dart2wasm] Initial commit for the Dart-to-WasmGC compiler.

      This is work in progress. Several language features are still
      unimplemented or only partially implemented.

      Instructions for running the compiler and its output can be found in
      pkg/dart2wasm/dart2wasm.md. These procedures are preliminary and
      expected to change.

      The best version of d8 to use for this version of dart2wasm is 10.0.40,
      as explained here: https://dart-review.googlesource.com/c/sdk/+/232097

      This commit also adds a dart2wasm-hostasserts-linux-x64-d8 testing
      configuration to run the compiler over the test suite.

      The history of the prototype that this is based on can be seen here:

      https://github.com/askeksa-google/sdk/tree/wasm_prototype

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

      Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
      Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175728
      Reviewed-by: Joshua Litt <joshu...@google.com>
      Commit-Queue: Aske Simon Christensen <ask...@google.com>
      67 files changed, 15,783 insertions(+), 1 deletion(-)


      To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: sdk
      Gerrit-Branch: main
      Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
      Gerrit-Change-Number: 175728
      Gerrit-PatchSet: 73
      Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
      Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
      Gerrit-Reviewer: Commit Bot <commi...@chromium.org>
      Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
      Gerrit-MessageType: merged

      Dart CI (Gerrit)

      unread,
      Feb 16, 2022, 6:45:12 AM2/16/22
      to Commit Bot, Aske Simon Christensen, rev...@dartlang.org, Joshua Litt

      go/dart-cbuild result: SUCCESS

      Details: https://goto.google.com/dart-cbuild/find/6faa5f3bd00ad8cbc640b3fc80cf7466c002a7df

      View Change

        To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
        Gerrit-Change-Number: 175728
        Gerrit-PatchSet: 73
        Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
        Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
        Gerrit-Reviewer: Commit Bot <commi...@chromium.org>
        Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
        Gerrit-Comment-Date: Wed, 16 Feb 2022 11:45:06 +0000

        Alexander Thomas (Gerrit)

        unread,
        Feb 17, 2022, 5:30:30 AM2/17/22
        to Commit Bot, Aske Simon Christensen, rev...@dartlang.org, Dart CI, Joshua Litt

        Attention is currently required from: Aske Simon Christensen.

        Patch set 73:Code-Review +1

        View Change

        3 comments:

        • Patchset:

        • File tools/bots/test_matrix.json:

          • Patch Set #73, Line 2933: dart2wasm-linux-x64-d8

            Buildernames are currently a bit tricky to change: are there ever going to be variants of this using different modes (debug/release/product)? If yes, it would be good to have the mode already now in the configuration and builder names.

          • Patch Set #73, Line 2943: create_sdk

            The fileset doesn't actually use the out/dart-sdk folder. Is there a more limited target that could be used instead?

        To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
        Gerrit-Change-Number: 175728
        Gerrit-PatchSet: 73
        Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
        Gerrit-Reviewer: Alexander Thomas <at...@google.com>
        Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
        Gerrit-Reviewer: Commit Bot <commi...@chromium.org>
        Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
        Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
        Gerrit-Comment-Date: Thu, 17 Feb 2022 10:30:25 +0000

        Aske Simon Christensen (Gerrit)

        unread,
        Mar 7, 2022, 10:35:40 AM3/7/22
        to Commit Bot, rev...@dartlang.org, Alexander Thomas, Dart CI, Joshua Litt

        View Change

        2 comments:

        • File tools/bots/test_matrix.json:

          • Buildernames are currently a bit tricky to change: are there ever going to be variants of this using […]

            We decided to leave this name as is and add extra qualifiers (like "optimized") to other configurations.

          • The fileset doesn't actually use the out/dart-sdk folder. […]

            Done

        To view, visit change 175728. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
        Gerrit-Change-Number: 175728
        Gerrit-PatchSet: 73
        Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
        Gerrit-Reviewer: Alexander Thomas <at...@google.com>
        Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
        Gerrit-Reviewer: Commit Bot <commi...@chromium.org>
        Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
        Gerrit-Comment-Date: Mon, 07 Mar 2022 15:35:35 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Alexander Thomas <at...@google.com>
        Gerrit-MessageType: comment
        Reply all
        Reply to author
        Forward
        0 new messages