diff options
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/OptimizeInstructions.cpp | 5 | ||||
-rw-r--r-- | src/passes/Precompute.cpp | 1 | ||||
-rw-r--r-- | src/passes/Print.cpp | 11 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index 310924327..d3c3f26f6 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -1064,6 +1064,11 @@ struct OptimizeInstructions void visitArrayLen(ArrayLen* curr) { skipNonNullCast(curr->ref); } + void visitArrayCopy(ArrayCopy* curr) { + skipNonNullCast(curr->destRef); + skipNonNullCast(curr->srcRef); + } + void visitRefCast(RefCast* curr) { if (curr->type == Type::unreachable) { return; diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp index 3e2e7a64f..a832c9e85 100644 --- a/src/passes/Precompute.cpp +++ b/src/passes/Precompute.cpp @@ -96,6 +96,7 @@ public: Flow visitArrayNew(ArrayNew* curr) { return Flow(NONCONSTANT_FLOW); } Flow visitArrayGet(ArrayGet* curr) { return Flow(NONCONSTANT_FLOW); } Flow visitArrayLen(ArrayLen* curr) { return Flow(NONCONSTANT_FLOW); } + Flow visitArrayCopy(ArrayCopy* curr) { return Flow(NONCONSTANT_FLOW); } }; struct Precompute 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: |