This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It turns out that source maps are supported for WebAssembly. Positions in the generated code are interpreted as * a single line, and * columns correspond to offsets in the `.wasm` file. We reuse the Scala.js facility to create source maps per se. We feed it the right data from the binary writer. To be consistent with how the Scala.js linker works when emitting JavaScript, we define a subclass of `WasmBinaryWriter` that handles source maps in addition of the regular output. In our model, we store positions as fake `WasmInstr` every time the position (potentially) changes. This is in contrast with the JavaScript backend, which stores a `pos` in every `js.Tree`. There are typically several Wasm instructions that encode any particular `ir.Trees.Tree` (and therefore correspond to one position), so this is probably a better trade-off.
- Loading branch information
Showing
11 changed files
with
338 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.