From e3d27166370da202bef6c012014604beac41d43f Mon Sep 17 00:00:00 2001
From: Alon Zakai <azakai@google.com>
Date: Mon, 6 Nov 2023 12:29:19 -0800
Subject: Implement table.copy (#6078)

Helps #5951
---
 src/wasm/wasm-stack.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'src/wasm/wasm-stack.cpp')

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);
-- 
cgit v1.2.3