summaryrefslogtreecommitdiff
path: root/src/ir/module-utils.cpp
diff options
context:
space:
mode:
authorFrank Emrich <git@emrich.io>2024-02-22 20:07:07 +0000
committerGitHub <noreply@github.com>2024-02-22 12:07:07 -0800
commite2420f0d5d82982cd94a6400da812cf7c9818d97 (patch)
tree4b8dfc0edfd268fe308d2bf97603ca239b7768aa /src/ir/module-utils.cpp
parent2ceff4d2b3f0e3cc1565adc57e537ee3475b0da9 (diff)
downloadbinaryen-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/module-utils.cpp')
-rw-r--r--src/ir/module-utils.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ir/module-utils.cpp b/src/ir/module-utils.cpp
index 304ddb04d..b61fddd8b 100644
--- a/src/ir/module-utils.cpp
+++ b/src/ir/module-utils.cpp
@@ -341,6 +341,8 @@ struct CodeScanner
counts.include(get->type);
} else if (auto* set = curr->dynCast<ArraySet>()) {
counts.note(set->ref->type);
+ } else if (auto* contNew = curr->dynCast<ContNew>()) {
+ counts.note(contNew->contType);
} else if (auto* resume = curr->dynCast<Resume>()) {
counts.note(resume->contType);
} else if (Properties::isControlFlowStructure(curr)) {