summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/binaryen-c.cpp3
-rw-r--r--src/binaryen-c.h1
-rw-r--r--src/js/binaryen.js-post.js1
-rw-r--r--src/passes/MergeSimilarFunctions.cpp3
-rw-r--r--src/tools/fuzzing/fuzzing.cpp9
-rw-r--r--src/tools/tool-options.h2
-rw-r--r--src/wasm-binary.h1
-rw-r--r--src/wasm-features.h23
-rw-r--r--src/wasm/wasm-binary.cpp5
-rw-r--r--src/wasm/wasm-validator.cpp25
-rw-r--r--src/wasm/wasm.cpp1
11 files changed, 19 insertions, 55 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index c96411ae0..914e37695 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -377,9 +377,6 @@ BinaryenFeatures BinaryenFeatureGC(void) {
BinaryenFeatures BinaryenFeatureMemory64(void) {
return static_cast<BinaryenFeatures>(FeatureSet::Memory64);
}
-BinaryenFeatures BinaryenFeatureTypedFunctionReferences(void) {
- return static_cast<BinaryenFeatures>(FeatureSet::TypedFunctionReferences);
-}
BinaryenFeatures BinaryenFeatureRelaxedSIMD(void) {
return static_cast<BinaryenFeatures>(FeatureSet::RelaxedSIMD);
}
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index f3e305d03..4e37b177a 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -202,7 +202,6 @@ BINARYEN_API BinaryenFeatures BinaryenFeatureReferenceTypes(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureMultivalue(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureGC(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureMemory64(void);
-BINARYEN_API BinaryenFeatures BinaryenFeatureTypedFunctionReferences(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureRelaxedSIMD(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureExtendedConst(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureStrings(void);
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index f9e4d0d44..158e3f29b 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -164,7 +164,6 @@ function initializeConstants() {
'Multivalue',
'GC',
'Memory64',
- 'TypedFunctionReferences',
'RelaxedSIMD',
'ExtendedConst',
'Strings',
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<EquivalentClass>& classes,
diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp
index e00c7f4fa..3d84af26a 100644
--- a/src/tools/fuzzing/fuzzing.cpp
+++ b/src/tools/fuzzing/fuzzing.cpp
@@ -938,8 +938,7 @@ Expression* TranslateToFuzzReader::_makeConcrete(Type type) {
WeightedOption{&Self::makeBreak, Important},
&Self::makeCall,
&Self::makeCallIndirect)
- .add(FeatureSet::TypedFunctionReferences | FeatureSet::ReferenceTypes,
- &Self::makeCallRef);
+ .add(FeatureSet::GC | FeatureSet::ReferenceTypes, &Self::makeCallRef);
}
if (type.isSingle()) {
options
@@ -999,8 +998,7 @@ Expression* TranslateToFuzzReader::_makenone() {
&Self::makeGlobalSet)
.add(FeatureSet::BulkMemory, &Self::makeBulkMemory)
.add(FeatureSet::Atomics, &Self::makeAtomic)
- .add(FeatureSet::TypedFunctionReferences | FeatureSet::ReferenceTypes,
- &Self::makeCallRef);
+ .add(FeatureSet::GC | FeatureSet::ReferenceTypes, &Self::makeCallRef);
return (this->*pick(options))(Type::none);
}
@@ -1025,8 +1023,7 @@ Expression* TranslateToFuzzReader::_makeunreachable() {
&Self::makeSwitch,
&Self::makeDrop,
&Self::makeReturn)
- .add(FeatureSet::TypedFunctionReferences | FeatureSet::ReferenceTypes,
- &Self::makeCallRef);
+ .add(FeatureSet::GC | FeatureSet::ReferenceTypes, &Self::makeCallRef);
return (this->*pick(options))(Type::unreachable);
}
diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h
index 0cc1722a7..8709fb07f 100644
--- a/src/tools/tool-options.h
+++ b/src/tools/tool-options.h
@@ -89,8 +89,6 @@ struct ToolOptions : public Options {
.addFeature(FeatureSet::Multivalue, "multivalue functions")
.addFeature(FeatureSet::GC, "garbage collection")
.addFeature(FeatureSet::Memory64, "memory64")
- .addFeature(FeatureSet::TypedFunctionReferences,
- "typed function references")
.addFeature(FeatureSet::GCNNLocals, "GC non-null locals")
.addFeature(FeatureSet::RelaxedSIMD, "relaxed SIMD")
.addFeature(FeatureSet::ExtendedConst, "extended const expressions")
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index ab55b6f50..14a77ea41 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -434,7 +434,6 @@ extern const char* ReferenceTypesFeature;
extern const char* MultivalueFeature;
extern const char* GCFeature;
extern const char* Memory64Feature;
-extern const char* TypedFunctionReferencesFeature;
extern const char* RelaxedSIMDFeature;
extern const char* ExtendedConstFeature;
extern const char* StringsFeature;
diff --git a/src/wasm-features.h b/src/wasm-features.h
index 4b3f7c85a..7bdefd02a 100644
--- a/src/wasm-features.h
+++ b/src/wasm-features.h
@@ -38,18 +38,17 @@ struct FeatureSet {
Multivalue = 1 << 9,
GC = 1 << 10,
Memory64 = 1 << 11,
- TypedFunctionReferences = 1 << 12,
// TODO: Remove this feature when the wasm spec stabilizes.
- GCNNLocals = 1 << 13,
- RelaxedSIMD = 1 << 14,
- ExtendedConst = 1 << 15,
- Strings = 1 << 16,
- MultiMemories = 1 << 17,
+ GCNNLocals = 1 << 12,
+ RelaxedSIMD = 1 << 13,
+ ExtendedConst = 1 << 14,
+ Strings = 1 << 15,
+ MultiMemories = 1 << 16,
// GCNNLocals are opt-in: merely asking for "All" does not apply them. To
// get all possible values use AllPossible. See setAll() below for more
// details.
- All = ((1 << 18) - 1) & ~GCNNLocals,
- AllPossible = (1 << 18) - 1,
+ All = ((1 << 17) - 1) & ~GCNNLocals,
+ AllPossible = (1 << 17) - 1,
};
static std::string toString(Feature f) {
@@ -78,8 +77,6 @@ struct FeatureSet {
return "gc";
case Memory64:
return "memory64";
- case TypedFunctionReferences:
- return "typed-function-references";
case GCNNLocals:
return "gc-nn-locals";
case RelaxedSIMD:
@@ -130,9 +127,6 @@ struct FeatureSet {
bool hasMultivalue() const { return (features & Multivalue) != 0; }
bool hasGC() const { return (features & GC) != 0; }
bool hasMemory64() const { return (features & Memory64) != 0; }
- bool hasTypedFunctionReferences() const {
- return (features & TypedFunctionReferences) != 0;
- }
bool hasGCNNLocals() const { return (features & GCNNLocals) != 0; }
bool hasRelaxedSIMD() const { return (features & RelaxedSIMD) != 0; }
bool hasExtendedConst() const { return (features & ExtendedConst) != 0; }
@@ -155,9 +149,6 @@ struct FeatureSet {
void setMultivalue(bool v = true) { set(Multivalue, v); }
void setGC(bool v = true) { set(GC, v); }
void setMemory64(bool v = true) { set(Memory64, v); }
- void setTypedFunctionReferences(bool v = true) {
- set(TypedFunctionReferences, v);
- }
void setGCNNLocals(bool v = true) { set(GCNNLocals, v); }
void setRelaxedSIMD(bool v = true) { set(RelaxedSIMD, v); }
void setExtendedConst(bool v = true) { set(ExtendedConst, v); }
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 03ae5ce5a..9540bd8f3 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -1218,8 +1218,6 @@ void WasmBinaryWriter::writeFeaturesSection() {
return BinaryConsts::UserSections::GCFeature;
case FeatureSet::Memory64:
return BinaryConsts::UserSections::Memory64Feature;
- case FeatureSet::TypedFunctionReferences:
- return BinaryConsts::UserSections::TypedFunctionReferencesFeature;
case FeatureSet::RelaxedSIMD:
return BinaryConsts::UserSections::RelaxedSIMDFeature;
case FeatureSet::ExtendedConst:
@@ -3519,9 +3517,6 @@ void WasmBinaryBuilder::readFeatures(size_t payloadLen) {
feature = FeatureSet::GC;
} else if (name == BinaryConsts::UserSections::Memory64Feature) {
feature = FeatureSet::Memory64;
- } else if (name ==
- BinaryConsts::UserSections::TypedFunctionReferencesFeature) {
- feature = FeatureSet::TypedFunctionReferences;
} else if (name == BinaryConsts::UserSections::RelaxedSIMDFeature) {
feature = FeatureSet::RelaxedSIMD;
} else if (name == BinaryConsts::UserSections::ExtendedConstFeature) {
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index c1a8eea7f..a6356766e 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2450,9 +2450,8 @@ void FunctionValidator::visitTupleExtract(TupleExtract* curr) {
void FunctionValidator::visitCallRef(CallRef* curr) {
validateReturnCall(curr);
- shouldBeTrue(getModule()->features.hasTypedFunctionReferences(),
- curr,
- "call_ref requires typed-function-references to be enabled");
+ shouldBeTrue(
+ getModule()->features.hasGC(), curr, "call_ref requires gc to be enabled");
if (curr->target->type != Type::unreachable) {
if (shouldBeTrue(curr->target->type.isFunction(),
curr,
@@ -3228,11 +3227,11 @@ static void validateTables(Module& module, ValidationInfo& info) {
"Only function reference types or externref are valid "
"for table type (when GC is disabled)");
}
- if (!module.features.hasTypedFunctionReferences()) {
+ if (!module.features.hasGC()) {
info.shouldBeTrue(table->type == funcref || table->type == externref,
"table",
"Only funcref and externref are valid for table type "
- "(when typed-function references are disabled)");
+ "(when gc is disabled)");
}
}
@@ -3267,18 +3266,10 @@ static void validateTables(Module& module, ValidationInfo& info) {
module.features),
segment->offset,
"table segment offset should be reasonable");
- if (module.features.hasTypedFunctionReferences()) {
- info.shouldBeTrue(
- Type::isSubType(segment->type, table->type),
- "elem",
- "element segment type must be a subtype of the table type");
- } else {
- info.shouldBeEqual(
- segment->type,
- table->type,
- "elem",
- "element segment type must be the same as the table type");
- }
+ info.shouldBeTrue(
+ Type::isSubType(segment->type, table->type),
+ "elem",
+ "element segment type must be a subtype of the table type");
validator.validate(segment->offset);
} else {
info.shouldBeTrue(!segment->offset,
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index af40896ce..34bcf68c7 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -47,7 +47,6 @@ const char* ReferenceTypesFeature = "reference-types";
const char* MultivalueFeature = "multivalue";
const char* GCFeature = "gc";
const char* Memory64Feature = "memory64";
-const char* TypedFunctionReferencesFeature = "typed-function-references";
const char* RelaxedSIMDFeature = "relaxed-simd";
const char* ExtendedConstFeature = "extended-const";
const char* StringsFeature = "strings";