From 7f668b63c358248e6bb64bf4d7f1b802a44fa5cf Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Wed, 24 Jan 2024 09:10:15 +0000 Subject: [PATCH] [dart2wasm] Introduce a --minify flag to dart2wasm that uses "minified:Class" for class names The `minified:...` encoding of class names mirrors the one used by dart2js. So the added test will work in both modes. This reduces optimized dart2wasm output * hello world by 20% * flute complex by 8.5% Change-Id: I080de40919ee3f25f0f0d8c9b82aa662f7e734aa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347741 Reviewed-by: Slava Egorov Commit-Queue: Martin Kustermann --- pkg/dart2wasm/lib/dart2wasm.dart | 2 ++ pkg/dart2wasm/lib/translator.dart | 1 + pkg/dart2wasm/lib/types.dart | 13 +++++---- sdk/lib/_internal/wasm/lib/type.dart | 4 +-- tests/web/wasm_js_shared/minify_test.dart | 33 +++++++++++++++++++++++ 5 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 tests/web/wasm_js_shared/minify_test.dart diff --git a/pkg/dart2wasm/lib/dart2wasm.dart b/pkg/dart2wasm/lib/dart2wasm.dart index 9bf0553eb3b..e1a2203086f 100644 --- a/pkg/dart2wasm/lib/dart2wasm.dart +++ b/pkg/dart2wasm/lib/dart2wasm.dart @@ -27,6 +27,8 @@ final List