summaryrefslogtreecommitdiff
path: root/src/wasm-builder.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-05-27 12:53:05 -0700
committerGitHub <noreply@github.com>2021-05-27 12:53:05 -0700
commit97f37aa13ce3ed318dc18980f03c41e7536624a5 (patch)
treee192a2c89442cdbae8f16f481c32434b00a376a7 /src/wasm-builder.h
parent27a18f990e022cfe5b6a5485fd2eaca73b6dfbaa (diff)
downloadbinaryen-97f37aa13ce3ed318dc18980f03c41e7536624a5.tar.gz
binaryen-97f37aa13ce3ed318dc18980f03c41e7536624a5.tar.bz2
binaryen-97f37aa13ce3ed318dc18980f03c41e7536624a5.zip
[Wasm GC] Add experimental array.copy (#3911)
Spec for it is here: https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit# Also reorder some things in wasm.h that were not in the canonical order (that has no effect, but it is confusing to read).
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r--src/wasm-builder.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index fabaac22a..a193dd8d5 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -854,6 +854,20 @@ public:
ret->finalize();
return ret;
}
+ ArrayCopy* makeArrayCopy(Expression* destRef,
+ Expression* destIndex,
+ Expression* srcRef,
+ Expression* srcIndex,
+ Expression* length) {
+ auto* ret = wasm.allocator.alloc<ArrayCopy>();
+ ret->destRef = destRef;
+ ret->destIndex = destIndex;
+ ret->srcRef = srcRef;
+ ret->srcIndex = srcIndex;
+ ret->length = length;
+ ret->finalize();
+ return ret;
+ }
RefAs* makeRefAs(RefAsOp op, Expression* value) {
auto* ret = wasm.allocator.alloc<RefAs>();
ret->op = op;