@@ -31,7 +31,9 @@ struct FeatureSet {
3131 SIMD = 1 << 3 ,
3232 BulkMemory = 1 << 4 ,
3333 SignExt = 1 << 5 ,
34- All = Atomics | MutableGlobals | TruncSat | SIMD | BulkMemory | SignExt
34+ ExceptionHandling = 1 << 6 ,
35+ All = Atomics | MutableGlobals | TruncSat | SIMD | BulkMemory | SignExt |
36+ ExceptionHandling
3537 };
3638
3739 static std::string toString (Feature f) {
@@ -48,6 +50,8 @@ struct FeatureSet {
4850 return " bulk-memory" ;
4951 case SignExt:
5052 return " sign-ext" ;
53+ case ExceptionHandling:
54+ return " exception-handling" ;
5155 default :
5256 WASM_UNREACHABLE ();
5357 }
@@ -64,6 +68,7 @@ struct FeatureSet {
6468 bool hasSIMD () const { return features & SIMD; }
6569 bool hasBulkMemory () const { return features & BulkMemory; }
6670 bool hasSignExt () const { return features & SignExt; }
71+ bool hasExceptionHandling () const { return features & ExceptionHandling; }
6772 bool hasAll () const { return features & All; }
6873
6974 void makeMVP () { features = MVP; }
@@ -76,6 +81,7 @@ struct FeatureSet {
7681 void setSIMD (bool v = true ) { set (SIMD, v); }
7782 void setBulkMemory (bool v = true ) { set (BulkMemory, v); }
7883 void setSignExt (bool v = true ) { set (SignExt, v); }
84+ void setExceptionHandling (bool v = true ) { set (ExceptionHandling, v); }
7985 void setAll (bool v = true ) { features = v ? All : MVP; }
8086
8187 void enable (const FeatureSet& other) { features |= other.features ; }
@@ -90,6 +96,9 @@ struct FeatureSet {
9096 if (hasBulkMemory ()) {
9197 f (BulkMemory);
9298 }
99+ if (hasExceptionHandling ()) {
100+ f (ExceptionHandling);
101+ }
93102 if (hasMutableGlobals ()) {
94103 f (MutableGlobals);
95104 }
0 commit comments