Repository navigation
Merge upstream - #158
Merge upstream#158tlively wants to merge 3220 commits into
Conversation
Merge both the move from wasm-3.0 to a temporary directory and the move of wasm-3.0 to wasm-latest, preserving git history in both directories.
In the upstream spec repo, the contents of wasm-latest must always be the same as the highest numbered wasm-X.Y spec directory. Add a CI script to enforce this.
It was previously numbered 6.3, incorrectly conflicting with 6.3-text.instructions.spectec.
This will reduce the number of changes necessary when we cut new releases in the future.
This reverts commit f38a520.
… (#2248) Co-authored-by: Zongyuan Liu <liuzongyuan0505@gmail.com>
…-10-23 # Conflicts: # .github/workflows/ci-interpreter.yml # README.md # interpreter/binary/decode.ml # interpreter/binary/encode.ml # interpreter/exec/eval.ml # interpreter/exec/eval.mli # interpreter/runtime/global.ml # interpreter/runtime/table.ml # interpreter/script/js.ml # interpreter/script/run.ml # interpreter/syntax/ast.ml # interpreter/syntax/free.ml # interpreter/syntax/types.ml # interpreter/text/arrange.ml # interpreter/text/parser.mly # interpreter/valid/match.ml # interpreter/valid/match.mli # interpreter/valid/valid.ml # test/core/exceptions/tag.wast # test/core/run.py
|
Another attempt to merge upstream. If this looks good, we should not land it via the "Squash and merge" button. I will instead push the branch directly to main to preserve the merge history. Here's the diff from upstream: https://gist.github.com/tlively/0d99efd46212cfef34acf74a0885bf66 Here's the Here's a report on how semantic and concrete merge conflicts were resolved: Upstream Merge Report (
|
| File | Resolution Summary |
|---|---|
.github/workflows/ci-interpreter.yml |
Kept push triggers on main alongside pull_request and workflow_dispatch; took upstream CI build steps. |
README.md |
Preserved the Stack Switching proposal note at the top of README.md with upstream's updated links. |
ast.ml |
Preserved type hdl = OnLabel of labelidx | OnSwitch and stack-switching instructions (ContNew, ContBind, Suspend, Resume, ResumeThrow, Switch) updated to use typeidx / tagidx. |
decode.ml & encode.ml |
Integrated ContHT (-0x18), NoContHT (-0x0b), ContT (-0x23), on_clause, and opcodes 0xe0..0xe6 using typeuse and idx, and removed the duplicate tag section encoder. |
arrange.ml & parser.mly |
Updated cont composite type printing/parsing and stack-switching instruction rules (cont.new, cont.bind, suspend, resume, resume_throw, switch, on clauses) to typeuse and idx. |
match.ml & match.mli |
Added ContT, ContHT, and NoContHT to extrema (abs_of_comptype, top_of_heaptype, bot_of_heaptype), subtyping (match_heaptype, match_comptype), and GLB (both_heaptype), and exported match_functype. |
run.py |
Combined upstream's memory64_test_files, exception_test_files, and bulk_memory_test_files with stack_switching_test_files. |
rossberg
left a comment
There was a problem hiding this comment.
From my (slightly superficial) passes over the various diffs, this looks plausible.
The main thing I noticed that wasn't adjusted adequately is the treatment of suspensions at the evaluator/embedder boundary. We'll want the same change that happened upstream for exceptions wrt to exposing them as legal results instead of unconditional errors, since there might well be embedders that can handle them, unlike control-challenged JS. But we can fix that later.
A few nits below. I also noticed various formatting issues or spurious formatting changes that were already in the code, so can also be cleaned up separately.
| (x, OnLabel y) | ||
| | 0x01 -> | ||
| let x = at var s in | ||
| let x = at idx s in | ||
| (x, OnSwitch) | ||
| | _ -> error s (pos s) "ON opcode expected" |
There was a problem hiding this comment.
| | _ -> error s (pos s) "ON opcode expected" | |
| | _ -> error s (pos s) "malformed handler clause" |
There was a problem hiding this comment.
These (the extra cases for legacy exceptions below, which somehow the suggestions can't span over) are obsolete now.
| | (0x16 | 0x17 | 0x18 | 0x19) as b -> illegal s pos b |
| (* TODO(dhil): This might need to change again in the future as a | ||
| different proposal might claim this opcode! GC proposal claimed | ||
| the previous opcode we were using. *) |
There was a problem hiding this comment.
I think we can drop this TODO at this point.
| (* TODO(dhil): This might need to change again in the future as a | |
| different proposal might claim this opcode! GC proposal claimed | |
| the previous opcode we were using. *) |
| | Trap (at, msg) -> error at "runtime trap" msg | ||
| | Crash (at, msg) -> error at "runtime crash" msg | ||
| | Exception (at, msg) -> error at "uncaught exception" msg | ||
| | Suspension (at, msg) -> error at "suspension error" msg |
There was a problem hiding this comment.
| | Suspension (at, msg) -> error at "suspension error" msg | |
| | Suspension (at, msg) -> error at "unhandled suspension" msg |
| | ResumeThrowRef of typeidx * (tagidx * hdl) list (* abort continuation *) | ||
| | Switch of typeidx * tagidx (* direct switch continuation *) | ||
| | Throw of tagidx (* throw exception *) | ||
| | ThrowRef (* rethrow exception *) |
There was a problem hiding this comment.
| | ThrowRef (* rethrow exception *) | |
| | ThrowRef (* rethrow exception *) |
No description provided.