[dart2wasm] Use the vm's mixin deduplication pass in dart2wasm

It reduces FluteCounter
* 2.5% in unoptimized mode
* 0.8% in optimzed mode (and similar when gzip'ed)

Change-Id: If4852d66e8c214754f68e4d134960e8b622d20fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354023
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Martin Kustermann 2024-02-26 11:24:51 +00:00 committed by Commit Queue
parent c625797f8a
commit c05738f04f

View file

@ -28,6 +28,8 @@ import 'package:vm/kernel_front_end.dart' show writeDepfile;
import 'package:vm/transformations/type_flow/transformer.dart' as globalTypeFlow
show transformComponent;
import 'package:vm/transformations/mixin_deduplication.dart'
as mixin_deduplication show transformComponent;
import 'package:dart2wasm/compiler_options.dart' as compiler;
import 'package:dart2wasm/js/runtime_generator.dart' as js;
@ -123,6 +125,8 @@ Future<CompilerOutput?> compileToModule(compiler.WasmCompilerOptions options,
writeComponentToText(component, path: options.dumpKernelBeforeTfa!);
}
mixin_deduplication.transformComponent(component);
globalTypeFlow.transformComponent(target, coreTypes, component,
treeShakeSignatures: true,
treeShakeWriteOnlyFields: true,