diff options
author | Frank Emrich <git@emrich.io> | 2024-02-22 20:07:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-22 12:07:07 -0800 |
commit | e2420f0d5d82982cd94a6400da812cf7c9818d97 (patch) | |
tree | 4b8dfc0edfd268fe308d2bf97603ca239b7768aa /src/ir/effects.h | |
parent | 2ceff4d2b3f0e3cc1565adc57e537ee3475b0da9 (diff) | |
download | binaryen-e2420f0d5d82982cd94a6400da812cf7c9818d97.tar.gz binaryen-e2420f0d5d82982cd94a6400da812cf7c9818d97.tar.bz2 binaryen-e2420f0d5d82982cd94a6400da812cf7c9818d97.zip |
Typed continuations: cont.new instructions (#6308)
This PR is part of a series that adds basic support for the [typed
continuations/wasmfx proposal](https://github.com/wasmfx/specfx).
This particular PR adds support for the `cont.new` instruction for creating
continuations, documented [here(https://github.com/wasmfx/specfx/blob/main/proposals/continuations/Overview.md#instructions).
In short, these instructions are of the form `(cont.new $ct)` where `$ct` must
be a continuation type. The instruction takes a single (nullable) function
reference as its argument, which means that the folded representation of the
instruction is of the form `(cont.new $ct (foo ...))`.
Support for the instruction is implemented in both the old and the new wat
parser.
Note that this PR does not implement validation of the new instruction.
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r-- | src/ir/effects.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index 3ff320a88..d0af932bd 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -974,6 +974,10 @@ private: parent.implicitTrap = true; } + void visitContNew(ContNew* curr) { + // traps when curr->func is null ref. + parent.implicitTrap = true; + } void visitResume(Resume* curr) { // This acts as a kitchen sink effect. parent.calls = true; |