232 public void testLogInvalidConcat02Inc() {
233 testDebugUsageClass(InvalidCCP_Concat02Inc.class);
234 }
235
236 @Test
237 public void testLogValidToStringInc() {
238 testDebugUsageClass(ValidCCP_ToStringInc.class);
239 }
240
241 @Test
242 public void testLogValidConcatInc() {
243 testDebugUsageClass(ValidCCP_ConcatInc.class);
244 }
245
246 @SuppressWarnings("try")
247 private static void testDebugUsageClass(Class<?> c) {
248 RuntimeProvider rt = Graal.getRequiredCapability(RuntimeProvider.class);
249 Providers providers = rt.getHostBackend().getProviders();
250 MetaAccessProvider metaAccess = providers.getMetaAccess();
251 PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
252 Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
253 GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
254 graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
255 HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
256 for (Method m : c.getDeclaredMethods()) {
257 if (!Modifier.isNative(m.getModifiers()) && !Modifier.isAbstract(m.getModifiers())) {
258 ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
259 StructuredGraph graph = new StructuredGraph(method, AllowAssumptions.NO, INVALID_COMPILATION_ID);
260 graphBuilderSuite.apply(graph, context);
261 try (DebugConfigScope s = Debug.disableIntercept()) {
262 new VerifyDebugUsage().apply(graph, context);
263 }
264 }
265 }
266 }
267 }
|
232 public void testLogInvalidConcat02Inc() {
233 testDebugUsageClass(InvalidCCP_Concat02Inc.class);
234 }
235
236 @Test
237 public void testLogValidToStringInc() {
238 testDebugUsageClass(ValidCCP_ToStringInc.class);
239 }
240
241 @Test
242 public void testLogValidConcatInc() {
243 testDebugUsageClass(ValidCCP_ConcatInc.class);
244 }
245
246 @SuppressWarnings("try")
247 private static void testDebugUsageClass(Class<?> c) {
248 RuntimeProvider rt = Graal.getRequiredCapability(RuntimeProvider.class);
249 Providers providers = rt.getHostBackend().getProviders();
250 MetaAccessProvider metaAccess = providers.getMetaAccess();
251 PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
252 Plugins plugins = new Plugins(new InvocationPlugins());
253 GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
254 graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
255 HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
256 for (Method m : c.getDeclaredMethods()) {
257 if (!Modifier.isNative(m.getModifiers()) && !Modifier.isAbstract(m.getModifiers())) {
258 ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
259 StructuredGraph graph = new StructuredGraph(method, AllowAssumptions.NO, INVALID_COMPILATION_ID);
260 graphBuilderSuite.apply(graph, context);
261 try (DebugConfigScope s = Debug.disableIntercept()) {
262 new VerifyDebugUsage().apply(graph, context);
263 }
264 }
265 }
266 }
267 }
|