diff options
author | Alon Zakai <azakai@google.com> | 2021-05-27 12:53:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 12:53:05 -0700 |
commit | 97f37aa13ce3ed318dc18980f03c41e7536624a5 (patch) | |
tree | e192a2c89442cdbae8f16f481c32434b00a376a7 /src/passes/Print.cpp | |
parent | 27a18f990e022cfe5b6a5485fd2eaca73b6dfbaa (diff) | |
download | binaryen-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/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 9f283ddcc..df408fdf3 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2005,6 +2005,17 @@ struct PrintExpressionContents printMedium(o, "array.len "); TypeNamePrinter(o, wasm).print(curr->ref->type.getHeapType()); } + void visitArrayCopy(ArrayCopy* curr) { + if (curr->srcRef->type == Type::unreachable || + curr->destRef->type == Type::unreachable) { + printUnreachableReplacement(); + return; + } + printMedium(o, "array.copy "); + TypeNamePrinter(o, wasm).print(curr->destRef->type.getHeapType()); + o << ' '; + TypeNamePrinter(o, wasm).print(curr->srcRef->type.getHeapType()); + } void visitRefAs(RefAs* curr) { switch (curr->op) { case RefAsNonNull: |