summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-11-06 12:29:19 -0800
committerGitHub <noreply@github.com>2023-11-06 12:29:19 -0800
commite3d27166370da202bef6c012014604beac41d43f (patch)
treef9e0515c0c6044e6c9b12f6d5d83f8ba99ab0fc3 /src/wasm/wasm-stack.cpp
parent4fba26a77ea344b8d2b49cc8e1afdc8fcda13e96 (diff)
downloadbinaryen-e3d27166370da202bef6c012014604beac41d43f.tar.gz
binaryen-e3d27166370da202bef6c012014604beac41d43f.tar.bz2
binaryen-e3d27166370da202bef6c012014604beac41d43f.zip
Implement table.copy (#6078)
Helps #5951
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r--src/wasm/wasm-stack.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 1d2363be3..0f8facfd5 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -1941,6 +1941,12 @@ void BinaryInstWriter::visitTableFill(TableFill* curr) {
o << U32LEB(parent.getTableIndex(curr->table));
}
+void BinaryInstWriter::visitTableCopy(TableCopy* curr) {
+ o << int8_t(BinaryConsts::MiscPrefix) << U32LEB(BinaryConsts::TableCopy);
+ o << U32LEB(parent.getTableIndex(curr->destTable));
+ o << U32LEB(parent.getTableIndex(curr->sourceTable));
+}
+
void BinaryInstWriter::visitTry(Try* curr) {
breakStack.push_back(curr->name);
o << int8_t(BinaryConsts::Try);