summaryrefslogtreecommitdiff
path: root/test/lit/source-map.wast
Commit message (Collapse)AuthorAgeFilesLines
* Use IRBuilder in the binary parser (#6963)Thomas Lively2024-11-261-6/+3
| | | | | | | | | | | | | | | | | | | | | | IRBuilder is a utility for turning arbitrary valid streams of Wasm instructions into valid Binaryen IR. It is already used in the text parser, so now use it in the binary parser as well. Since the IRBuilder API for building each intruction requires only the information that the binary and text formats include as immediates to that instruction, the parser is now much simpler than before. In particular, it does not need to manage a stack of instructions to figure out what the children of each expression should be; IRBuilder handles this instead. There are some differences between the IR constructed by IRBuilder and the IR the binary parser constructed before this change. Most importantly, IRBuilder generates better multivalue code because it avoids eagerly breaking up multivalue results into individual components that might need to be immediately reassembled into a tuple. It also parses try-delegate more correctly, allowing the delegate to target arbitrary labels, not just other `try`s. There are also a couple superficial differences in the generated label and scratch local names. As part of this change, add support for recording binary source locations in IRBuilder.
* Source Maps: Support 5 segment mappings (#6795)Ömer Sinan Ağacan2024-10-011-0/+17
| | | | | | | Support 5-segment source mappings, which add a name. Reference: https://github.com/tc39/source-map/blob/main/source-map-rev3.md#proposed-format
* Debug location parser: accept arbitrary paths (#6594)Jérôme Vouillon2024-05-151-2/+24
| | | | | The whole annotation was parsed as a keyword, which prevented file paths with non-ascii characters or paths starting with `/` or `.`. Also, there was a typo: one was comparing `fileSize` rather than `lineSize` to `contents->npos`.
* [StackIR] Support source maps and DWARF with StackIR (#6564)Alon Zakai2024-05-011-39/+45
| | | | | | | | | | | | | | Helping #6509, this fixes debugging support for StackIR, which makes it more possible to use StackIR in more places. The fix is basically just to pass around some more state, and then to call the parent with "please write debug info" at the correct times, mirroring the similar calls in BinaryenIRWriter. The relevant Emscripten tests pass, and the source map test modified here produces identical output in StackIR and non-StackIR modes (the test is also simplified to remove --new-wat-parser which is no longer needed, after which the test can clearly show that StackIR has the same output as BinaryenIR).
* Source maps: Fix missing debug info in nested blocks (#6525)Jérôme Vouillon2024-04-241-0/+24
| | | The special block nesting logic also needs to handle emitting debug info.
* [Parser] Support prologue and epilogue sourcemap annotations (#6370)Thomas Lively2024-03-041-1/+11
| | | | | | | and fix a bug with sourcemap annotations on folded `if` conditions. Update IRBuilder to apply prologue and epilogue source locations when beginning and ending a function scope. Add basic support in the parser for explicitly tracking annotations on module fields, although only do anything with them in the case of prologue source location annotations.
* Require `then` and `else` with `if` (#6201)Thomas Lively2024-01-041-3/+7
| | | | | | | | | | | | We previously supported (and primarily used) a non-standard text format for conditionals in which the condition, if-true expression, and if-false expression were all simply s-expression children of the `if` expression. The standard text format, however, requires the use of `then` and `else` forms to introduce the if-true and if-false arms of the conditional. Update the legacy text parser to require the standard format and update all tests to match. Update the printer to print the standard format as well. The .wast and .wat test inputs were mechanically updated with this script: https://gist.github.com/tlively/85ae7f01f92f772241ec994c840ccbb1
* Emit source map information for control flow structures (#5524)Alon Zakai2023-02-281-1/+2
| | | | | With this, the sourcemap testcase outputs the exact same thing as the input. Followup to #5504
* Fix sourcemap nesting in reading and writing (#5504)JesseCodeBones2023-02-241-0/+46
The stack logic was incorrect, and led to source locations being emitted on parents instead of children.