diff options
author | Alon Zakai <azakai@google.com> | 2021-06-17 07:51:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-17 07:51:11 -0700 |
commit | c36c6fa9e42f4e917864312780ba95fb996eda79 (patch) | |
tree | 1e171bbd8b1a10f09ab14a59bc03b39bbe494c1e /src/wasm-builder.h | |
parent | 9d279c08b9f37b6cf2c5a5fac564eee9ea4fb927 (diff) | |
download | binaryen-c36c6fa9e42f4e917864312780ba95fb996eda79.tar.gz binaryen-c36c6fa9e42f4e917864312780ba95fb996eda79.tar.bz2 binaryen-c36c6fa9e42f4e917864312780ba95fb996eda79.zip |
[Wasm GC] rtt.fresh_sub (#3936)
This is the same as rtt.sub, but creates a "new" rtt each time. See
https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit#
The old Literal implementation of rtts becomes a little more complex here,
as it was designed for the original spec where only structure matters. It may
be worth a complete redesign there, but for now as the spec is in flux I think
the approach here is good enough.
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r-- | src/wasm-builder.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h index a193dd8d5..79f3ec8df 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -795,6 +795,11 @@ public: ret->finalize(); return ret; } + RttSub* makeRttFreshSub(HeapType heapType, Expression* parent) { + auto* ret = makeRttSub(heapType, parent); + ret->fresh = true; + return ret; + } template<typename T> StructNew* makeStructNew(Expression* rtt, const T& args) { auto* ret = wasm.allocator.alloc<StructNew>(); |