@@ -3696,10 +3696,13 @@ void FunctionValidator::visitStructCmpxchg(StructCmpxchg* curr) {
36963696}
36973697
36983698void FunctionValidator::visitStructWait (StructWait* curr) {
3699- shouldBeTrue (
3700- !getModule () || getModule ()->features .hasSharedEverything (),
3701- curr,
3702- " struct.wait requires shared-everything [--enable-shared-everything]" );
3699+ FeatureSet expected =
3700+ FeatureSet::GC | FeatureSet::SharedEverything | FeatureSet::ReferenceTypes;
3701+ if (!shouldBeTrue (expected.isSubsetOf (getModule ()->features ),
3702+ curr,
3703+ " struct.wait requires additional features" )) {
3704+ getStream () << getMissingFeaturesList (*getModule (), expected) << ' \n ' ;
3705+ }
37033706
37043707 shouldBeSubType (curr->waitqueue ->type ,
37053708 Type (HeapTypes::sharedWaitqueue, Nullable),
@@ -3747,17 +3750,23 @@ void FunctionValidator::visitStructWait(StructWait* curr) {
37473750}
37483751
37493752void FunctionValidator::visitWaitqueueNew (WaitqueueNew* curr) {
3750- shouldBeTrue (
3751- !getModule () || getModule ()->features .hasSharedEverything (),
3752- curr,
3753- " waitqueue.new requires shared-everything [--enable-shared-everything]" );
3753+ FeatureSet expected =
3754+ FeatureSet::GC | FeatureSet::SharedEverything | FeatureSet::ReferenceTypes;
3755+ if (!shouldBeTrue (expected.isSubsetOf (getModule ()->features ),
3756+ curr,
3757+ " waitqueue.new requires additional features" )) {
3758+ getStream () << getMissingFeaturesList (*getModule (), expected) << ' \n ' ;
3759+ }
37543760}
37553761
37563762void FunctionValidator::visitWaitqueueNotify (WaitqueueNotify* curr) {
3757- shouldBeTrue (
3758- !getModule () || getModule ()->features .hasSharedEverything (),
3759- curr,
3760- " waitqueue.notify requires shared-everything [--enable-shared-everything]" );
3763+ FeatureSet expected =
3764+ FeatureSet::GC | FeatureSet::SharedEverything | FeatureSet::ReferenceTypes;
3765+ if (!shouldBeTrue (expected.isSubsetOf (getModule ()->features ),
3766+ curr,
3767+ " waitqueue.notify requires additional features" )) {
3768+ getStream () << getMissingFeaturesList (*getModule (), expected) << ' \n ' ;
3769+ }
37613770
37623771 shouldBeSubType (
37633772 curr->waitqueue ->type ,
0 commit comments