Skip to content

Commit

Permalink
[dart2wasm] Make dart compile wasm accept --enable-experiment flags…
Browse files Browse the repository at this point in the history
… and pass those to compiler

This is a preparation for making CI bot to run using `dart compile wasm`
instead of `pkg/dart2wasm/tool/compile_benchmark`.

Change-Id: I804d9392a8993cddc7a01afdd345ba9ee9a83374
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366820
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
  • Loading branch information
mkustermann authored and Commit Queue committed May 17, 2024
1 parent c03aa10 commit 3b02e41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/dartdev/lib/src/commands/compile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,8 @@ class CompileWasmCommand extends CompileSubcommandCommand {
help: defineOption.help,
abbr: defineOption.abbr,
valueHelp: defineOption.valueHelp,
);
)
..addExperimentalFlags(verbose: verbose);
}

@override
Expand Down Expand Up @@ -771,6 +772,7 @@ class CompileWasmCommand extends CompileSubcommandCommand {
handleOverride(optimizationFlags, 'minify',
args.wasParsed('minify') ? null : args.flag('minify'));

final enabledExperiments = args.enabledExperiments;
final dart2wasmCommand = [
sdk.dartAotRuntime,
sdk.dart2wasmSnapshot,
Expand All @@ -786,6 +788,7 @@ class CompileWasmCommand extends CompileSubcommandCommand {
'--import-shared-memory',
'--shared-memory-max-pages=$maxPages',
],
...enabledExperiments.map((e) => '--enable-experiment=$e'),

// First we pass flags based on the optimization level.
...optimizationFlags,
Expand Down

0 comments on commit 3b02e41

Please sign in to comment.