From 97f37aa13ce3ed318dc18980f03c41e7536624a5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 27 May 2021 12:53:05 -0700 Subject: [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). --- src/passes/Print.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/passes/Print.cpp') 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: -- cgit v1.2.3