diff options
Diffstat (limited to 'src/ir')
-rw-r--r-- | src/ir/module-utils.cpp | 21 | ||||
-rw-r--r-- | src/ir/possible-contents.cpp | 13 | ||||
-rw-r--r-- | src/ir/subtypes.h | 4 |
3 files changed, 2 insertions, 36 deletions
diff --git a/src/ir/module-utils.cpp b/src/ir/module-utils.cpp index c10a45b15..22f07a2e8 100644 --- a/src/ir/module-utils.cpp +++ b/src/ir/module-utils.cpp @@ -214,24 +214,6 @@ IndexedHeapTypes getOptimizedIndexedHeapTypes(Module& wasm) { TypeSystem system = getTypeSystem(); Counts counts = getHeapTypeCounts(wasm); - if (system == TypeSystem::Equirecursive) { - // Sort by frequency and then original insertion order. - std::vector<std::pair<HeapType, size_t>> sorted(counts.begin(), - counts.end()); - std::stable_sort(sorted.begin(), sorted.end(), [&](auto a, auto b) { - return a.second > b.second; - }); - - // Collect the results. - IndexedHeapTypes indexedTypes; - for (Index i = 0; i < sorted.size(); ++i) { - indexedTypes.types.push_back(sorted[i].first); - } - - setIndices(indexedTypes); - return indexedTypes; - } - // Types have to be arranged into topologically ordered recursion groups. // Under isorecrsive typing, the topological sort has to take all referenced // rec groups into account but under nominal typing it only has to take @@ -285,9 +267,6 @@ IndexedHeapTypes getOptimizedIndexedHeapTypes(Module& wasm) { info.preds.insert(super->getRecGroup()); } break; - case TypeSystem::Equirecursive: - WASM_UNREACHABLE( - "Equirecursive types should already have been handled"); } } diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp index 0284101ed..7ed6bfde6 100644 --- a/src/ir/possible-contents.cpp +++ b/src/ir/possible-contents.cpp @@ -488,12 +488,6 @@ struct InfoCollector } } } - if (type.isRef() && getTypeSystem() != TypeSystem::Nominal && - getTypeSystem() != TypeSystem::Isorecursive) { - // We need explicit supers in the SubTyping helper class. Without that, - // cannot handle refs, and consider them irrelevant. - return false; - } return true; } @@ -1582,11 +1576,8 @@ Flower::Flower(Module& wasm) : wasm(wasm) { std::cout << "struct phase\n"; #endif - if (getTypeSystem() == TypeSystem::Nominal || - getTypeSystem() == TypeSystem::Isorecursive) { - subTypes = std::make_unique<SubTypes>(wasm); - maxDepths = subTypes->getMaxDepths(); - } + subTypes = std::make_unique<SubTypes>(wasm); + maxDepths = subTypes->getMaxDepths(); #ifdef POSSIBLE_CONTENTS_DEBUG std::cout << "Link-targets phase\n"; diff --git a/src/ir/subtypes.h b/src/ir/subtypes.h index 198a69b7a..bc14c1d4f 100644 --- a/src/ir/subtypes.h +++ b/src/ir/subtypes.h @@ -29,10 +29,6 @@ namespace wasm { // This only scans user types, and not basic types like HeapType::eq. struct SubTypes { SubTypes(const std::vector<HeapType>& types) : types(types) { - if (getTypeSystem() != TypeSystem::Nominal && - getTypeSystem() != TypeSystem::Isorecursive) { - Fatal() << "SubTypes requires explicit supers"; - } for (auto type : types) { note(type); } |