diff options
author | Frank Emrich <git@emrich.io> | 2024-01-11 21:22:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-11 13:22:43 -0800 |
commit | b4dee3dc05834ada8bf94e3e925186bc8b430c30 (patch) | |
tree | 19d3150e7438803274c1dfc03be56dff83309fe7 /src/ir/effects.h | |
parent | e5948a939eb6610f1cb7742df8c54f6d17389b83 (diff) | |
download | binaryen-b4dee3dc05834ada8bf94e3e925186bc8b430c30.tar.gz binaryen-b4dee3dc05834ada8bf94e3e925186bc8b430c30.tar.bz2 binaryen-b4dee3dc05834ada8bf94e3e925186bc8b430c30.zip |
Typed continuations: resume instructions (#6083)
This PR is part of a series that adds basic support for the [typed continuations proposal](https://github.com/wasmfx/specfx).
This particular PR adds support for the `resume` instruction. The most notable missing feature is validation, which is not implemented, yet.
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r-- | src/ir/effects.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index 1156cd823..3ff320a88 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -973,6 +973,19 @@ private: // traps when ref is null. parent.implicitTrap = true; } + + void visitResume(Resume* curr) { + // This acts as a kitchen sink effect. + parent.calls = true; + + // resume instructions accept nullable continuation references and trap + // on null. + parent.implicitTrap = true; + + if (parent.features.hasExceptionHandling() && parent.tryDepth == 0) { + parent.throws_ = true; + } + } }; public: |