Search in sources :

Example 21 with TruffleInlining

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]);
}
Also used : TruffleInlining(org.graalvm.compiler.truffle.runtime.TruffleInlining) Test(org.junit.Test)

Aggregations

TruffleInlining (org.graalvm.compiler.truffle.runtime.TruffleInlining)21 Test (org.junit.Test)16 DebugContext (org.graalvm.compiler.debug.DebugContext)4 OptionValues (org.graalvm.compiler.options.OptionValues)4 DefaultInliningPolicy (org.graalvm.compiler.truffle.runtime.DefaultInliningPolicy)4 SpeculationLog (jdk.vm.ci.meta.SpeculationLog)2 CompilationIdentifier (org.graalvm.compiler.core.common.CompilationIdentifier)2 TruffleDebugJavaMethod (org.graalvm.compiler.truffle.common.TruffleDebugJavaMethod)2 TruffleInliningPlan (org.graalvm.compiler.truffle.common.TruffleInliningPlan)2 TruffleCompilerImpl (org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl)2 GraalTruffleRuntime (org.graalvm.compiler.truffle.runtime.GraalTruffleRuntime)2 OptimizedCallTarget (org.graalvm.compiler.truffle.runtime.OptimizedCallTarget)2 RootNode (com.oracle.truffle.api.nodes.RootNode)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 Method (java.lang.reflect.Method)1 DebugCloseable (org.graalvm.compiler.debug.DebugCloseable)1 LogStream (org.graalvm.compiler.debug.LogStream)1 TTY (org.graalvm.compiler.debug.TTY)1 TruffleCompilerOptions (org.graalvm.compiler.truffle.common.TruffleCompilerOptions)1 TruffleOptionsOverrideScope (org.graalvm.compiler.truffle.common.TruffleCompilerOptions.TruffleOptionsOverrideScope)1