use of org.graalvm.compiler.phases.common.inlining.policy.InlineMethodSubstitutionsPolicy in project graal by oracle.
the class EdgesTest method testMethod.
private void testMethod(Method method, Object receiver, Object... args) {
try {
// Invoke the method to ensure it has a type profile
for (int i = 0; i < 5000; i++) {
method.invoke(receiver, args);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
ResolvedJavaMethod javaMethod = getMetaAccess().lookupJavaMethod(method);
StructuredGraph g = parseProfiled(javaMethod, AllowAssumptions.NO);
HighTierContext context = getDefaultHighTierContext();
new InliningPhase(new InlineMethodSubstitutionsPolicy(), new CanonicalizerPhase()).apply(g, context);
new CanonicalizerPhase().apply(g, context);
Assert.assertTrue(g.getNodes().filter(InstanceOfNode.class).isEmpty());
}
Aggregations