From 6759371b5239efa3daa9d988455abdd14a8b18ca Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Thu, 4 Aug 2022 17:05:54 -0700 Subject: Remove RTTs (#4848) RTTs were removed from the GC spec and if they are added back in in the future, they will be heap types rather than value types as in our implementation. Updating our implementation to have RTTs be heap types would have been more work than deleting them for questionable benefit since we don't know how long it will be before they are specced again. --- src/tools/fuzzing/fuzzing.cpp | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'src/tools/fuzzing/fuzzing.cpp') diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index 59c9dca45..4d0a8d7b7 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp @@ -918,7 +918,7 @@ Expression* TranslateToFuzzReader::_makeConcrete(Type type) { &Self::makeSelect) .add(FeatureSet::Multivalue, &Self::makeTupleExtract); } - if (type.isSingle() && !type.isRef() && !type.isRtt()) { + if (type.isSingle() && !type.isRef()) { options.add(FeatureSet::MVP, {&Self::makeLoad, Important}); options.add(FeatureSet::SIMD, &Self::makeSIMD); } @@ -1893,8 +1893,6 @@ Expression* TranslateToFuzzReader::makeConst(Type type) { } else { return makeConstCompoundRef(type); } - } else if (type.isRtt()) { - return builder.makeRtt(type); } else if (type.isTuple()) { std::vector operands; for (const auto& t : type) { @@ -2035,14 +2033,15 @@ Expression* TranslateToFuzzReader::makeUnary(Type type) { // give up return makeTrivial(type); } - // There are no unary ops for reference or RTT types. - if (type.isRef() || type.isRtt()) { + // There are no unary ops for reference types. + // TODO: not quite true if you count struct.new and array.new. + if (type.isRef()) { return makeTrivial(type); } switch (type.getBasic()) { case Type::i32: { auto singleConcreteType = getSingleConcreteType(); - if (singleConcreteType.isRef() || singleConcreteType.isRtt()) { + if (singleConcreteType.isRef()) { // TODO: Do something more interesting here. return makeTrivial(type); } @@ -2241,8 +2240,9 @@ Expression* TranslateToFuzzReader::makeBinary(Type type) { // give up return makeTrivial(type); } - // There are no binary ops for reference or RTT types. - if (type.isRef() || type.isRtt()) { + // There are no binary ops for reference types. + // TODO: Use struct.new + if (type.isRef()) { return makeTrivial(type); } switch (type.getBasic()) { @@ -3056,19 +3056,6 @@ HeapType TranslateToFuzzReader::getSubType(HeapType type) { return type; } -Rtt TranslateToFuzzReader::getSubType(Rtt rtt) { - if (getTypeSystem() == TypeSystem::Nominal || - getTypeSystem() == TypeSystem::Isorecursive) { - // With nominal or isorecursive typing the depth in rtts must match the - // nominal hierarchy, so we cannot create a random depth like we do below. - return rtt; - } - uint32_t depth = rtt.depth != Rtt::NoDepth - ? rtt.depth - : oneIn(2) ? Rtt::NoDepth : upTo(MAX_RTT_DEPTH + 1); - return Rtt(depth, rtt.heapType); -} - Type TranslateToFuzzReader::getSubType(Type type) { if (type.isTuple()) { std::vector types; @@ -3080,8 +3067,6 @@ Type TranslateToFuzzReader::getSubType(Type type) { auto heapType = getSubType(type.getHeapType()); auto nullability = getSubType(type.getNullability()); return Type(heapType, nullability); - } else if (type.isRtt()) { - return Type(getSubType(type.getRtt())); } else { // This is an MVP type without subtypes. assert(type.isBasic()); -- cgit v1.2.3