diff options
author | Thomas Lively <tlively@google.com> | 2024-02-09 15:42:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-09 15:42:43 -0800 |
commit | 7e20a3b1bdc1a3d26b13c2597d0286c79851e9ac (patch) | |
tree | 13fdf3350ee496ba9b944a457fa70a8900cf6eb3 | |
parent | 90087f0972aa34ee37860b70072cb8fc33c89ce3 (diff) | |
download | binaryen-7e20a3b1bdc1a3d26b13c2597d0286c79851e9ac.tar.gz binaryen-7e20a3b1bdc1a3d26b13c2597d0286c79851e9ac.tar.bz2 binaryen-7e20a3b1bdc1a3d26b13c2597d0286c79851e9ac.zip |
[Parser] Parse `resume` (#6295)
-rw-r--r-- | src/parser/contexts.h | 42 | ||||
-rw-r--r-- | src/parser/parsers.h | 20 | ||||
-rw-r--r-- | src/wasm-ir-builder.h | 8 | ||||
-rw-r--r-- | src/wasm/wasm-ir-builder.cpp | 38 | ||||
-rw-r--r-- | test/lit/wat-kitchen-sink.wast | 344 |
5 files changed, 299 insertions, 153 deletions
diff --git a/src/parser/contexts.h b/src/parser/contexts.h index 544851859..ab82f3963 100644 --- a/src/parser/contexts.h +++ b/src/parser/contexts.h @@ -310,6 +310,7 @@ struct NullInstrParserCtx { using ExprT = Ok; using CatchT = Ok; using CatchListT = Ok; + using TagLabelListT = Ok; using FieldIdxT = Ok; using FuncIdxT = Ok; @@ -386,6 +387,9 @@ struct NullInstrParserCtx { return Ok{}; } + TagLabelListT makeTagLabelList() { return Ok{}; } + void appendTagLabel(TagLabelListT&, TagIdxT, LabelIdxT) {} + Result<> makeUnreachable(Index) { return Ok{}; } Result<> makeNop(Index) { return Ok{}; } Result<> makeBinary(Index, BinaryOp) { return Ok{}; } @@ -566,6 +570,10 @@ struct NullInstrParserCtx { Result<> makeStringIterMove(Index, StringIterMoveOp) { return Ok{}; } Result<> makeStringSliceWTF(Index, StringSliceWTFOp) { return Ok{}; } Result<> makeStringSliceIter(Index) { return Ok{}; } + template<typename HeapTypeT> + Result<> makeResume(Index, HeapTypeT, const TagLabelListT&) { + return Ok{}; + } }; struct NullCtx : NullTypeParserCtx, NullInstrParserCtx { @@ -1069,13 +1077,6 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> { using TableTypeT = Ok; using TypeUseT = HeapType; - using ExprT = Expression*; - using ElemListT = std::vector<Expression*>; - - struct CatchInfo; - using CatchT = CatchInfo; - using CatchListT = std::vector<CatchInfo>; - using FieldIdxT = Index; using FuncIdxT = Name; using LocalIdxT = Index; @@ -1089,6 +1090,15 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> { using MemargT = Memarg; + using ExprT = Expression*; + using ElemListT = std::vector<Expression*>; + + struct CatchInfo; + using CatchT = CatchInfo; + using CatchListT = std::vector<CatchInfo>; + + using TagLabelListT = std::vector<std::pair<TagIdxT, LabelIdxT>>; + ParseInput in; Module& wasm; @@ -1179,6 +1189,11 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> { CatchInfo makeCatchAll(Index label) { return {{}, label, false}; } CatchInfo makeCatchAllRef(Index label) { return {{}, label, true}; } + TagLabelListT makeTagLabelList() { return {}; } + void appendTagLabel(TagLabelListT& tagLabels, Name tag, Index label) { + tagLabels.push_back({tag, label}); + } + Result<HeapTypeT> getHeapTypeFromIdx(Index idx) { if (idx >= types.size()) { return in.err("type index out of bounds"); @@ -1994,6 +2009,19 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> { Result<> makeStringSliceIter(Index pos) { return withLoc(pos, irBuilder.makeStringSliceIter()); } + + Result<> + makeResume(Index pos, HeapType type, const TagLabelListT& tagLabels) { + std::vector<Name> tags; + std::vector<Index> labels; + tags.reserve(tagLabels.size()); + labels.reserve(tagLabels.size()); + for (auto& [tag, label] : tagLabels) { + tags.push_back(tag); + labels.push_back(label); + } + return withLoc(pos, irBuilder.makeResume(type, tags, labels)); + } }; } // namespace wasm::WATParser diff --git a/src/parser/parsers.h b/src/parser/parsers.h index db4c716f1..960ccb26d 100644 --- a/src/parser/parsers.h +++ b/src/parser/parsers.h @@ -1228,7 +1228,7 @@ template<typename Ctx> MaybeResult<typename Ctx::CatchT> catchinstr(Ctx& ctx) { return result; } -// trytable ::= 'try_table' label blocktype catchinstr* instr* end id? +// trytable ::= 'try_table' label blocktype catchinstr* instr* 'end' id? // | '(' 'try_table' label blocktype catchinstr* instr* ')' template<typename Ctx> MaybeResult<> trytable(Ctx& ctx, bool folded) { auto pos = ctx.in.getPos(); @@ -1992,8 +1992,24 @@ template<typename Ctx> Result<> makeStringSliceIter(Ctx& ctx, Index pos) { return ctx.makeStringSliceIter(pos); } +// resume ::= 'resume' typeidx ('(' 'tag' tagidx labelidx ')')* template<typename Ctx> Result<> makeResume(Ctx& ctx, Index pos) { - return ctx.in.err("unimplemented instruction"); + auto type = typeidx(ctx); + CHECK_ERR(type); + + auto tagLabels = ctx.makeTagLabelList(); + while (ctx.in.takeSExprStart("tag"sv)) { + auto tag = tagidx(ctx); + CHECK_ERR(tag); + auto label = labelidx(ctx); + CHECK_ERR(label); + ctx.appendTagLabel(tagLabels, *tag, *label); + if (!ctx.in.takeRParen()) { + return ctx.in.err("expected ')' at end of handler clause"); + } + } + + return ctx.makeResume(pos, *type, tagLabels); } // ======= diff --git a/src/wasm-ir-builder.h b/src/wasm-ir-builder.h index d32dfebf2..66dfd6dbe 100644 --- a/src/wasm-ir-builder.h +++ b/src/wasm-ir-builder.h @@ -65,11 +65,11 @@ public: [[nodiscard]] Result<> visitElse(); [[nodiscard]] Result<> visitLoopStart(Loop* iff); [[nodiscard]] Result<> visitTryStart(Try* tryy, Name label = {}); - [[nodiscard]] Result<> visitTryTableStart(TryTable* trytable, - Name label = {}); [[nodiscard]] Result<> visitCatch(Name tag); [[nodiscard]] Result<> visitCatchAll(); [[nodiscard]] Result<> visitDelegate(Index label); + [[nodiscard]] Result<> visitTryTableStart(TryTable* trytable, + Name label = {}); [[nodiscard]] Result<> visitEnd(); // Binaryen IR uses names to refer to branch targets, but in general there may @@ -206,6 +206,9 @@ public: [[nodiscard]] Result<> makeStringIterMove(StringIterMoveOp op); [[nodiscard]] Result<> makeStringSliceWTF(StringSliceWTFOp op); [[nodiscard]] Result<> makeStringSliceIter(); + [[nodiscard]] Result<> makeResume(HeapType ct, + const std::vector<Name>& tags, + const std::vector<Index>& labels); // Private functions that must be public for technical reasons. [[nodiscard]] Result<> visitExpression(Expression*); @@ -228,6 +231,7 @@ public: [[nodiscard]] Result<> visitThrow(Throw*); [[nodiscard]] Result<> visitStringNew(StringNew*); [[nodiscard]] Result<> visitStringEncode(StringEncode*); + [[nodiscard]] Result<> visitResume(Resume*); [[nodiscard]] Result<> visitTupleMake(TupleMake*); [[nodiscard]] Result<> visitTupleExtract(TupleExtract*, diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp index dadda0f25..bd3a3ad11 100644 --- a/src/wasm/wasm-ir-builder.cpp +++ b/src/wasm/wasm-ir-builder.cpp @@ -576,6 +576,22 @@ Result<> IRBuilder::visitStringEncode(StringEncode* curr) { WASM_UNREACHABLE("unexpected op"); } +Result<> IRBuilder::visitResume(Resume* curr) { + auto cont = pop(); + CHECK_ERR(cont); + curr->cont = *cont; + + auto sig = curr->contType.getContinuation().type.getSignature(); + auto size = sig.params.size(); + curr->operands.resize(size); + for (size_t i = 0; i < size; ++i) { + auto val = pop(); + CHECK_ERR(val); + curr->operands[size - i - 1] = *val; + } + return Ok{}; +} + Result<> IRBuilder::visitTupleMake(TupleMake* curr) { assert(curr->operands.size() >= 2); for (size_t i = 0, size = curr->operands.size(); i < size; ++i) { @@ -1767,4 +1783,26 @@ Result<> IRBuilder::makeStringSliceIter() { return Ok{}; } +Result<> IRBuilder::makeResume(HeapType ct, + const std::vector<Name>& tags, + const std::vector<Index>& labels) { + if (!ct.isContinuation()) { + return Err{"expected continuation type"}; + } + Resume curr(wasm.allocator); + curr.contType = ct; + CHECK_ERR(visitResume(&curr)); + + std::vector<Name> labelNames; + labelNames.reserve(labels.size()); + for (auto label : labels) { + auto name = getLabelName(label); + CHECK_ERR(name); + labelNames.push_back(*name); + } + std::vector<Expression*> operands(curr.operands.begin(), curr.operands.end()); + push(builder.makeResume(ct, tags, labelNames, operands, curr.cont)); + return Ok{}; +} + } // namespace wasm diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast index 3d12d5d71..770c08665 100644 --- a/test/lit/wat-kitchen-sink.wast +++ b/test/lit/wat-kitchen-sink.wast @@ -46,139 +46,149 @@ ;; CHECK: (type $a0 (array i32)) - ;; CHECK: (type $17 (func (result exnref))) + ;; CHECK: (type $simple (func (param i32 i64) (result f32))) - ;; CHECK: (type $18 (func (result i64))) + ;; CHECK: (type $simple-cont (cont $simple)) - ;; CHECK: (type $19 (func (result i64 f32))) + ;; CHECK: (type $19 (func (param i32 i64) (result i32 i64))) - ;; CHECK: (type $20 (func (param i32 i32 i32))) + ;; CHECK: (type $20 (func (result exnref))) - ;; CHECK: (type $21 (func (param v128 i32) (result v128))) + ;; CHECK: (type $21 (func (result i64))) + + ;; CHECK: (type $22 (func (result i64 f32))) + + ;; CHECK: (type $23 (func (param i32 i32 i32))) + + ;; CHECK: (type $24 (func (param v128 i32) (result v128))) ;; CHECK: (type $packed-i16 (array (mut i16))) ;; CHECK: (type $any-array (array (mut anyref))) - ;; CHECK: (type $24 (func (param stringref))) + ;; CHECK: (type $27 (func (param stringref))) + + ;; CHECK: (type $28 (func (param stringref stringref) (result i32))) - ;; CHECK: (type $25 (func (param stringref stringref) (result i32))) + ;; CHECK: (type $29 (func (param i64 v128) (result v128))) - ;; CHECK: (type $26 (func (param i32 i64) (result f32))) + ;; CHECK: (type $30 (func (param i64 v128))) - ;; CHECK: (type $27 (func (param i64 v128) (result v128))) + ;; CHECK: (type $31 (func (result i32 i64 (ref null $simple-cont)))) - ;; CHECK: (type $28 (func (param i64 v128))) + ;; CHECK: (type $32 (func (param i32 i32))) - ;; CHECK: (type $29 (func (param i32 i32))) + ;; CHECK: (type $33 (func (param exnref))) - ;; CHECK: (type $30 (func (param exnref))) + ;; CHECK: (type $34 (func (param i32 i32 f64 f64))) - ;; CHECK: (type $31 (func (param i32 i32 f64 f64))) + ;; CHECK: (type $35 (func (param i64))) - ;; CHECK: (type $32 (func (param i64))) + ;; CHECK: (type $36 (func (param v128) (result i32))) - ;; CHECK: (type $33 (func (param v128) (result i32))) + ;; CHECK: (type $37 (func (param v128 v128) (result v128))) - ;; CHECK: (type $34 (func (param v128 v128) (result v128))) + ;; CHECK: (type $38 (func (param v128 v128 v128) (result v128))) - ;; CHECK: (type $35 (func (param v128 v128 v128) (result v128))) + ;; CHECK: (type $39 (func (param i32 i32 i64 i64))) - ;; CHECK: (type $36 (func (param i32 i32 i64 i64))) + ;; CHECK: (type $40 (func (param i32) (result i32))) - ;; CHECK: (type $37 (func (param i32) (result i32))) + ;; CHECK: (type $41 (func (param i64) (result i32 i64))) - ;; CHECK: (type $38 (func (param i32 i64) (result i32 i64))) + ;; CHECK: (type $42 (func (param i32) (result i32 i64))) - ;; CHECK: (type $39 (func (param i64) (result i32 i64))) + ;; CHECK: (type $43 (func (param anyref) (result i32))) - ;; CHECK: (type $40 (func (param i32) (result i32 i64))) + ;; CHECK: (type $44 (func (param eqref eqref) (result i32))) - ;; CHECK: (type $41 (func (param anyref) (result i32))) + ;; CHECK: (type $45 (func (param i32) (result i31ref))) - ;; CHECK: (type $42 (func (param eqref eqref) (result i32))) + ;; CHECK: (type $46 (func (param i31ref))) - ;; CHECK: (type $43 (func (param i32) (result i31ref))) + ;; CHECK: (type $47 (func (param i32 i64) (result (ref $pair)))) - ;; CHECK: (type $44 (func (param i31ref))) + ;; CHECK: (type $48 (func (result (ref $pair)))) - ;; CHECK: (type $45 (func (param i32 i64) (result (ref $pair)))) + ;; CHECK: (type $49 (func (param (ref $pair)) (result i32))) - ;; CHECK: (type $46 (func (result (ref $pair)))) + ;; CHECK: (type $50 (func (param (ref $pair)) (result i64))) - ;; CHECK: (type $47 (func (param (ref $pair)) (result i32))) + ;; CHECK: (type $51 (func (param (ref null $pair)) (result i32))) - ;; CHECK: (type $48 (func (param (ref $pair)) (result i64))) + ;; CHECK: (type $52 (func (param (ref $pair) i32))) - ;; CHECK: (type $49 (func (param (ref null $pair)) (result i32))) + ;; CHECK: (type $53 (func (param (ref $pair) i64))) - ;; CHECK: (type $50 (func (param (ref $pair) i32))) + ;; CHECK: (type $54 (func (param (ref null $pair) i64))) - ;; CHECK: (type $51 (func (param (ref $pair) i64))) + ;; CHECK: (type $55 (func (param i64 i32) (result (ref $a1)))) - ;; CHECK: (type $52 (func (param (ref null $pair) i64))) + ;; CHECK: (type $56 (func (param i32) (result (ref $a1)))) - ;; CHECK: (type $53 (func (param i64 i32) (result (ref $a1)))) + ;; CHECK: (type $57 (func (param i32 i32) (result (ref $a1)))) - ;; CHECK: (type $54 (func (param i32) (result (ref $a1)))) + ;; CHECK: (type $58 (func (param (ref $a1) i32) (result i64))) - ;; CHECK: (type $55 (func (param i32 i32) (result (ref $a1)))) + ;; CHECK: (type $59 (func (param (ref $packed-i8) i32) (result i32))) - ;; CHECK: (type $56 (func (param (ref $a1) i32) (result i64))) + ;; CHECK: (type $60 (func (param (ref $packed-i16) i32) (result i32))) - ;; CHECK: (type $57 (func (param (ref $packed-i8) i32) (result i32))) + ;; CHECK: (type $61 (func (param (ref $a2) i32 f32))) - ;; CHECK: (type $58 (func (param (ref $packed-i16) i32) (result i32))) + ;; CHECK: (type $62 (func (param arrayref) (result i32))) - ;; CHECK: (type $59 (func (param (ref $a2) i32 f32))) + ;; CHECK: (type $63 (func (param (ref $a2) i32 (ref $a2) i32 i32))) - ;; CHECK: (type $60 (func (param arrayref) (result i32))) + ;; CHECK: (type $64 (func (param (ref $a2) i32 f32 i32))) - ;; CHECK: (type $61 (func (param (ref $a2) i32 (ref $a2) i32 i32))) + ;; CHECK: (type $65 (func (param (ref $a2) i32 i32 i32))) - ;; CHECK: (type $62 (func (param (ref $a2) i32 f32 i32))) + ;; CHECK: (type $66 (func (param (ref $any-array) i32 i32 i32))) - ;; CHECK: (type $63 (func (param (ref $a2) i32 i32 i32))) + ;; CHECK: (type $67 (func (param externref))) - ;; CHECK: (type $64 (func (param (ref $any-array) i32 i32 i32))) + ;; CHECK: (type $68 (func (param i32 i32) (result stringref))) - ;; CHECK: (type $65 (func (param externref))) + ;; CHECK: (type $69 (func (param (ref $packed-i8) i32 i32) (result stringref))) - ;; CHECK: (type $66 (func (param i32 i32) (result stringref))) + ;; CHECK: (type $70 (func (param i32) (result stringref))) - ;; CHECK: (type $67 (func (param (ref $packed-i8) i32 i32) (result stringref))) + ;; CHECK: (type $71 (func (result (ref string)))) - ;; CHECK: (type $68 (func (param i32) (result stringref))) + ;; CHECK: (type $72 (func (param stringref) (result i32))) - ;; CHECK: (type $69 (func (result (ref string)))) + ;; CHECK: (type $73 (func (param stringview_wtf16) (result i32))) - ;; CHECK: (type $70 (func (param stringref) (result i32))) + ;; CHECK: (type $74 (func (param stringref (ref $packed-i8) i32) (result i32))) - ;; CHECK: (type $71 (func (param stringview_wtf16) (result i32))) + ;; CHECK: (type $75 (func (param stringref stringref) (result (ref string)))) - ;; CHECK: (type $72 (func (param stringref (ref $packed-i8) i32) (result i32))) + ;; CHECK: (type $76 (func (param stringref) (result stringview_wtf8))) - ;; CHECK: (type $73 (func (param stringref stringref) (result (ref string)))) + ;; CHECK: (type $77 (func (param stringref) (result (ref stringview_wtf16)))) - ;; CHECK: (type $74 (func (param stringref) (result stringview_wtf8))) + ;; CHECK: (type $78 (func (param stringref) (result stringview_iter))) - ;; CHECK: (type $75 (func (param stringref) (result (ref stringview_wtf16)))) + ;; CHECK: (type $79 (func (param (ref stringview_wtf8) i32 i32) (result i32))) - ;; CHECK: (type $76 (func (param stringref) (result stringview_iter))) + ;; CHECK: (type $80 (func (param stringview_wtf16 i32) (result i32))) - ;; CHECK: (type $77 (func (param (ref stringview_wtf8) i32 i32) (result i32))) + ;; CHECK: (type $81 (func (param stringview_iter) (result i32))) - ;; CHECK: (type $78 (func (param stringview_wtf16 i32) (result i32))) + ;; CHECK: (type $82 (func (param stringview_iter i32) (result i32))) - ;; CHECK: (type $79 (func (param stringview_iter) (result i32))) + ;; CHECK: (type $83 (func (param (ref stringview_iter) i32) (result i32))) - ;; CHECK: (type $80 (func (param stringview_iter i32) (result i32))) + ;; CHECK: (type $84 (func (param stringview_wtf8 stringview_wtf16 i32 i32))) - ;; CHECK: (type $81 (func (param (ref stringview_iter) i32) (result i32))) + ;; CHECK: (type $85 (func (param stringview_iter i32) (result (ref string)))) - ;; CHECK: (type $82 (func (param stringview_wtf8 stringview_wtf16 i32 i32))) + ;; CHECK: (type $86 (func (param (ref $simple-cont)))) - ;; CHECK: (type $83 (func (param stringview_iter i32) (result (ref string)))) + ;; CHECK: (type $to-f32 (func (result f32))) + + ;; CHECK: (type $to-f32-cont (cont $to-f32)) ;; CHECK: (type $s2 (struct (field i32))) (type $s2 (struct i32)) @@ -216,12 +226,18 @@ ;; CHECK: (type $subvoid (sub final $void (func))) (type $subvoid (sub final $void (func))) + (type $simple (func (param $x i32) (param $y i64) (result f32))) + (type $to-f32 (func (result f32))) + (type $many (sub (func (param $x i32) (param i64 f32) (param) (param $y f64) (result anyref (ref func))))) ;; CHECK: (type $submany (sub final $many (func (param i32 i64 f32 f64) (result anyref (ref func))))) (type $submany (sub final $many (func (param i32 i64 f32 f64) (result anyref (ref func))))) + (type $simple-cont (cont $simple)) + (type $to-f32-cont (cont $to-f32)) + ;; CHECK: (type $all-types (struct (field externref) (field (ref extern)) (field funcref) (field (ref func)) (field anyref) (field (ref any)) (field eqref) (field (ref eq)) (field i31ref) (field (ref i31)) (field structref) (field (ref struct)) (field arrayref) (field (ref array)) (field exnref) (field (ref exn)) (field stringref) (field (ref string)) (field stringview_wtf8) (field (ref stringview_wtf8)) (field stringview_wtf16) (field (ref stringview_wtf16)) (field stringview_iter) (field (ref stringview_iter)) (field nullref) (field (ref none)) (field nullexternref) (field (ref noextern)) (field nullfuncref) (field (ref nofunc)) (field nullexnref) (field (ref noexn)))) (type $all-types (struct externref (ref extern) funcref (ref func) @@ -242,7 +258,7 @@ ;; imported memories (memory (export "mem") (export "mem2") (import "" "mem") 0) - ;; CHECK: (type $95 (func (param (ref $s0) (ref $s1) (ref $s2) (ref $s3) (ref $s4) (ref $s5) (ref $s6) (ref $s7) (ref $s8) (ref $a0) (ref $a1) (ref $a2) (ref $a3) (ref $subvoid) (ref $submany) (ref $all-types)))) + ;; CHECK: (type $100 (func (param (ref $s0) (ref $s1) (ref $s2) (ref $s3) (ref $s4) (ref $s5) (ref $s6) (ref $s7) (ref $s8) (ref $a0) (ref $a1) (ref $a2) (ref $a3) (ref $subvoid) (ref $submany) (ref $all-types)))) ;; CHECK: (import "" "mem" (memory $mimport$0 0)) @@ -403,6 +419,9 @@ ;; CHECK: (tag $tag-pair (param i32 i64)) (tag $tag-pair (param i32 i64)) + ;; CHECK: (tag $tag-pair-to-pair (param i32 i64) (result i32 i64)) + (tag $tag-pair-to-pair (param i32 i64) (result i32 i64)) + ;; explicit exports (export "exported-func" (func 0)) ;; CHECK: (export "mem" (memory $mimport$0)) @@ -901,7 +920,7 @@ drop ) - ;; CHECK: (func $locals (type $29) (param $0 i32) (param $x i32) + ;; CHECK: (func $locals (type $32) (param $0 i32) (param $x i32) ;; CHECK-NEXT: (local $2 i32) ;; CHECK-NEXT: (local $y i32) ;; CHECK-NEXT: (drop @@ -2454,7 +2473,7 @@ end ) - ;; CHECK: (func $try-table-catch-ref (type $17) (result exnref) + ;; CHECK: (func $try-table-catch-ref (type $20) (result exnref) ;; CHECK-NEXT: (block $label (result exnref) ;; CHECK-NEXT: (try_table (result exnref) (catch_ref $empty $label) ;; CHECK-NEXT: (unreachable) @@ -2480,7 +2499,7 @@ end ) - ;; CHECK: (func $try-table-catch-all-ref (type $17) (result exnref) + ;; CHECK: (func $try-table-catch-all-ref (type $20) (result exnref) ;; CHECK-NEXT: (block $label (result exnref) ;; CHECK-NEXT: (try_table (result exnref) (catch_all_ref $label) ;; CHECK-NEXT: (unreachable) @@ -2554,7 +2573,7 @@ ) ) - ;; CHECK: (func $try-table-throw-ref (type $30) (param $0 exnref) + ;; CHECK: (func $try-table-throw-ref (type $33) (param $0 exnref) ;; CHECK-NEXT: (throw_ref ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2786,7 +2805,7 @@ br_if 0 ) - ;; CHECK: (func $br_if-value (type $18) (result i64) + ;; CHECK: (func $br_if-value (type $21) (result i64) ;; CHECK-NEXT: (block $l (result i64) ;; CHECK-NEXT: (br_if $l ;; CHECK-NEXT: (i64.const 0) @@ -2802,8 +2821,8 @@ end ) - ;; CHECK: (func $br_if-multivalue (type $19) (result i64 f32) - ;; CHECK-NEXT: (block $l (type $19) (result i64 f32) + ;; CHECK: (func $br_if-multivalue (type $22) (result i64 f32) + ;; CHECK-NEXT: (block $l (type $22) (result i64 f32) ;; CHECK-NEXT: (br_if $l ;; CHECK-NEXT: (tuple.make 2 ;; CHECK-NEXT: (i64.const 0) @@ -2822,7 +2841,7 @@ end ) - ;; CHECK: (func $br_if-loop (type $18) (result i64) + ;; CHECK: (func $br_if-loop (type $21) (result i64) ;; CHECK-NEXT: (local $scratch i64) ;; CHECK-NEXT: (loop $l (result i64) ;; CHECK-NEXT: (local.set $scratch @@ -2972,7 +2991,7 @@ end ) - ;; CHECK: (func $binary (type $31) (param $0 i32) (param $1 i32) (param $2 f64) (param $3 f64) + ;; CHECK: (func $binary (type $34) (param $0 i32) (param $1 i32) (param $2 f64) (param $3 f64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $0) @@ -2997,7 +3016,7 @@ drop ) - ;; CHECK: (func $unary (type $32) (param $0 i64) + ;; CHECK: (func $unary (type $35) (param $0 i64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i64.eqz ;; CHECK-NEXT: (local.get $0) @@ -3010,7 +3029,7 @@ drop ) - ;; CHECK: (func $select (type $20) (param $0 i32) (param $1 i32) (param $2 i32) + ;; CHECK: (func $select (type $23) (param $0 i32) (param $1 i32) (param $2 i32) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (select ;; CHECK-NEXT: (local.get $0) @@ -3346,7 +3365,7 @@ drop ) - ;; CHECK: (func $simd-extract (type $33) (param $0 v128) (result i32) + ;; CHECK: (func $simd-extract (type $36) (param $0 v128) (result i32) ;; CHECK-NEXT: (i32x4.extract_lane 3 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -3356,7 +3375,7 @@ i32x4.extract_lane 3 ) - ;; CHECK: (func $simd-replace (type $21) (param $0 v128) (param $1 i32) (result v128) + ;; CHECK: (func $simd-replace (type $24) (param $0 v128) (param $1 i32) (result v128) ;; CHECK-NEXT: (i32x4.replace_lane 2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -3368,7 +3387,7 @@ i32x4.replace_lane 2 ) - ;; CHECK: (func $simd-shuffle (type $34) (param $0 v128) (param $1 v128) (result v128) + ;; CHECK: (func $simd-shuffle (type $37) (param $0 v128) (param $1 v128) (result v128) ;; CHECK-NEXT: (i8x16.shuffle 0 1 2 3 4 5 6 7 16 17 18 19 20 21 22 23 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -3380,7 +3399,7 @@ i8x16.shuffle 0 1 2 3 4 5 6 7 16 17 18 19 20 21 22 23 ) - ;; CHECK: (func $simd-ternary (type $35) (param $0 v128) (param $1 v128) (param $2 v128) (result v128) + ;; CHECK: (func $simd-ternary (type $38) (param $0 v128) (param $1 v128) (param $2 v128) (result v128) ;; CHECK-NEXT: (v128.bitselect ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -3394,7 +3413,7 @@ v128.bitselect ) - ;; CHECK: (func $simd-shift (type $21) (param $0 v128) (param $1 i32) (result v128) + ;; CHECK: (func $simd-shift (type $24) (param $0 v128) (param $1 i32) (result v128) ;; CHECK-NEXT: (i8x16.shl ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -3449,7 +3468,7 @@ v128.store64_lane 5 align=4 0 ) - ;; CHECK: (func $memory-init (type $20) (param $0 i32) (param $1 i32) (param $2 i32) + ;; CHECK: (func $memory-init (type $23) (param $0 i32) (param $1 i32) (param $2 i32) ;; CHECK-NEXT: (memory.init $mem-i32 $passive ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -3490,7 +3509,7 @@ data.drop $passive ) - ;; CHECK: (func $memory-copy (type $36) (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i64) + ;; CHECK: (func $memory-copy (type $39) (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i64) ;; CHECK-NEXT: (memory.copy $mimport$0 $mimport$0 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -3561,7 +3580,7 @@ return ) - ;; CHECK: (func $return-one (type $37) (param $0 i32) (result i32) + ;; CHECK: (func $return-one (type $40) (param $0 i32) (result i32) ;; CHECK-NEXT: (return ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -3571,7 +3590,7 @@ return ) - ;; CHECK: (func $return-two (type $38) (param $0 i32) (param $1 i64) (result i32 i64) + ;; CHECK: (func $return-two (type $19) (param $0 i32) (param $1 i64) (result i32 i64) ;; CHECK-NEXT: (return ;; CHECK-NEXT: (tuple.make 2 ;; CHECK-NEXT: (local.get $0) @@ -3585,7 +3604,7 @@ return ) - ;; CHECK: (func $return-two-first-unreachable (type $39) (param $0 i64) (result i32 i64) + ;; CHECK: (func $return-two-first-unreachable (type $41) (param $0 i64) (result i32 i64) ;; CHECK-NEXT: (return ;; CHECK-NEXT: (tuple.make 2 ;; CHECK-NEXT: (unreachable) @@ -3599,7 +3618,7 @@ return ) - ;; CHECK: (func $return-two-second-unreachable (type $40) (param $0 i32) (result i32 i64) + ;; CHECK: (func $return-two-second-unreachable (type $42) (param $0 i32) (result i32 i64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -3616,7 +3635,7 @@ return ) - ;; CHECK: (func $ref-is-null (type $41) (param $0 anyref) (result i32) + ;; CHECK: (func $ref-is-null (type $43) (param $0 anyref) (result i32) ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -3660,7 +3679,7 @@ throw $tag-pair ) - ;; CHECK: (func $ref-eq (type $42) (param $0 eqref) (param $1 eqref) (result i32) + ;; CHECK: (func $ref-eq (type $44) (param $0 eqref) (param $1 eqref) (result i32) ;; CHECK-NEXT: (ref.eq ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -3837,7 +3856,7 @@ table.copy 2 $funcs ) - ;; CHECK: (func $i31-new (type $43) (param $0 i32) (result i31ref) + ;; CHECK: (func $i31-new (type $45) (param $0 i32) (result i31ref) ;; CHECK-NEXT: (ref.i31 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -3847,7 +3866,7 @@ ref.i31 ) - ;; CHECK: (func $i31-get (type $44) (param $0 i31ref) + ;; CHECK: (func $i31-get (type $46) (param $0 i31ref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i31.get_s ;; CHECK-NEXT: (local.get $0) @@ -4066,7 +4085,7 @@ drop ) - ;; CHECK: (func $struct-new (type $45) (param $0 i32) (param $1 i64) (result (ref $pair)) + ;; CHECK: (func $struct-new (type $47) (param $0 i32) (param $1 i64) (result (ref $pair)) ;; CHECK-NEXT: (struct.new $pair ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4078,14 +4097,14 @@ struct.new $pair ) - ;; CHECK: (func $struct-new-default (type $46) (result (ref $pair)) + ;; CHECK: (func $struct-new-default (type $48) (result (ref $pair)) ;; CHECK-NEXT: (struct.new_default $pair) ;; CHECK-NEXT: ) (func $struct-new-default (result (ref $pair)) struct.new_default 14 ) - ;; CHECK: (func $struct-get-0 (type $47) (param $0 (ref $pair)) (result i32) + ;; CHECK: (func $struct-get-0 (type $49) (param $0 (ref $pair)) (result i32) ;; CHECK-NEXT: (struct.get $pair $first ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4095,7 +4114,7 @@ struct.get 14 0 ) - ;; CHECK: (func $struct-get-1 (type $48) (param $0 (ref $pair)) (result i64) + ;; CHECK: (func $struct-get-1 (type $50) (param $0 (ref $pair)) (result i64) ;; CHECK-NEXT: (struct.get $pair $second ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4105,7 +4124,7 @@ struct.get $pair 1 ) - ;; CHECK: (func $struct-get-named (type $49) (param $0 (ref null $pair)) (result i32) + ;; CHECK: (func $struct-get-named (type $51) (param $0 (ref null $pair)) (result i32) ;; CHECK-NEXT: (struct.get $pair $first ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4115,7 +4134,7 @@ struct.get $pair $first ) - ;; CHECK: (func $struct-set-0 (type $50) (param $0 (ref $pair)) (param $1 i32) + ;; CHECK: (func $struct-set-0 (type $52) (param $0 (ref $pair)) (param $1 i32) ;; CHECK-NEXT: (struct.set $pair $first ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4127,7 +4146,7 @@ struct.set $pair 0 ) - ;; CHECK: (func $struct-set-1 (type $51) (param $0 (ref $pair)) (param $1 i64) + ;; CHECK: (func $struct-set-1 (type $53) (param $0 (ref $pair)) (param $1 i64) ;; CHECK-NEXT: (struct.set $pair $second ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4139,7 +4158,7 @@ struct.set 14 1 ) - ;; CHECK: (func $struct-set-named (type $52) (param $0 (ref null $pair)) (param $1 i64) + ;; CHECK: (func $struct-set-named (type $54) (param $0 (ref null $pair)) (param $1 i64) ;; CHECK-NEXT: (struct.set $pair $second ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4151,7 +4170,7 @@ struct.set 14 $second ) - ;; CHECK: (func $array-new (type $53) (param $0 i64) (param $1 i32) (result (ref $a1)) + ;; CHECK: (func $array-new (type $55) (param $0 i64) (param $1 i32) (result (ref $a1)) ;; CHECK-NEXT: (array.new $a1 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4163,7 +4182,7 @@ array.new $a1 ) - ;; CHECK: (func $array-new-default (type $54) (param $0 i32) (result (ref $a1)) + ;; CHECK: (func $array-new-default (type $56) (param $0 i32) (result (ref $a1)) ;; CHECK-NEXT: (array.new_default $a1 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4173,7 +4192,7 @@ array.new_default 11 ) - ;; CHECK: (func $array-new-data (type $55) (param $0 i32) (param $1 i32) (result (ref $a1)) + ;; CHECK: (func $array-new-data (type $57) (param $0 i32) (param $1 i32) (result (ref $a1)) ;; CHECK-NEXT: (array.new_data $a1 $implicit-data ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4207,7 +4226,7 @@ drop ) - ;; CHECK: (func $array-get (type $56) (param $0 (ref $a1)) (param $1 i32) (result i64) + ;; CHECK: (func $array-get (type $58) (param $0 (ref $a1)) (param $1 i32) (result i64) ;; CHECK-NEXT: (array.get $a1 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4219,7 +4238,7 @@ array.get $a1 ) - ;; CHECK: (func $array-get-s (type $57) (param $0 (ref $packed-i8)) (param $1 i32) (result i32) + ;; CHECK: (func $array-get-s (type $59) (param $0 (ref $packed-i8)) (param $1 i32) (result i32) ;; CHECK-NEXT: (array.get_s $packed-i8 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4231,7 +4250,7 @@ array.get_s 15 ) - ;; CHECK: (func $array-get-u (type $58) (param $0 (ref $packed-i16)) (param $1 i32) (result i32) + ;; CHECK: (func $array-get-u (type $60) (param $0 (ref $packed-i16)) (param $1 i32) (result i32) ;; CHECK-NEXT: (array.get_u $packed-i16 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4243,7 +4262,7 @@ array.get_u $packed-i16 ) - ;; CHECK: (func $array-set (type $59) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) + ;; CHECK: (func $array-set (type $61) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) ;; CHECK-NEXT: (array.set $a2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4257,7 +4276,7 @@ array.set $a2 ) - ;; CHECK: (func $array-len (type $60) (param $0 arrayref) (result i32) + ;; CHECK: (func $array-len (type $62) (param $0 arrayref) (result i32) ;; CHECK-NEXT: (array.len ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4267,7 +4286,7 @@ array.len ) - ;; CHECK: (func $array-copy (type $61) (param $0 (ref $a2)) (param $1 i32) (param $2 (ref $a2)) (param $3 i32) (param $4 i32) + ;; CHECK: (func $array-copy (type $63) (param $0 (ref $a2)) (param $1 i32) (param $2 (ref $a2)) (param $3 i32) (param $4 i32) ;; CHECK-NEXT: (array.copy $a2 $a2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4285,7 +4304,7 @@ array.copy $a2 $a2 ) - ;; CHECK: (func $array-fill (type $62) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) (param $3 i32) + ;; CHECK: (func $array-fill (type $64) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) (param $3 i32) ;; CHECK-NEXT: (array.fill $a2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4301,7 +4320,7 @@ array.fill $a2 ) - ;; CHECK: (func $array-init-data (type $63) (param $0 (ref $a2)) (param $1 i32) (param $2 i32) (param $3 i32) + ;; CHECK: (func $array-init-data (type $65) (param $0 (ref $a2)) (param $1 i32) (param $2 i32) (param $3 i32) ;; CHECK-NEXT: (array.init_data $a2 $implicit-data ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4317,7 +4336,7 @@ array.init_data $a2 0 ) - ;; CHECK: (func $array-init-elem (type $64) (param $0 (ref $any-array)) (param $1 i32) (param $2 i32) (param $3 i32) + ;; CHECK: (func $array-init-elem (type $66) (param $0 (ref $any-array)) (param $1 i32) (param $2 i32) (param $3 i32) ;; CHECK-NEXT: (array.init_elem $any-array $passive-2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4346,7 +4365,7 @@ drop ) - ;; CHECK: (func $any-convert-extern (type $65) (param $0 externref) + ;; CHECK: (func $any-convert-extern (type $67) (param $0 externref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (extern.internalize ;; CHECK-NEXT: (local.get $0) @@ -4372,7 +4391,7 @@ drop ) - ;; CHECK: (func $string-new (type $66) (param $0 i32) (param $1 i32) (result stringref) + ;; CHECK: (func $string-new (type $68) (param $0 i32) (param $1 i32) (result stringref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (string.new_utf8_try ;; CHECK-NEXT: (local.get $0) @@ -4414,7 +4433,7 @@ string.new_wtf16 ) - ;; CHECK: (func $string-new-gc (type $67) (param $0 (ref $packed-i8)) (param $1 i32) (param $2 i32) (result stringref) + ;; CHECK: (func $string-new-gc (type $69) (param $0 (ref $packed-i8)) (param $1 i32) (param $2 i32) (result stringref) ;; CHECK-NEXT: (string.new_utf8_array ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4428,7 +4447,7 @@ string.new_utf8_array ) - ;; CHECK: (func $string-new-code-point (type $68) (param $0 i32) (result stringref) + ;; CHECK: (func $string-new-code-point (type $70) (param $0 i32) (result stringref) ;; CHECK-NEXT: (string.from_code_point ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4438,7 +4457,7 @@ string.from_code_point ) - ;; CHECK: (func $string-const (type $69) (result (ref string)) + ;; CHECK: (func $string-const (type $71) (result (ref string)) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (string.const "foobar") ;; CHECK-NEXT: ) @@ -4450,7 +4469,7 @@ string.const "\00\00\00" ) - ;; CHECK: (func $string-measure (type $24) (param $0 stringref) + ;; CHECK: (func $string-measure (type $27) (param $0 stringref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (string.measure_wtf8 ;; CHECK-NEXT: (local.get $0) @@ -4487,7 +4506,7 @@ drop ) - ;; CHECK: (func $string-hash (type $70) (param $0 stringref) (result i32) + ;; CHECK: (func $string-hash (type $72) (param $0 stringref) (result i32) ;; CHECK-NEXT: (string.hash ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4497,7 +4516,7 @@ string.hash ) - ;; CHECK: (func $stringview-length (type $71) (param $0 stringview_wtf16) (result i32) + ;; CHECK: (func $stringview-length (type $73) (param $0 stringview_wtf16) (result i32) ;; CHECK-NEXT: (stringview_wtf16.length ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4507,7 +4526,7 @@ stringview_wtf16.length ) - ;; CHECK: (func $string-encode (type $24) (param $0 stringref) + ;; CHECK: (func $string-encode (type $27) (param $0 stringref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (string.encode_wtf8 ;; CHECK-NEXT: (local.get $0) @@ -4552,7 +4571,7 @@ drop ) - ;; CHECK: (func $string-encode-gc (type $72) (param $0 stringref) (param $1 (ref $packed-i8)) (param $2 i32) (result i32) + ;; CHECK: (func $string-encode-gc (type $74) (param $0 stringref) (param $1 (ref $packed-i8)) (param $2 i32) (result i32) ;; CHECK-NEXT: (string.encode_wtf8_array ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4566,7 +4585,7 @@ string.encode_wtf8_array ) - ;; CHECK: (func $string-concat (type $73) (param $0 stringref) (param $1 stringref) (result (ref string)) + ;; CHECK: (func $string-concat (type $75) (param $0 stringref) (param $1 stringref) (result (ref string)) ;; CHECK-NEXT: (string.concat ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4578,7 +4597,7 @@ string.concat ) - ;; CHECK: (func $string-eq (type $25) (param $0 stringref) (param $1 stringref) (result i32) + ;; CHECK: (func $string-eq (type $28) (param $0 stringref) (param $1 stringref) (result i32) ;; CHECK-NEXT: (string.eq ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4590,7 +4609,7 @@ string.eq ) - ;; CHECK: (func $string-compare (type $25) (param $0 stringref) (param $1 stringref) (result i32) + ;; CHECK: (func $string-compare (type $28) (param $0 stringref) (param $1 stringref) (result i32) ;; CHECK-NEXT: (string.compare ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4602,7 +4621,7 @@ string.compare ) - ;; CHECK: (func $string-as-wtf8 (type $74) (param $0 stringref) (result stringview_wtf8) + ;; CHECK: (func $string-as-wtf8 (type $76) (param $0 stringref) (result stringview_wtf8) ;; CHECK-NEXT: (string.as_wtf8 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4612,7 +4631,7 @@ string.as_wtf8 ) - ;; CHECK: (func $string-as-wtf16 (type $75) (param $0 stringref) (result (ref stringview_wtf16)) + ;; CHECK: (func $string-as-wtf16 (type $77) (param $0 stringref) (result (ref stringview_wtf16)) ;; CHECK-NEXT: (string.as_wtf16 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4622,7 +4641,7 @@ string.as_wtf16 ) - ;; CHECK: (func $string-as-iter (type $76) (param $0 stringref) (result stringview_iter) + ;; CHECK: (func $string-as-iter (type $78) (param $0 stringref) (result stringview_iter) ;; CHECK-NEXT: (string.as_iter ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4632,7 +4651,7 @@ string.as_iter ) - ;; CHECK: (func $string-advance (type $77) (param $0 (ref stringview_wtf8)) (param $1 i32) (param $2 i32) (result i32) + ;; CHECK: (func $string-advance (type $79) (param $0 (ref stringview_wtf8)) (param $1 i32) (param $2 i32) (result i32) ;; CHECK-NEXT: (stringview_wtf8.advance ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4646,7 +4665,7 @@ stringview_wtf8.advance ) - ;; CHECK: (func $string-get (type $78) (param $0 stringview_wtf16) (param $1 i32) (result i32) + ;; CHECK: (func $string-get (type $80) (param $0 stringview_wtf16) (param $1 i32) (result i32) ;; CHECK-NEXT: (stringview_wtf16.get_codeunit ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4658,7 +4677,7 @@ stringview_wtf16.get_codeunit ) - ;; CHECK: (func $string-iter-next (type $79) (param $0 stringview_iter) (result i32) + ;; CHECK: (func $string-iter-next (type $81) (param $0 stringview_iter) (result i32) ;; CHECK-NEXT: (stringview_iter.next ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -4668,7 +4687,7 @@ stringview_iter.next ) - ;; CHECK: (func $string-iter-advance (type $80) (param $0 stringview_iter) (param $1 i32) (result i32) + ;; CHECK: (func $string-iter-advance (type $82) (param $0 stringview_iter) (param $1 i32) (result i32) ;; CHECK-NEXT: (stringview_iter.advance ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4680,7 +4699,7 @@ stringview_iter.advance ) - ;; CHECK: (func $string-iter-rewind (type $81) (param $0 (ref stringview_iter)) (param $1 i32) (result i32) + ;; CHECK: (func $string-iter-rewind (type $83) (param $0 (ref stringview_iter)) (param $1 i32) (result i32) ;; CHECK-NEXT: (stringview_iter.rewind ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4692,7 +4711,7 @@ stringview_iter.rewind ) - ;; CHECK: (func $string-slice (type $82) (param $0 stringview_wtf8) (param $1 stringview_wtf16) (param $2 i32) (param $3 i32) + ;; CHECK: (func $string-slice (type $84) (param $0 stringview_wtf8) (param $1 stringview_wtf16) (param $2 i32) (param $3 i32) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (stringview_wtf8.slice ;; CHECK-NEXT: (local.get $0) @@ -4721,7 +4740,7 @@ drop ) - ;; CHECK: (func $string-iter-slice (type $83) (param $0 stringview_iter) (param $1 i32) (result (ref string)) + ;; CHECK: (func $string-iter-slice (type $85) (param $0 stringview_iter) (param $1 i32) (result (ref string)) ;; CHECK-NEXT: (stringview_iter.slice ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4733,7 +4752,7 @@ stringview_iter.slice ) - ;; CHECK: (func $call (type $26) (param $0 i32) (param $1 i64) (result f32) + ;; CHECK: (func $call (type $simple) (param $0 i32) (param $1 i64) (result f32) ;; CHECK-NEXT: (call $call ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4745,7 +4764,7 @@ call $call ) - ;; CHECK: (func $return_call (type $26) (param $0 i32) (param $1 i64) (result f32) + ;; CHECK: (func $return_call (type $simple) (param $0 i32) (param $1 i64) (result f32) ;; CHECK-NEXT: (return_call $return_call ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -4786,7 +4805,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call_indirect $timport$0 (type $27) + ;; CHECK-NEXT: (call_indirect $timport$0 (type $29) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $0) @@ -4848,7 +4867,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call_indirect $timport$0 (type $27) + ;; CHECK-NEXT: (call_indirect $timport$0 (type $29) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $0) @@ -4920,7 +4939,7 @@ ;; CHECK-NEXT: (return_call_indirect $funcs (type $void) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return_call_indirect $timport$0 (type $28) + ;; CHECK-NEXT: (return_call_indirect $timport$0 (type $30) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $0) @@ -4979,7 +4998,7 @@ ;; CHECK-NEXT: (return_call_indirect $funcs (type $void) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return_call_indirect $timport$0 (type $28) + ;; CHECK-NEXT: (return_call_indirect $timport$0 (type $30) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $0) @@ -5020,7 +5039,48 @@ ) ) - ;; CHECK: (func $use-types (type $95) (param $0 (ref $s0)) (param $1 (ref $s1)) (param $2 (ref $s2)) (param $3 (ref $s3)) (param $4 (ref $s4)) (param $5 (ref $s5)) (param $6 (ref $s6)) (param $7 (ref $s7)) (param $8 (ref $s8)) (param $9 (ref $a0)) (param $10 (ref $a1)) (param $11 (ref $a2)) (param $12 (ref $a3)) (param $13 (ref $subvoid)) (param $14 (ref $submany)) (param $15 (ref $all-types)) + ;; CHECK: (func $resume (type $86) (param $ct (ref $simple-cont)) + ;; CHECK-NEXT: (local $f f32) + ;; CHECK-NEXT: (block $label_1 + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block $label (result (ref $to-f32-cont)) + ;; CHECK-NEXT: (tuple.drop 3 + ;; CHECK-NEXT: (block $label_0 (type $31) (result i32 i64 (ref null $simple-cont)) + ;; CHECK-NEXT: (local.set $f + ;; CHECK-NEXT: (resume $simple-cont (tag $empty $label) (tag $tag-pair-to-pair $label_0) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i64.const 1) + ;; CHECK-NEXT: (local.get $ct) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label_1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $resume (param $ct (ref $simple-cont)) + (local $f f32) + block (result (ref $to-f32-cont)) + block (result i32 i64 (ref null $simple-cont)) + i32.const 0 + i64.const 1 + local.get $ct + resume $simple-cont (tag $empty 1) (tag $tag-pair-to-pair 0) + local.set $f + unreachable + end + unreachable + end + br 0 + ) + + ;; CHECK: (func $use-types (type $100) (param $0 (ref $s0)) (param $1 (ref $s1)) (param $2 (ref $s2)) (param $3 (ref $s3)) (param $4 (ref $s4)) (param $5 (ref $s5)) (param $6 (ref $s6)) (param $7 (ref $s7)) (param $8 (ref $s8)) (param $9 (ref $a0)) (param $10 (ref $a1)) (param $11 (ref $a2)) (param $12 (ref $a3)) (param $13 (ref $subvoid)) (param $14 (ref $submany)) (param $15 (ref $all-types)) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $use-types |