summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-06-17 07:51:11 -0700
committerGitHub <noreply@github.com>2021-06-17 07:51:11 -0700
commitc36c6fa9e42f4e917864312780ba95fb996eda79 (patch)
tree1e171bbd8b1a10f09ab14a59bc03b39bbe494c1e /src/wasm/wasm-stack.cpp
parent9d279c08b9f37b6cf2c5a5fac564eee9ea4fb927 (diff)
downloadbinaryen-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/wasm-stack.cpp')
-rw-r--r--src/wasm/wasm-stack.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 70a593bec..3200e77a7 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -1993,7 +1993,8 @@ void BinaryInstWriter::visitRttCanon(RttCanon* curr) {
}
void BinaryInstWriter::visitRttSub(RttSub* curr) {
- o << int8_t(BinaryConsts::GCPrefix) << U32LEB(BinaryConsts::RttSub);
+ o << int8_t(BinaryConsts::GCPrefix);
+ o << U32LEB(curr->fresh ? BinaryConsts::RttFreshSub : BinaryConsts::RttSub);
parent.writeIndexedHeapType(curr->type.getRtt().heapType);
}