Skip to content

[CP] [dart2wasm] Pass source maps to wasm-opt when optimizing #56423

@osa1

Description

@osa1

Commit(s) to merge

1b1740e
075c443

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/379782

Issue Description

dart2wasm currently does not pass the generated source map to wasm-opt when optimizing with wasm-opt.

As a result the source map becomes invalid when the optimizations are enabled (i.e. always when -O0 is not used).

What is the fix

With this commit we pass the source map file to wasm-opt, which then updates it as it transforms the code.

Why cherry-pick

Source map support in dart2wasm was cherry-picked to stable in #56239, but they are useless when optimizations are enabled.

Risk

Assuming good test coverage of wasm-opt, I don't expect this change to break anything.

Issue link(s)

We don't have a GitHub issue for this issue.

Extra Info

No response

Metadata

Metadata

Labels

area-dart2wasmIssues for the dart2wasm compiler.cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-mergedCherry-pick has been merged to the stable or beta branch.cherry-pick-reviewIssue that need cherry pick triage to approve

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions