diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 18 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 12 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 18 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 12 | ||||
-rw-r--r-- | test/example/stack-utils.cpp | 38 | ||||
-rw-r--r-- | test/example/type-builder-nominal.cpp | 42 | ||||
-rw-r--r-- | test/example/type-builder.cpp | 100 | ||||
-rw-r--r-- | test/example/typeinfo.cpp | 10 | ||||
-rw-r--r-- | test/example/typeinfo.txt | 8 | ||||
-rw-r--r-- | test/gtest/possible-contents.cpp | 10 | ||||
-rw-r--r-- | test/gtest/type-builder.cpp | 13 | ||||
-rw-r--r-- | test/lit/fuzz-types/isorecursive.test | 34 | ||||
-rw-r--r-- | test/lit/fuzz-types/nominal.test | 26 | ||||
-rw-r--r-- | test/lit/fuzz-types/structural.test | 26 | ||||
-rw-r--r-- | test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast | 18 | ||||
-rw-r--r-- | test/lit/strings.wast | 10 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz_all-features_metrics_noprint.txt | 50 |
17 files changed, 205 insertions, 240 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index ecfc73bff..6e5e19b2c 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -68,24 +68,6 @@ function test_types() { console.log(" // BinaryenTypeVec128: " + binaryen.v128); console.log(" //", binaryen.expandType(binaryen.v128).join(",")); - console.log(" // BinaryenTypeFuncref: " + binaryen.funcref); - console.log(" //", binaryen.expandType(binaryen.funcref).join(",")); - - console.log(" // BinaryenTypeExternref: " + binaryen.externref); - console.log(" //", binaryen.expandType(binaryen.externref).join(",")); - - console.log(" // BinaryenTypeAnyref: " + binaryen.anyref); - console.log(" //", binaryen.expandType(binaryen.anyref).join(",")); - - console.log(" // BinaryenTypeEqref: " + binaryen.eqref); - console.log(" //", binaryen.expandType(binaryen.eqref).join(",")); - - console.log(" // BinaryenTypeI31ref: " + binaryen.i31ref); - console.log(" //", binaryen.expandType(binaryen.i31ref).join(",")); - - console.log(" // BinaryenTypeDataref: " + binaryen.dataref); - console.log(" //", binaryen.expandType(binaryen.dataref).join(",")); - console.log(" // BinaryenTypeAuto: " + binaryen.auto); var i32_pair = binaryen.createType([binaryen.i32, binaryen.i32]); diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index 36b5c6749..f5b77234d 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -12,18 +12,6 @@ // 5 // BinaryenTypeVec128: 6 // 6 - // BinaryenTypeFuncref: 7 - // 7 - // BinaryenTypeExternref: 8 - // 8 - // BinaryenTypeAnyref: 8 - // 8 - // BinaryenTypeEqref: 9 - // 9 - // BinaryenTypeI31ref: 10 - // 10 - // BinaryenTypeDataref: 11 - // 11 // BinaryenTypeAuto: -1 // 2,2 // 2,2 diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 28e784a05..90ea43e8a 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -229,37 +229,43 @@ void test_types() { assert(valueType == v128); BinaryenType funcref = BinaryenTypeFuncref(); - printf("BinaryenTypeFuncref: %d\n", funcref); + printf("BinaryenTypeFuncref: (ptr)\n", funcref); + assert(funcref == BinaryenTypeFuncref()); assert(BinaryenTypeArity(funcref) == 1); BinaryenTypeExpand(funcref, &valueType); assert(valueType == funcref); BinaryenType externref = BinaryenTypeExternref(); - printf("BinaryenTypeExternref: %d\n", externref); + printf("BinaryenTypeExternref: (ptr)\n", externref); + assert(externref == BinaryenTypeExternref()); assert(BinaryenTypeArity(externref) == 1); BinaryenTypeExpand(externref, &valueType); assert(valueType == externref); BinaryenType anyref = BinaryenTypeAnyref(); - printf("BinaryenTypeAnyref: %d\n", anyref); + printf("BinaryenTypeAnyref: (ptr)\n", anyref); + assert(anyref == BinaryenTypeAnyref()); assert(BinaryenTypeArity(anyref) == 1); BinaryenTypeExpand(anyref, &valueType); assert(valueType == anyref); BinaryenType eqref = BinaryenTypeEqref(); - printf("BinaryenTypeEqref: %d\n", eqref); + printf("BinaryenTypeEqref: (ptr)\n", eqref); + assert(eqref == BinaryenTypeEqref()); assert(BinaryenTypeArity(eqref) == 1); BinaryenTypeExpand(eqref, &valueType); assert(valueType == eqref); BinaryenType i31ref = BinaryenTypeI31ref(); - printf("BinaryenTypeI31ref: %d\n", i31ref); + printf("BinaryenTypeI31ref: (ptr)\n", i31ref); + assert(i31ref == BinaryenTypeI31ref()); assert(BinaryenTypeArity(i31ref) == 1); BinaryenTypeExpand(i31ref, &valueType); assert(valueType == i31ref); BinaryenType dataref = BinaryenTypeDataref(); - printf("BinaryenTypeDataref: %d\n", dataref); + printf("BinaryenTypeDataref: (ptr)\n", dataref); + assert(dataref == BinaryenTypeDataref()); assert(BinaryenTypeArity(dataref) == 1); BinaryenTypeExpand(dataref, &valueType); assert(valueType == dataref); diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 9f8324d48..e3a8e5676 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -5,12 +5,12 @@ BinaryenTypeInt64: 3 BinaryenTypeFloat32: 4 BinaryenTypeFloat64: 5 BinaryenTypeVec128: 6 -BinaryenTypeFuncref: 7 -BinaryenTypeExternref: 8 -BinaryenTypeAnyref: 8 -BinaryenTypeEqref: 9 -BinaryenTypeI31ref: 10 -BinaryenTypeDataref: 11 +BinaryenTypeFuncref: (ptr) +BinaryenTypeExternref: (ptr) +BinaryenTypeAnyref: (ptr) +BinaryenTypeEqref: (ptr) +BinaryenTypeI31ref: (ptr) +BinaryenTypeDataref: (ptr) BinaryenTypeAuto: -1 BinaryenPackedTypeNotPacked: 0 BinaryenPackedTypeInt8: 1 diff --git a/test/example/stack-utils.cpp b/test/example/stack-utils.cpp index 8709396f9..c54040251 100644 --- a/test/example/stack-utils.cpp +++ b/test/example/stack-utils.cpp @@ -250,6 +250,9 @@ void test_signature_composition() { } void test_signature_subtype() { + Type funcref = Type(HeapType::func, Nullable); + Type anyref = Type(HeapType::any, Nullable); + std::cout << ";; Test stack signature subtyping\n"; // Differences in unreachability only { @@ -260,15 +263,15 @@ void test_signature_subtype() { } // Covariance of results { - StackSignature a(Type::none, Type::funcref, StackSignature::Fixed); - StackSignature b(Type::none, Type::anyref, StackSignature::Fixed); + StackSignature a(Type::none, funcref, StackSignature::Fixed); + StackSignature b(Type::none, anyref, StackSignature::Fixed); assert(StackSignature::isSubType(a, b)); assert(!StackSignature::isSubType(b, a)); } // Contravariance of params { - StackSignature a(Type::anyref, Type::none, StackSignature::Fixed); - StackSignature b(Type::funcref, Type::none, StackSignature::Fixed); + StackSignature a(anyref, Type::none, StackSignature::Fixed); + StackSignature b(funcref, Type::none, StackSignature::Fixed); assert(StackSignature::isSubType(a, b)); assert(!StackSignature::isSubType(b, a)); } @@ -355,6 +358,9 @@ void test_signature_subtype() { } void test_signature_lub() { + Type funcref = Type(HeapType::func, Nullable); + Type anyref = Type(HeapType::any, Nullable); + std::cout << ";; Test stack signature lub\n"; { StackSignature a{Type::none, Type::none, StackSignature::Fixed}; @@ -392,30 +398,28 @@ void test_signature_lub() { (StackSignature{Type::i32, Type::i32, StackSignature::Polymorphic})); } { - StackSignature a{Type::none, Type::anyref, StackSignature::Polymorphic}; - StackSignature b{Type::none, Type::funcref, StackSignature::Polymorphic}; + StackSignature a{Type::none, anyref, StackSignature::Polymorphic}; + StackSignature b{Type::none, funcref, StackSignature::Polymorphic}; assert(StackSignature::haveLeastUpperBound(a, b)); - assert( - StackSignature::getLeastUpperBound(a, b) == - (StackSignature{Type::none, Type::anyref, StackSignature::Polymorphic})); + assert(StackSignature::getLeastUpperBound(a, b) == + (StackSignature{Type::none, anyref, StackSignature::Polymorphic})); } { - StackSignature a{Type::anyref, Type::none, StackSignature::Polymorphic}; - StackSignature b{Type::funcref, Type::none, StackSignature::Polymorphic}; + StackSignature a{anyref, Type::none, StackSignature::Polymorphic}; + StackSignature b{funcref, Type::none, StackSignature::Polymorphic}; // assert(StackSignature::haveLeastUpperBound(a, b)); // assert(StackSignature::getLeastUpperBound(a, b) == - // (StackSignature{Type::funcref, Type::none, + // (StackSignature{funcref, Type::none, // StackSignature::Polymorphic})); } { StackSignature a{ - {Type::i32, Type::funcref}, Type::funcref, StackSignature::Polymorphic}; - StackSignature b{ - Type::funcref, {Type::f32, Type::anyref}, StackSignature::Polymorphic}; + {Type::i32, funcref}, funcref, StackSignature::Polymorphic}; + StackSignature b{funcref, {Type::f32, anyref}, StackSignature::Polymorphic}; assert(StackSignature::haveLeastUpperBound(a, b)); assert(StackSignature::getLeastUpperBound(a, b) == - (StackSignature{{Type::i32, Type::funcref}, - {Type::f32, Type::anyref}, + (StackSignature{{Type::i32, funcref}, + {Type::f32, anyref}, StackSignature::Polymorphic})); } // No LUB diff --git a/test/example/type-builder-nominal.cpp b/test/example/type-builder-nominal.cpp index 8dbbfcf30..cbda43f1f 100644 --- a/test/example/type-builder-nominal.cpp +++ b/test/example/type-builder-nominal.cpp @@ -123,21 +123,24 @@ void test_canonicalization() { void test_basic() { std::cout << ";; Test basic\n"; + Type canonAnyref = Type(HeapType::any, Nullable); + Type canonI31ref = Type(HeapType::i31, NonNullable); + TypeBuilder builder(6); Type anyref = builder.getTempRefType(builder[4], Nullable); Type i31ref = builder.getTempRefType(builder[5], NonNullable); - builder[0] = Signature(Type::anyref, Type::i31ref); - builder[1] = Signature(anyref, Type::i31ref); - builder[2] = Signature(Type::anyref, i31ref); + builder[0] = Signature(canonAnyref, canonI31ref); + builder[1] = Signature(anyref, canonI31ref); + builder[2] = Signature(canonAnyref, i31ref); builder[3] = Signature(anyref, i31ref); builder[4] = HeapType::any; builder[5] = HeapType::i31; std::vector<HeapType> built = *builder.build(); - assert(built[0].getSignature() == Signature(Type::anyref, Type::i31ref)); + assert(built[0].getSignature() == Signature(canonAnyref, canonI31ref)); assert(built[1].getSignature() == built[0].getSignature()); assert(built[2].getSignature() == built[1].getSignature()); assert(built[3].getSignature() == built[2].getSignature()); @@ -150,16 +153,18 @@ void test_basic() { void test_signatures(bool warm) { std::cout << ";; Test canonical signatures\n"; + Type canonAnyref = Type(HeapType::any, Nullable); + Type canonI31ref = Type(HeapType::i31, NonNullable); + TypeBuilder builder(2); Type tempRef = builder.getTempRefType(builder[0], Nullable); - builder[0] = Signature(Type::i31ref, Type::anyref); + builder[0] = Signature(canonI31ref, canonAnyref); builder[1] = Signature(tempRef, tempRef); std::vector<HeapType> built = *builder.build(); - HeapType small = Signature(Type::i31ref, Type::anyref); - HeapType big = - Signature(Type(Signature(Type::i31ref, Type::anyref), Nullable), - Type(Signature(Type::i31ref, Type::anyref), Nullable)); + HeapType small = Signature(canonI31ref, canonAnyref); + HeapType big = Signature(Type(Signature(canonI31ref, canonAnyref), Nullable), + Type(Signature(canonI31ref, canonAnyref), Nullable)); if (warm) { assert(built[0] != small); assert(built[1] != big); @@ -306,6 +311,9 @@ void test_recursive() { void test_subtypes() { std::cout << ";; Test subtyping\n"; + Type anyref = Type(HeapType::any, Nullable); + Type funcref = Type(HeapType::func, Nullable); + auto LUB = [&](HeapType a, HeapType b) { Type refA = Type(a, Nullable); Type refB = Type(b, Nullable); @@ -362,7 +370,7 @@ void test_subtypes() { Type structRef1 = builder.getTempRefType(builder[1], Nullable); builder[0] = Struct{}; builder[1] = Struct{}; - builder[2] = Signature(Type::none, Type::anyref); + builder[2] = Signature(Type::none, anyref); builder[3] = Signature(Type::none, structRef0); builder[4] = Signature(Type::none, structRef1); built = *builder.build(); @@ -394,12 +402,10 @@ void test_subtypes() { builder[0].subTypeOf(builder[1]); builder[2].subTypeOf(builder[3]); builder[4].subTypeOf(builder[5]); - builder[0] = - Struct({Field(Type::i32, Mutable), Field(Type::anyref, Mutable)}); - builder[1] = - Struct({Field(Type::i32, Mutable), Field(Type::anyref, Mutable)}); - builder[2] = Signature(Type::i32, Type::anyref); - builder[3] = Signature(Type::i32, Type::anyref); + builder[0] = Struct({Field(Type::i32, Mutable), Field(anyref, Mutable)}); + builder[1] = Struct({Field(Type::i32, Mutable), Field(anyref, Mutable)}); + builder[2] = Signature(Type::i32, anyref); + builder[3] = Signature(Type::i32, anyref); builder[4] = Array(Field(Type::i32, Mutable)); builder[5] = Array(Field(Type::i32, Mutable)); built = *builder.build(); @@ -428,8 +434,8 @@ void test_subtypes() { std::vector<HeapType> built; { TypeBuilder builder(2); - builder[0] = Struct({Field(Type::anyref, Immutable)}); - builder[1] = Struct({Field(Type::funcref, Immutable)}); + builder[0] = Struct({Field(anyref, Immutable)}); + builder[1] = Struct({Field(funcref, Immutable)}); builder[1].subTypeOf(builder[0]); built = *builder.build(); } diff --git a/test/example/type-builder.cpp b/test/example/type-builder.cpp index ce7b74841..219282ea8 100644 --- a/test/example/type-builder.cpp +++ b/test/example/type-builder.cpp @@ -44,21 +44,24 @@ void test_canonicalization() { void test_basic() { std::cout << ";; Test basic\n"; + Type canonAnyref = Type(HeapType::any, Nullable); + Type canonI31ref = Type(HeapType::i31, NonNullable); + TypeBuilder builder(6); Type anyref = builder.getTempRefType(builder[4], Nullable); Type i31ref = builder.getTempRefType(builder[5], NonNullable); - builder[0] = Signature(Type::anyref, Type::i31ref); - builder[1] = Signature(anyref, Type::i31ref); - builder[2] = Signature(Type::anyref, i31ref); + builder[0] = Signature(canonAnyref, canonI31ref); + builder[1] = Signature(anyref, canonI31ref); + builder[2] = Signature(canonAnyref, i31ref); builder[3] = Signature(anyref, i31ref); builder[4] = HeapType::any; builder[5] = HeapType::i31; std::vector<HeapType> built = *builder.build(); - assert(built[0] == Signature(Type::anyref, Type::i31ref)); + assert(built[0] == Signature(canonAnyref, canonI31ref)); assert(built[1] == built[0]); assert(built[2] == built[1]); assert(built[3] == built[2]); @@ -210,8 +213,8 @@ void test_recursive() { std::cout << print(built[1]) << "\n\n"; assert(built[0].getSignature().results.getHeapType() == built[0]); assert(built[1].getSignature().results.getHeapType() == built[0]); - assert(built[0].getSignature().params == Type::anyref); - assert(built[1].getSignature().params == Type::anyref); + assert(built[0].getSignature().params == Type(HeapType::any, Nullable)); + assert(built[1].getSignature().params == Type(HeapType::any, Nullable)); assert(built[0] == built[1]); assert(built[2] == HeapType::any); } @@ -220,6 +223,12 @@ void test_recursive() { void test_lub() { std::cout << ";; Test LUBs\n"; + Type func = Type(HeapType::func, Nullable); + Type any = Type(HeapType::any, Nullable); + Type eq = Type(HeapType::eq, Nullable); + Type i31 = Type(HeapType::i31, Nullable); + Type data = Type(HeapType::data, Nullable); + auto LUB = [&](Type a, Type b) { Type lubAB = Type::getLeastUpperBound(a, b); Type lubBA = Type::getLeastUpperBound(b, a); @@ -238,15 +247,11 @@ void test_lub() { { // Basic Types - for (auto other : {Type::funcref, - Type::anyref, - Type::eqref, - Type::i31ref, - Type::dataref}) { - assert(LUB(Type::anyref, other) == Type::anyref); + for (auto other : {func, any, eq, i31, data}) { + assert(LUB(any, other) == any); } - assert(LUB(Type::eqref, Type::funcref) == Type::anyref); - assert(LUB(Type::i31ref, Type::dataref) == Type(HeapType::eq, NonNullable)); + assert(LUB(eq, func) == any); + assert(LUB(i31, data) == eq); } { @@ -260,22 +265,21 @@ void test_lub() { { // Funcref with specific signature - assert(LUB(Type::funcref, Type(Signature(), Nullable)) == Type::funcref); + assert(LUB(func, Type(Signature(), Nullable)) == func); } { // Incompatible signatures - Type a(Signature(Type::none, Type::anyref), Nullable); - Type b(Signature(Type::anyref, Type::none), Nullable); - assert(LUB(a, b) == Type::funcref); + Type a(Signature(Type::none, any), Nullable); + Type b(Signature(any, Type::none), Nullable); + assert(LUB(a, b) == Type(HeapType::func, Nullable)); } { // Signatures incompatible in tuple size - Type a(Signature(Type::none, {Type::anyref, Type::anyref}), Nullable); - Type b(Signature(Type::none, {Type::anyref, Type::anyref, Type::anyref}), - Nullable); - assert(LUB(a, b) == Type::funcref); + Type a(Signature(Type::none, {any, any}), Nullable); + Type b(Signature(Type::none, {any, any, any}), Nullable); + assert(LUB(a, b) == Type(HeapType::func, Nullable)); } // { @@ -303,24 +307,24 @@ void test_lub() { { // Mutable fields are invariant - Type a(Array(Field(Type::eqref, Mutable)), Nullable); - Type b(Array(Field(Type::funcref, Mutable)), Nullable); - assert(LUB(a, b) == Type(HeapType::data, Nullable)); + Type a(Array(Field(eq, Mutable)), Nullable); + Type b(Array(Field(func, Mutable)), Nullable); + assert(LUB(a, b) == data); } { // Immutable fields are covariant - Type a(Array(Field(Type::eqref, Immutable)), Nullable); - Type b(Array(Field(Type::funcref, Immutable)), Nullable); - Type lub(Array(Field(Type::anyref, Immutable)), Nullable); + Type a(Array(Field(eq, Immutable)), Nullable); + Type b(Array(Field(func, Immutable)), Nullable); + Type lub(Array(Field(any, Immutable)), Nullable); assert(LUB(a, b) == lub); } { // Depth subtyping - Type a(Struct({Field(Type::eqref, Immutable)}), Nullable); - Type b(Struct({Field(Type::funcref, Immutable)}), Nullable); - Type lub(Struct({Field(Type::anyref, Immutable)}), Nullable); + Type a(Struct({Field(eq, Immutable)}), Nullable); + Type b(Struct({Field(func, Immutable)}), Nullable); + Type lub(Struct({Field(any, Immutable)}), Nullable); assert(LUB(a, b) == lub); } @@ -344,32 +348,29 @@ void test_lub() { { // Width and depth subtyping with different suffixes - Type a(Struct({Field(Type::eqref, Immutable), Field(Type::i64, Immutable)}), + Type a(Struct({Field(eq, Immutable), Field(Type::i64, Immutable)}), Nullable); - Type b( - Struct({Field(Type::funcref, Immutable), Field(Type::f32, Immutable)}), - Nullable); - Type lub(Struct({Field(Type::anyref, Immutable)}), Nullable); + Type b(Struct({Field(func, Immutable), Field(Type::f32, Immutable)}), + Nullable); + Type lub(Struct({Field(any, Immutable)}), Nullable); assert(LUB(a, b) == lub); } { // No common prefix - Type a( - Struct({Field(Type::i32, Immutable), Field(Type::anyref, Immutable)}), - Nullable); - Type b( - Struct({Field(Type::f32, Immutable), Field(Type::anyref, Immutable)}), - Nullable); + Type a(Struct({Field(Type::i32, Immutable), Field(any, Immutable)}), + Nullable); + Type b(Struct({Field(Type::f32, Immutable), Field(any, Immutable)}), + Nullable); Type lub(Struct(), Nullable); assert(LUB(a, b) == lub); } { // Nested structs - Type innerA(Struct({Field(Type::eqref, Immutable)}), Nullable); - Type innerB(Struct({Field(Type::funcref, Immutable)}), Nullable); - Type innerLub(Struct({Field(Type::anyref, Immutable)}), Nullable); + Type innerA(Struct({Field(eq, Immutable)}), Nullable); + Type innerB(Struct({Field(func, Immutable)}), Nullable); + Type innerLub(Struct({Field(any, Immutable)}), Nullable); Type a(Struct({Field(innerA, Immutable)}), Nullable); Type b(Struct({Field(innerB, Immutable)}), Nullable); Type lub(Struct({Field(innerLub, Immutable)}), Nullable); @@ -381,18 +382,15 @@ void test_lub() { TypeBuilder builder(2); Type tempA = builder.getTempRefType(builder[0], Nullable); Type tempB = builder.getTempRefType(builder[1], Nullable); - builder[0] = - Struct({Field(tempB, Immutable), Field(Type::eqref, Immutable)}); - builder[1] = - Struct({Field(tempA, Immutable), Field(Type::funcref, Immutable)}); + builder[0] = Struct({Field(tempB, Immutable), Field(eq, Immutable)}); + builder[1] = Struct({Field(tempA, Immutable), Field(func, Immutable)}); auto built = *builder.build(); Type a(built[0], Nullable); Type b(built[1], Nullable); TypeBuilder lubBuilder(1); Type tempLub = builder.getTempRefType(lubBuilder[0], Nullable); - lubBuilder[0] = - Struct({Field(tempLub, Immutable), Field(Type::anyref, Immutable)}); + lubBuilder[0] = Struct({Field(tempLub, Immutable), Field(any, Immutable)}); built = *lubBuilder.build(); Type lub(built[0], Nullable); diff --git a/test/example/typeinfo.cpp b/test/example/typeinfo.cpp index ed5637bd9..55e7b9082 100644 --- a/test/example/typeinfo.cpp +++ b/test/example/typeinfo.cpp @@ -8,7 +8,6 @@ using namespace wasm; void test_compound() { { HeapType func(HeapType::func); - assert(Type(func, Nullable).getID() == Type::funcref); assert(Type(func, NonNullable).getID() == Type(func, NonNullable).getID()); assert(Type(func, NonNullable).getID() != Type(func, Nullable).getID()); HeapType sameFunc(HeapType::func); @@ -16,7 +15,6 @@ void test_compound() { Type(sameFunc, NonNullable).getID()); HeapType any(HeapType::any); - assert(Type(any, Nullable).getID() == Type::anyref); assert(Type(any, NonNullable).getID() == Type(any, NonNullable).getID()); assert(Type(any, NonNullable).getID() != Type(any, Nullable).getID()); HeapType sameAny(HeapType::any); @@ -24,14 +22,12 @@ void test_compound() { Type(sameAny, NonNullable).getID()); HeapType eq(HeapType::eq); - // assert(Type(eq, Nullable).getID() == Type::eqref); assert(Type(eq, NonNullable).getID() == Type(eq, NonNullable).getID()); assert(Type(eq, NonNullable).getID() != Type(eq, Nullable).getID()); HeapType sameEq(HeapType::eq); assert(Type(eq, NonNullable).getID() == Type(sameEq, NonNullable).getID()); HeapType i31(HeapType::i31); - // assert(Type(i31, NonNullable).getID() == Type::i31ref); assert(Type(i31, NonNullable).getID() == Type(i31, NonNullable).getID()); assert(Type(i31, NonNullable).getID() != Type(i31, Nullable).getID()); HeapType sameI31(HeapType::i31); @@ -92,7 +88,7 @@ void test_compound() { Tuple sameTuple({Type::i32, Type::f64}); assert(Type(tuple).getID() == Type(sameTuple).getID()); - Tuple otherTuple({Type::f64, Type::anyref}); + Tuple otherTuple({Type::f64, Type::i64}); assert(Type(tuple).getID() != Type(otherTuple).getID()); } { @@ -165,7 +161,6 @@ void test_printing() { {Type::i64, Immutable}, {Type::f32, Mutable}, {Type::f64, Mutable}, - {Type::anyref, Immutable}, }); std::cout << struct_ << "\n"; std::cout << Type(struct_, NonNullable) << "\n"; @@ -177,7 +172,7 @@ void test_printing() { std::cout << array << "\n"; std::cout << Type(array, NonNullable) << "\n"; std::cout << Type(array, Nullable) << "\n"; - Array arrayMut({Type::anyref, Mutable}); + Array arrayMut({Type::i64, Mutable}); std::cout << arrayMut << "\n"; std::cout << Type(arrayMut, NonNullable) << "\n"; std::cout << Type(arrayMut, Nullable) << "\n"; @@ -190,7 +185,6 @@ void test_printing() { Tuple tuple({ Type::i32, Type::f64, - Type::anyref, }); std::cout << tuple << "\n"; std::cout << Type(tuple) << "\n"; diff --git a/test/example/typeinfo.txt b/test/example/typeinfo.txt index 924fcb3ec..838fd34a3 100644 --- a/test/example/typeinfo.txt +++ b/test/example/typeinfo.txt @@ -27,7 +27,7 @@ i31ref (struct) (ref $struct.0) (ref null $struct.0) -(struct (field i32 i64 (mut f32) (mut f64) anyref)) +(struct (field i32 i64 (mut f32) (mut f64))) (ref $struct.0) (ref null $struct.0) @@ -35,15 +35,15 @@ i31ref (array i32) (ref $array.0) (ref null $array.0) -(array (mut anyref)) +(array (mut i64)) (ref $array.0) (ref null $array.0) ;; Tuple () none -(i32 f64 anyref) -(i32 f64 anyref) +(i32 f64) +(i32 f64) ;; Rtt (rtt 0 func) diff --git a/test/gtest/possible-contents.cpp b/test/gtest/possible-contents.cpp index 2994a6221..2bed9a882 100644 --- a/test/gtest/possible-contents.cpp +++ b/test/gtest/possible-contents.cpp @@ -59,6 +59,9 @@ protected: wasm::setTypeSystem(TypeSystem::Nominal); } + Type anyref = Type(HeapType::any, Nullable); + Type funcref = Type(HeapType::func, Nullable); + PossibleContents none = PossibleContents::none(); PossibleContents i32Zero = PossibleContents::literal(Literal(int32_t(0))); @@ -74,15 +77,14 @@ protected: PossibleContents i32Global2 = PossibleContents::global("i32Global2", Type::i32); PossibleContents f64Global = PossibleContents::global("f64Global", Type::f64); - PossibleContents anyGlobal = - PossibleContents::global("anyGlobal", Type::anyref); + PossibleContents anyGlobal = PossibleContents::global("anyGlobal", anyref); PossibleContents nonNullFunc = PossibleContents::literal( Literal("func", Type(Signature(Type::none, Type::none), NonNullable))); PossibleContents exactI32 = PossibleContents::exactType(Type::i32); - PossibleContents exactAnyref = PossibleContents::exactType(Type::anyref); - PossibleContents exactFuncref = PossibleContents::exactType(Type::funcref); + PossibleContents exactAnyref = PossibleContents::exactType(anyref); + PossibleContents exactFuncref = PossibleContents::exactType(funcref); PossibleContents exactNonNullAnyref = PossibleContents::exactType(Type(HeapType::any, NonNullable)); PossibleContents exactNonNullFuncref = diff --git a/test/gtest/type-builder.cpp b/test/gtest/type-builder.cpp index ca9bd865d..d06236130 100644 --- a/test/gtest/type-builder.cpp +++ b/test/gtest/type-builder.cpp @@ -481,11 +481,13 @@ static void testCanonicalizeBasicTypes() { Type anyref = builder.getTempRefType(builder[0], Nullable); Type anyrefs = builder.getTempTupleType({anyref, anyref}); + Type anyrefCanon = Type(HeapType::any, Nullable); + builder[0] = HeapType::any; builder[1] = Struct({Field(anyref, Immutable)}); - builder[2] = Struct({Field(Type::anyref, Immutable)}); + builder[2] = Struct({Field(anyrefCanon, Immutable)}); builder[3] = Signature(anyrefs, Type::none); - builder[4] = Signature({Type::anyref, Type::anyref}, Type::none); + builder[4] = Signature({anyrefCanon, anyrefCanon}, Type::none); auto result = builder.build(); ASSERT_TRUE(result); @@ -504,10 +506,13 @@ TEST_F(IsorecursiveTest, CanonicalizeBasicTypes) { // Test SubTypes utility code. TEST_F(NominalTest, testSubTypes) { + Type anyref = Type(HeapType::any, Nullable); + Type funcref = Type(HeapType::func, Nullable); + // Build type types, the second of which is a subtype. TypeBuilder builder(2); - builder[0] = Struct({Field(Type::anyref, Immutable)}); - builder[1] = Struct({Field(Type::funcref, Immutable)}); + builder[0] = Struct({Field(anyref, Immutable)}); + builder[1] = Struct({Field(funcref, Immutable)}); builder[1].subTypeOf(builder[0]); auto built = *builder.build(); diff --git a/test/lit/fuzz-types/isorecursive.test b/test/lit/fuzz-types/isorecursive.test index 9165d9265..78315c5b1 100644 --- a/test/lit/fuzz-types/isorecursive.test +++ b/test/lit/fuzz-types/isorecursive.test @@ -2,25 +2,25 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $0 (struct_subtype data)) -;; CHECK-NEXT: (type $1 (func_subtype (param i31ref) (result dataref) func)) -;; CHECK-NEXT: (type $2 (array_subtype i32 data)) -;; CHECK-NEXT: (type $3 (array_subtype i32 $2)) -;; CHECK-NEXT: (type $4 (array_subtype i32 $2)) -;; CHECK-NEXT: (type $5 (array_subtype i32 $3)) -;; CHECK-NEXT: (type $6 (array_subtype i32 $3)) +;; CHECK-NEXT: (type $1 (func_subtype (param f64) (result f64 i64 f32 (rtt any) f64 f32) func)) +;; CHECK-NEXT: (type $2 (struct_subtype (field f64 v128 (ref null $0) (mut i16) (mut (rtt $5)) (mut (ref null $2))) data)) +;; CHECK-NEXT: (type $3 (struct_subtype (field f64 v128 (ref null $0) (mut i16) (mut (rtt $5)) (mut (ref null $2))) $2)) +;; CHECK-NEXT: (type $4 (struct_subtype (field f64 v128 (ref null $0) (mut i16) (mut (rtt $5)) (mut (ref null $2))) $2)) +;; CHECK-NEXT: (type $5 (struct_subtype (field f64 v128 (ref null $10) (mut i16) (mut (rtt $5)) (mut (ref null $2))) $3)) +;; CHECK-NEXT: (type $6 (struct_subtype (field f64 v128 (ref null $0) (mut i16) (mut (rtt $5)) (mut (ref null $2))) $3)) ;; CHECK-NEXT: (type $7 (struct_subtype $0)) -;; CHECK-NEXT: (type $8 (struct_subtype $0)) -;; CHECK-NEXT: (type $9 (array_subtype i32 $6)) -;; CHECK-NEXT: (type $10 (struct_subtype $0)) -;; CHECK-NEXT: (type $11 (array_subtype i32 $2)) +;; CHECK-NEXT: (type $8 (struct_subtype (field f32 (mut i16) (ref eq) (mut (rtt $2))) $0)) +;; CHECK-NEXT: (type $9 (struct_subtype (field f64 v128 (ref null $0) (mut i16) (mut (rtt $5)) (mut (ref null $2))) $6)) +;; CHECK-NEXT: (type $10 (struct_subtype (field (ref $2) (mut (ref $13)) (ref null i31) v128 (ref null $6)) $0)) +;; CHECK-NEXT: (type $11 (struct_subtype (field f64 v128 (ref $0) (mut i16) (mut (rtt $5)) (mut (ref null $2))) $2)) ;; CHECK-NEXT: (type $12 (struct_subtype $0)) -;; CHECK-NEXT: (type $13 (array_subtype i32 $6)) +;; CHECK-NEXT: (type $13 (struct_subtype (field f64 v128 (ref null $0) (mut i16) (mut (rtt $5)) (mut (ref null $2))) $6)) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $14 (struct_subtype $10)) -;; CHECK-NEXT: (type $15 (func_subtype (param i31ref) (result dataref) $1)) -;; CHECK-NEXT: (type $16 (array_subtype i32 $2)) -;; CHECK-NEXT: (type $17 (struct_subtype $14)) -;; CHECK-NEXT: (type $18 (struct_subtype (field (mut funcref) (mut (ref null $7)) funcref) $12)) -;; CHECK-NEXT: (type $19 (func_subtype (param i31ref) (result dataref) $15)) +;; CHECK-NEXT: (type $14 (struct_subtype (field (ref $2) (mut (ref $13)) i31ref v128 (ref $9) (mut (ref null $10))) $10)) +;; CHECK-NEXT: (type $15 (func_subtype (param f64) (result f64 i64 f32 (rtt any) f64 f32) $1)) +;; CHECK-NEXT: (type $16 (struct_subtype (field f64 v128 (ref null $0) (mut i16) (mut (rtt $5)) (mut (ref null $2))) $2)) +;; CHECK-NEXT: (type $17 (struct_subtype (field (ref $2) (mut (ref $13)) i31ref v128 (ref $9) (mut (ref null $10))) $14)) +;; CHECK-NEXT: (type $18 (struct_subtype $12)) +;; CHECK-NEXT: (type $19 (func_subtype (param f64) (result f64 i64 f32 (rtt any) f64 f32) $15)) ;; CHECK-NEXT: ) diff --git a/test/lit/fuzz-types/nominal.test b/test/lit/fuzz-types/nominal.test index 248ce6539..299cf2613 100644 --- a/test/lit/fuzz-types/nominal.test +++ b/test/lit/fuzz-types/nominal.test @@ -3,20 +3,20 @@ ;; CHECK: (type $0 (struct_subtype (field (ref null $9) (ref $5)) data)) ;; CHECK-NEXT: (type $1 (func_subtype (param (rtt 0 $8)) func)) ;; CHECK-NEXT: (type $2 (struct_subtype (field (mut (rtt $19)) (ref $4)) data)) -;; CHECK-NEXT: (type $3 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64)) $2)) -;; CHECK-NEXT: (type $4 (struct_subtype (field (mut (rtt $19)) (ref $4) (mut (ref $13))) $2)) -;; CHECK-NEXT: (type $5 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64)) $3)) -;; CHECK-NEXT: (type $6 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64)) $3)) -;; CHECK-NEXT: (type $7 (struct_subtype (field (ref null $9) (ref $5) eqref (mut (ref null $3)) (mut (rtt $18)) dataref) $0)) -;; CHECK-NEXT: (type $8 (struct_subtype (field (ref $9) (ref $5) (rtt 2 $1) (mut (rtt $17)) (mut (rtt i31)) (rtt $8)) $0)) -;; CHECK-NEXT: (type $9 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64) (rtt 2 $15)) $6)) -;; CHECK-NEXT: (type $10 (struct_subtype (field (ref null $9) (ref $5)) $0)) -;; CHECK-NEXT: (type $11 (struct_subtype (field (mut (rtt $19)) (ref $4)) $2)) +;; CHECK-NEXT: (type $3 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 v128 (mut v128)) $2)) +;; CHECK-NEXT: (type $4 (struct_subtype (field (mut (rtt $19)) (ref $4)) $2)) +;; CHECK-NEXT: (type $5 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 v128 (mut v128)) $3)) +;; CHECK-NEXT: (type $6 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 v128 (mut v128)) $3)) +;; CHECK-NEXT: (type $7 (struct_subtype (field (ref null $9) (ref $5)) $0)) +;; CHECK-NEXT: (type $8 (struct_subtype (field (ref null $9) (ref $5)) $0)) +;; CHECK-NEXT: (type $9 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 v128 (mut v128)) $6)) +;; CHECK-NEXT: (type $10 (struct_subtype (field (ref $9) (ref $5) i32) $0)) +;; CHECK-NEXT: (type $11 (struct_subtype (field (mut (rtt $19)) (ref $4) (mut f64) i32 (mut f32)) $2)) ;; CHECK-NEXT: (type $12 (struct_subtype (field (ref null $9) (ref $5)) $0)) -;; CHECK-NEXT: (type $13 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64)) $6)) -;; CHECK-NEXT: (type $14 (struct_subtype (field (ref null $9) (ref $5)) $10)) +;; CHECK-NEXT: (type $13 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 v128 (mut v128)) $6)) +;; CHECK-NEXT: (type $14 (struct_subtype (field (ref $9) (ref $5) i32) $10)) ;; CHECK-NEXT: (type $15 (func_subtype (param (rtt 0 $8)) $1)) -;; CHECK-NEXT: (type $16 (struct_subtype (field (mut (rtt $19)) (ref $4) v128) $2)) -;; CHECK-NEXT: (type $17 (struct_subtype (field (ref null $9) (ref $5)) $14)) +;; CHECK-NEXT: (type $16 (struct_subtype (field (mut (rtt $19)) (ref $4) (mut i16) i64 (mut (rtt 0 i31))) $2)) +;; CHECK-NEXT: (type $17 (struct_subtype (field (ref $9) (ref $5) i32) $14)) ;; CHECK-NEXT: (type $18 (struct_subtype (field (ref null $9) (ref $5)) $12)) ;; CHECK-NEXT: (type $19 (func_subtype (param (rtt 0 $8)) $15)) diff --git a/test/lit/fuzz-types/structural.test b/test/lit/fuzz-types/structural.test index a7b38edb4..e0aa75e9e 100644 --- a/test/lit/fuzz-types/structural.test +++ b/test/lit/fuzz-types/structural.test @@ -1,22 +1,22 @@ ;; RUN: wasm-fuzz-types --structural -v --seed=0 | filecheck %s -;; CHECK: (type $0 (struct (field (ref null $9) (ref $3)))) -;; CHECK-NEXT: (type $1 (func (param (rtt 0 $8)))) -;; CHECK-NEXT: (type $2 (struct (field (mut (rtt $1)) (ref $4)))) -;; CHECK-NEXT: (type $3 (struct (field (mut (rtt $1)) (ref $4) i64 (mut (ref null $2)) (mut i64)))) -;; CHECK-NEXT: (type $4 (struct (field (mut (rtt $1)) (ref $4) (mut (ref $3))))) +;; CHECK: (type $0 (struct (field (ref null $3) (ref $3)))) +;; CHECK-NEXT: (type $1 (func (param (rtt 0 $0)))) +;; CHECK-NEXT: (type $2 (struct (field (mut (rtt $1)) (ref $2)))) +;; CHECK-NEXT: (type $3 (struct (field (mut (rtt $1)) (ref $2) i64 v128 (mut v128)))) +;; CHECK-NEXT: (type $4 identical to $2) ;; CHECK-NEXT: (type $5 identical to $3) ;; CHECK-NEXT: (type $6 identical to $3) -;; CHECK-NEXT: (type $7 (struct (field (ref null $9) (ref $3) eqref (mut (ref null $3)) (mut (rtt $0)) dataref))) -;; CHECK-NEXT: (type $8 (struct (field (ref $9) (ref $3) (rtt 2 $1) (mut (rtt $0)) (mut (rtt i31)) (rtt $8)))) -;; CHECK-NEXT: (type $9 (struct (field (mut (rtt $1)) (ref $4) i64 (mut (ref null $2)) (mut i64) (rtt 2 $1)))) -;; CHECK-NEXT: (type $10 identical to $0) -;; CHECK-NEXT: (type $11 identical to $2) +;; CHECK-NEXT: (type $7 identical to $0) +;; CHECK-NEXT: (type $8 identical to $0) +;; CHECK-NEXT: (type $9 identical to $3) +;; CHECK-NEXT: (type $10 (struct (field (ref $3) (ref $3) i32))) +;; CHECK-NEXT: (type $11 (struct (field (mut (rtt $1)) (ref $2) (mut f64) i32 (mut f32)))) ;; CHECK-NEXT: (type $12 identical to $0) ;; CHECK-NEXT: (type $13 identical to $3) -;; CHECK-NEXT: (type $14 identical to $0) +;; CHECK-NEXT: (type $14 identical to $10) ;; CHECK-NEXT: (type $15 identical to $1) -;; CHECK-NEXT: (type $16 (struct (field (mut (rtt $1)) (ref $4) v128))) -;; CHECK-NEXT: (type $17 identical to $0) +;; CHECK-NEXT: (type $16 (struct (field (mut (rtt $1)) (ref $2) (mut i16) i64 (mut (rtt 0 i31))))) +;; CHECK-NEXT: (type $17 identical to $10) ;; CHECK-NEXT: (type $18 identical to $0) ;; CHECK-NEXT: (type $19 identical to $1) diff --git a/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast b/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast index e736253f6..28c42e1fa 100644 --- a/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast +++ b/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast @@ -16,12 +16,6 @@ ;; CHECK: (type $i32_i32_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref))) - ;; CHECK: (type $i32_i32_eqref_=>_eqref (func (param i32 i32 eqref) (result eqref))) - - ;; CHECK: (type $i32_i32_i31ref_=>_i31ref (func (param i32 i32 i31ref) (result i31ref))) - - ;; CHECK: (type $i32_i32_dataref_=>_dataref (func (param i32 i32 dataref) (result dataref))) - ;; CHECK: (type $i32_i32_v128_=>_v128 (func (param i32 i32 v128) (result v128))) ;; CHECK: (type $none_=>_none (func)) @@ -50,18 +44,6 @@ ;; CHECK: (import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref))) - ;; CHECK: (import "env" "get_eqref" (func $get_eqref (param i32 i32 eqref) (result eqref))) - - ;; CHECK: (import "env" "set_eqref" (func $set_eqref (param i32 i32 eqref) (result eqref))) - - ;; CHECK: (import "env" "get_i31ref" (func $get_i31ref (param i32 i32 i31ref) (result i31ref))) - - ;; CHECK: (import "env" "set_i31ref" (func $set_i31ref (param i32 i32 i31ref) (result i31ref))) - - ;; CHECK: (import "env" "get_dataref" (func $get_dataref (param i32 i32 dataref) (result dataref))) - - ;; CHECK: (import "env" "set_dataref" (func $set_dataref (param i32 i32 dataref) (result dataref))) - ;; CHECK: (import "env" "get_v128" (func $get_v128 (param i32 i32 v128) (result v128))) ;; CHECK: (import "env" "set_v128" (func $set_v128 (param i32 i32 v128) (result v128))) diff --git a/test/lit/strings.wast b/test/lit/strings.wast index c807ac000..03e87e562 100644 --- a/test/lit/strings.wast +++ b/test/lit/strings.wast @@ -5,17 +5,17 @@ ;; RUN: foreach %s %t wasm-opt --enable-strings --enable-reference-types --enable-gc --roundtrip -S -o - | filecheck %s (module - ;; CHECK: (type $ref?|string|_=>_none (func (param stringref))) + ;; CHECK: (type $stringref_=>_none (func (param stringref))) - ;; CHECK: (type $ref?|string|_ref?|stringview_wtf8|_ref?|stringview_wtf16|_ref?|stringview_iter|_=>_none (func (param stringref stringview_wtf8 stringview_wtf16 stringview_iter))) + ;; CHECK: (type $stringref_stringview_wtf8_stringview_wtf16_stringview_iter_=>_none (func (param stringref stringview_wtf8 stringview_wtf16 stringview_iter))) - ;; CHECK: (type $ref?|string|_ref?|string|_=>_none (func (param stringref stringref))) + ;; CHECK: (type $stringref_stringref_=>_none (func (param stringref stringref))) - ;; CHECK: (type $ref?|string|_ref?|stringview_wtf8|_ref?|stringview_wtf16|_ref?|stringview_iter|_ref?|string|_ref?|stringview_wtf8|_ref?|stringview_wtf16|_ref?|stringview_iter|_ref|string|_ref|stringview_wtf8|_ref|stringview_wtf16|_ref|stringview_iter|_=>_none (func (param stringref stringview_wtf8 stringview_wtf16 stringview_iter stringref stringview_wtf8 stringview_wtf16 stringview_iter (ref string) (ref stringview_wtf8) (ref stringview_wtf16) (ref stringview_iter)))) + ;; CHECK: (type $stringref_stringview_wtf8_stringview_wtf16_stringview_iter_stringref_stringview_wtf8_stringview_wtf16_stringview_iter_ref|string|_ref|stringview_wtf8|_ref|stringview_wtf16|_ref|stringview_iter|_=>_none (func (param stringref stringview_wtf8 stringview_wtf16 stringview_iter stringref stringview_wtf8 stringview_wtf16 stringview_iter (ref string) (ref stringview_wtf8) (ref stringview_wtf16) (ref stringview_iter)))) ;; CHECK: (type $none_=>_none (func)) - ;; CHECK: (type $ref?|stringview_wtf16|_=>_none (func (param stringview_wtf16))) + ;; CHECK: (type $stringview_wtf16_=>_none (func (param stringview_wtf16))) ;; CHECK: (type $ref|$array|_=>_none (func (param (ref $array)))) diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt index fa88cc5ef..ad0779876 100644 --- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt +++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt @@ -1,42 +1,40 @@ total - [exports] : 8 - [funcs] : 9 + [exports] : 10 + [funcs] : 12 [globals] : 6 [imports] : 5 [memory-data] : 22 [table-data] : 4 [tables] : 1 [tags] : 0 - [total] : 650 - [vars] : 12 + [total] : 549 + [vars] : 22 AtomicCmpxchg : 1 AtomicFence : 1 - AtomicNotify : 1 - Binary : 83 - Block : 72 - Break : 5 + Binary : 71 + Block : 60 + Break : 2 Call : 23 - CallRef : 4 - Const : 141 + CallRef : 2 + Const : 119 Drop : 3 - GlobalGet : 39 - GlobalSet : 21 - I31New : 10 - If : 31 - Load : 24 - LocalGet : 49 - LocalSet : 25 - Loop : 11 - Nop : 9 - RefEq : 2 - RefFunc : 12 + GlobalGet : 35 + GlobalSet : 19 + I31New : 6 + If : 25 + Load : 16 + LocalGet : 45 + LocalSet : 23 + Loop : 6 + Nop : 7 + RefFunc : 11 RefIs : 1 RefNull : 2 Return : 27 SIMDExtract : 1 - Select : 2 - Store : 2 - StructNew : 4 - TupleExtract : 2 + Select : 1 + Store : 3 + StructNew : 2 TupleMake : 7 - Unary : 35 + Unary : 29 + Unreachable : 1 |