@@ -253,6 +253,9 @@ public boolean checkAssertions() {
253253 return true ;
254254 }
255255
256+ public boolean shouldVerifyWordFactory (@ SuppressWarnings ("unused" ) ResolvedJavaMethod method ) {
257+ return true ;
258+ }
256259 }
257260
258261 @ Test
@@ -416,7 +419,7 @@ public static void runTest(InvariantsTool tool) {
416419 graphBuilderSuite .apply (graph , context );
417420 // update phi stamps
418421 graph .getNodes ().filter (PhiNode .class ).forEach (PhiNode ::inferStamp );
419- checkGraph (verifiers , context , graph );
422+ checkGraph (verifiers , context , graph , tool );
420423 errors .add (String .format ("Expected error while checking %s" , m ));
421424 } catch (VerificationError e ) {
422425 // expected!
@@ -477,7 +480,7 @@ public static void runTest(InvariantsTool tool) {
477480 // update phi stamps
478481 graph .getNodes ().filter (PhiNode .class ).forEach (PhiNode ::inferStamp );
479482 collectOptionFieldUsages (optionFieldUsages , optionDescriptorsType , method , graph );
480- checkGraph (verifiers , context , graph );
483+ checkGraph (verifiers , context , graph , tool );
481484 } catch (VerificationError e ) {
482485 errors .add (e .getMessage ());
483486 } catch (BailoutException e ) {
@@ -701,13 +704,15 @@ private static void checkMethod(ResolvedJavaMethod method) {
701704 /**
702705 * Checks the invariants for a single graph.
703706 */
704- private static void checkGraph (List <VerifyPhase <CoreProviders >> verifiers , HighTierContext context , StructuredGraph graph ) {
707+ private static void checkGraph (List <VerifyPhase <CoreProviders >> verifiers , HighTierContext context , StructuredGraph graph , InvariantsTool tool ) {
705708 for (VerifyPhase <CoreProviders > verifier : verifiers ) {
706- if (!(verifier instanceof VerifyUsageWithEquals ) || shouldVerifyEquals (graph .method ())) {
707- verifier .apply (graph , context );
708- } else {
709- verifier .apply (graph , context );
709+ if (verifier instanceof VerifyUsageWithEquals && !shouldVerifyEquals (graph .method ())) {
710+ continue ;
711+ }
712+ if (verifier instanceof VerifyWordFactoryUsage && !tool .shouldVerifyWordFactory (graph .method ())) {
713+ continue ;
710714 }
715+ verifier .apply (graph , context );
711716 }
712717 if (graph .method ().isBridge ()) {
713718 BridgeMethodUtils .getBridgedMethod (graph .method ());
0 commit comments