From b7b1d0df29df14634d2c680d1d2c351b624b4fbb Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 19 May 2023 13:47:32 -0500 Subject: Update br_on_cast binary and text format (#5734) The final versions of the br_on_cast and br_on_cast_fail instructions have two reference type annotations: one for the input type and one for the cast target type. In the binary format, this is represented as a flags byte followed by two encoded heap types. Since these instructions have been in flux for a while, do not attempt to maintain backward compatibility with older versions of the instructions. Instead, upgrade all of the tests at once to use the new versions of the instructions. Drop some binary tests of deprecated instruction encodings that would be more effort to update than they're worth. --- src/passes/Print.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/passes/Print.cpp') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 0d74d43f1..4bcc042a1 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2172,10 +2172,9 @@ struct PrintExpressionContents printMedium(o, "br_on_cast "); printName(curr->name, o); o << ' '; - if (curr->castType.isNullable()) { - printMedium(o, "null "); - } - printHeapType(o, curr->castType.getHeapType(), wasm); + printType(o, curr->ref->type, wasm); + o << ' '; + printType(o, curr->castType, wasm); return; case BrOnCastFail: // TODO: These instructions are deprecated, so stop emitting them. @@ -2197,10 +2196,9 @@ struct PrintExpressionContents printMedium(o, "br_on_cast_fail "); printName(curr->name, o); o << ' '; - if (curr->castType.isNullable()) { - printMedium(o, "null "); - } - printHeapType(o, curr->castType.getHeapType(), wasm); + printType(o, curr->ref->type, wasm); + o << ' '; + printType(o, curr->castType, wasm); return; } WASM_UNREACHABLE("Unexpected br_on* op"); -- cgit v1.2.3