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

11 views
Skip to first unread message

Aske Simon Christensen (Gerrit)

unread,
Feb 3, 2022, 3:55:01 PM2/3/22
to rev...@dartlang.org

Attention is currently required from: Aske Simon Christensen.

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

View Change

[dart2wasm] Initial commit for the Dart-to-Wasm 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

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/collection_patch.dart
M sdk/lib/_internal/vm/lib/compact_hash.dart
M sdk/lib/_internal/vm/lib/hash_factories.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
70 files changed, 15,361 insertions(+), 73 deletions(-)

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: 64
Gerrit-Owner: Aske Simon Christensen <ask...@google.com>
Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
Gerrit-MessageType: newpatchset

Joshua Litt (Gerrit)

unread,
Feb 7, 2022, 11:21:52 AM2/7/22
to Aske Simon Christensen, rev...@dartlang.org, Commit Bot

Attention is currently required from: Aske Simon Christensen.

Patch set 64:Code-Review +1

View Change

1 comment:

  • Patchset:

    • Patch Set #64:

      I think this patch looks good(as of PS 64). I'm going to lgtm now, but please let me know if you'd like a final pass over any additional changes.

      Thanks!!!

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: 64
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: Mon, 07 Feb 2022 16:21:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Aske Simon Christensen (Gerrit)

unread,
Feb 10, 2022, 7:44:35 AM2/10/22
to rev...@dartlang.org

Attention is currently required from: Aske Simon Christensen.

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

View Change

[dart2wasm] Initial commit for the Dart-to-Wasm 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
M sdk/lib/_internal/vm/lib/compact_hash.dart
68 files changed, 15,800 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: 66
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

Dart CI (Gerrit)

unread,
Feb 10, 2022, 8:51:49 AM2/10/22
to Aske Simon Christensen, rev...@dartlang.org, Joshua Litt, Commit Bot

Attention is currently required from: Aske Simon Christensen.

go/dart-cbuild result: FAILURE (NO REGRESSIONS DETECTED)

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

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: 66
    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: Thu, 10 Feb 2022 13:51:45 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Aske Simon Christensen (Gerrit)

    unread,
    Feb 11, 2022, 10:45:08 AM2/11/22
    to rev...@dartlang.org, Dart CI, Joshua Litt, Commit Bot

    Patch set 67:Commit-Queue +1

    View Change

    4 comments:

    • Commit Message:

      • Patch Set #56:

        Consider adding brief class comments to every top level public class?

        Done

    • Patchset:

      • Patch Set #67:

        I think the documentation is now at a suitable level. PTAL.

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

      • Patch Set #56, Line 85: bool _debugTrace(List<Object>? trace,

        Consider a comment on the overall debug functionality?

        Put some comments in the public interface about this.

    • File sdk/lib/_internal/wasm/lib/internal_patch.dart:

      • Patch Set #62, Line 35: static void copy(List src, int srcStart, List dst, int dstStart, int count) {

        We spoke offline, but to summarize the use of dynamic here doesn't matter because all this code does […]

        The lists can't be typed with the same type variable, since they may be of different types.

        I have added a TODO about intrinsification.

    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: 67
    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: Fri, 11 Feb 2022 15:45:02 +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

    Dart CI (Gerrit)

    unread,
    Feb 11, 2022, 11:23:10 AM2/11/22
    to Aske Simon Christensen, rev...@dartlang.org, Joshua Litt, Commit Bot

    go/dart-cbuild result: SUCCESS

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

    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: 67
      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: Fri, 11 Feb 2022 16:23:06 +0000

      Joshua Litt (Gerrit)

      unread,
      Feb 11, 2022, 9:08:59 PM2/11/22
      to Aske Simon Christensen, rev...@dartlang.org, Dart CI, Commit Bot

      Attention is currently required from: Aske Simon Christensen.

      Patch set 67:Code-Review +1

      View Change

      23 comments:

      • Patchset:

        • Patch Set #67:

          A bunch of nits, definitely still looks good to me.

          A number of comments were added that read as questions. I tried to suggest some declarative alternatives. I can also suggest other alternatives if you want to replace the questions with declarative sentences but don't like my suggestions. Please feel free to leave the questions in place if you prefer that style of documentation.

          Thanks!

      • 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 else?

      • 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.

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

      • 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 instructions (provided asserts are enabled)'?

        • 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'?

        • 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'?

        • 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`'?

      • 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...'?

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

          'The *unpacked* form of this storage type...'?

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

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

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

          '...returns the size in bytes of a value of this type'?

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

          'True if this type is nullable.'?

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

          'True if this type is defaultable'?

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

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

        • 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'?

        • 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'?

      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: 67
      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: Sat, 12 Feb 2022 02:08:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment
      Reply all
      Reply to author
      Forward
      0 new messages