< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java

Print this page




 251         testVirtualizableEffects(ValidEffectNodeAddOrUnique.class);
 252     }
 253 
 254     @Test
 255     public void testValidAddWithoutUniqueWithInputs() {
 256         testVirtualizableEffects(ValidEffectNodeAddWithoutUniqueWithInputs.class);
 257     }
 258 
 259     @Test
 260     public void testValidAddOrUniqueWithInputs() {
 261         testVirtualizableEffects(ValidEffectNodeAddOrUniqueWithInputs.class);
 262     }
 263 
 264     @SuppressWarnings("try")
 265     private static void testVirtualizableEffects(Class<?> c) {
 266         RuntimeProvider rt = Graal.getRequiredCapability(RuntimeProvider.class);
 267         Providers providers = rt.getHostBackend().getProviders();
 268         MetaAccessProvider metaAccess = providers.getMetaAccess();
 269         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
 270         Plugins plugins = new Plugins(new InvocationPlugins());
 271         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
 272         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
 273         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
 274         OptionValues options = getInitialOptions();
 275         DebugContext debug = DebugContext.create(options, DebugHandlersFactory.LOADER);
 276         for (Method m : c.getDeclaredMethods()) {
 277             if (!Modifier.isNative(m.getModifiers()) && !Modifier.isAbstract(m.getModifiers())) {
 278                 ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
 279                 StructuredGraph graph = new StructuredGraph.Builder(options, debug).method(method).build();
 280                 graphBuilderSuite.apply(graph, context);
 281                 try (DebugCloseable s = debug.disableIntercept()) {
 282                     new VerifyVirtualizableUsage().apply(graph, context);
 283                 }
 284             }
 285         }
 286     }
 287 }


 251         testVirtualizableEffects(ValidEffectNodeAddOrUnique.class);
 252     }
 253 
 254     @Test
 255     public void testValidAddWithoutUniqueWithInputs() {
 256         testVirtualizableEffects(ValidEffectNodeAddWithoutUniqueWithInputs.class);
 257     }
 258 
 259     @Test
 260     public void testValidAddOrUniqueWithInputs() {
 261         testVirtualizableEffects(ValidEffectNodeAddOrUniqueWithInputs.class);
 262     }
 263 
 264     @SuppressWarnings("try")
 265     private static void testVirtualizableEffects(Class<?> c) {
 266         RuntimeProvider rt = Graal.getRequiredCapability(RuntimeProvider.class);
 267         Providers providers = rt.getHostBackend().getProviders();
 268         MetaAccessProvider metaAccess = providers.getMetaAccess();
 269         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
 270         Plugins plugins = new Plugins(new InvocationPlugins());
 271         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true).withUnresolvedIsError(true);
 272         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
 273         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
 274         OptionValues options = getInitialOptions();
 275         DebugContext debug = DebugContext.create(options, DebugHandlersFactory.LOADER);
 276         for (Method m : c.getDeclaredMethods()) {
 277             if (!Modifier.isNative(m.getModifiers()) && !Modifier.isAbstract(m.getModifiers())) {
 278                 ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
 279                 StructuredGraph graph = new StructuredGraph.Builder(options, debug).method(method).build();
 280                 graphBuilderSuite.apply(graph, context);
 281                 try (DebugCloseable s = debug.disableIntercept()) {
 282                     new VerifyVirtualizableUsage().apply(graph, context);
 283                 }
 284             }
 285         }
 286     }
 287 }
< prev index next >