From 9814b569ba0299406ded6181102b37ad5fa74673 Mon Sep 17 00:00:00 2001 From: Aske Simon Christensen Date: Wed, 27 Jul 2022 22:47:30 +0000 Subject: [PATCH] [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 Reviewed-by: Joshua Litt Reviewed-by: William Hesse --- pkg/dart2wasm/bin/dart2wasm.dart | 6 -- pkg/dart2wasm/bin/run_wasm.js | 2 +- pkg/dart2wasm/dart2wasm.md | 4 +- pkg/dart2wasm/lib/code_generator.dart | 69 +++++++------------ pkg/dart2wasm/lib/constants.dart | 13 ++-- pkg/dart2wasm/lib/dispatch_table.dart | 2 +- pkg/dart2wasm/lib/functions.dart | 2 +- pkg/dart2wasm/lib/intrinsics.dart | 3 +- pkg/dart2wasm/lib/translator.dart | 14 +--- pkg/dart2wasm/lib/types.dart | 2 - .../lib/src/compiler_configuration.dart | 1 + pkg/wasm_builder/lib/src/instructions.dart | 44 +++++++++++- pkg/wasm_builder/lib/src/module.dart | 12 ++-- 13 files changed, 82 insertions(+), 92 deletions(-) diff --git a/pkg/dart2wasm/bin/dart2wasm.dart b/pkg/dart2wasm/bin/dart2wasm.dart index 7119b7f21f11..7ca63921775c 100644 --- a/pkg/dart2wasm/bin/dart2wasm.dart +++ b/pkg/dart2wasm/bin/dart2wasm.dart @@ -28,16 +28,10 @@ final List