use of org.graalvm.compiler.phases.verify.VerifyVirtualizableUsage in project graal by oracle.
the class VerifyVirtualizableTest method testVirtualizableEffects.
@SuppressWarnings("try")
private static void testVirtualizableEffects(Class<?> c) {
RuntimeProvider rt = Graal.getRequiredCapability(RuntimeProvider.class);
Providers providers = rt.getHostBackend().getProviders();
MetaAccessProvider metaAccess = providers.getMetaAccess();
PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true).withUnresolvedIsError(true);
graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
OptionValues options = getInitialOptions();
DebugContext debug = DebugContext.create(options, DebugHandlersFactory.LOADER);
for (Method m : c.getDeclaredMethods()) {
if (!Modifier.isNative(m.getModifiers()) && !Modifier.isAbstract(m.getModifiers())) {
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
StructuredGraph graph = new StructuredGraph.Builder(options, debug).method(method).build();
graphBuilderSuite.apply(graph, context);
try (DebugCloseable s = debug.disableIntercept()) {
new VerifyVirtualizableUsage().apply(graph, context);
}
}
}
}
use of org.graalvm.compiler.phases.verify.VerifyVirtualizableUsage in project graal by oracle.
the class CheckGraalInvariants method checkGraph.
/**
* Checks the invariants for a single graph.
*/
private static void checkGraph(HighTierContext context, StructuredGraph graph) {
if (shouldVerifyEquals(graph.method())) {
// If you add a new type to test here, be sure to add appropriate
// methods to the BadUsageWithEquals class below
new VerifyUsageWithEquals(Value.class).apply(graph, context);
new VerifyUsageWithEquals(Register.class).apply(graph, context);
new VerifyUsageWithEquals(RegisterCategory.class).apply(graph, context);
new VerifyUsageWithEquals(JavaType.class).apply(graph, context);
new VerifyUsageWithEquals(JavaMethod.class).apply(graph, context);
new VerifyUsageWithEquals(JavaField.class).apply(graph, context);
new VerifyUsageWithEquals(LocationIdentity.class).apply(graph, context);
new VerifyUsageWithEquals(LIRKind.class).apply(graph, context);
new VerifyUsageWithEquals(ArithmeticOpTable.class).apply(graph, context);
new VerifyUsageWithEquals(ArithmeticOpTable.Op.class).apply(graph, context);
}
new VerifyDebugUsage().apply(graph, context);
new VerifyCallerSensitiveMethods().apply(graph, context);
new VerifyVirtualizableUsage().apply(graph, context);
new VerifyUpdateUsages().apply(graph, context);
new VerifyBailoutUsage().apply(graph, context);
new VerifyInstanceOfUsage().apply(graph, context);
new VerifyGraphAddUsage().apply(graph, context);
new VerifyGetOptionsUsage().apply(graph, context);
if (graph.method().isBridge()) {
BridgeMethodUtils.getBridgedMethod(graph.method());
}
}
Aggregations