From 73b562e24e958e6d5c15aa96ddf4b2e8f31162f8 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 9 Sep 2022 18:42:15 -0700 Subject: Remove typed-function-references feature (#5030) In practice typed function references will not ship before GC and is not independently useful, so it's not necessary to have a separate feature for it. Roll the functionality previously enabled by --enable-typed-function-references into --enable-gc instead. This also avoids a problem with the ongoing implementation of the new GC bottom heap types. That change will make all ref.null instructions in Binaryen IR refer to one of the bottom heap types. But since those bottom types are introduced in GC, it's not valid to emit them in binaries unless unless GC is enabled. The fix if only reference types is enabled is to emit (ref.null func) instead of (ref.null nofunc), but that doesn't always work if typed function references are enabled because a function type more specific than func may be required. Getting rid of typed function references as a separate feature makes this a nonissue. --- src/passes/MergeSimilarFunctions.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/passes/MergeSimilarFunctions.cpp') diff --git a/src/passes/MergeSimilarFunctions.cpp b/src/passes/MergeSimilarFunctions.cpp index 9edf327fc..38cae8059 100644 --- a/src/passes/MergeSimilarFunctions.cpp +++ b/src/passes/MergeSimilarFunctions.cpp @@ -202,8 +202,7 @@ struct MergeSimilarFunctions : public Pass { // Parameterize direct calls if the module supports func ref values. bool isCallIndirectionEnabled(Module* module) const { - return module->features.hasReferenceTypes() && - module->features.hasTypedFunctionReferences(); + return module->features.hasReferenceTypes() && module->features.hasGC(); } bool areInEquvalentClass(Function* lhs, Function* rhs, Module* module); void collectEquivalentClasses(std::vector& classes, -- cgit v1.2.3