use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.
the class BasicTruffleInliningTest method testDeepInline.
@Test
public void testDeepInline() {
// Limited to 14 at the moment because of TruffleInlining:97
int depth = 14;
builder.target("0");
for (Integer count = 0; count < depth; count++) {
Integer nextCount = count + 1;
builder.target(nextCount.toString()).calls(count.toString());
}
final int[] inlineDepth = { 0 };
TruffleInlining decisions = builder.buildDecisions();
traverseDecisions(decisions.getCallSites(), decision -> {
Assert.assertTrue(decision.shouldInline());
inlineDepth[0]++;
});
Assert.assertEquals(depth, inlineDepth[0]);
}
Aggregations