Search in sources :

Example 16 with TruffleInlining

use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.

the class BasicTruffleInliningTest method testRecursiveInline.

@Test
public void testRecursiveInline() {
    TruffleInlining decisions = builder.target("recursive").calls("recursive").buildDecisions();
    Assert.assertEquals(TruffleCompilerOptions.getValue(TruffleMaximumRecursiveInlining).intValue(), countInlines(decisions, "recursive"));
}
Also used : TruffleInlining(org.graalvm.compiler.truffle.runtime.TruffleInlining) Test(org.junit.Test)

Example 17 with TruffleInlining

use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.

the class BasicTruffleInliningTest method testIndirectRecursiveInline.

@Test
public void testIndirectRecursiveInline() {
    // @formatter:off
    TruffleInlining decisions = builder.target("callee").calls("recursive").target("recursive").calls("callee").buildDecisions();
    // @formatter:on
    Assert.assertEquals(TruffleCompilerOptions.getValue(TruffleMaximumRecursiveInlining).intValue(), countInlines(decisions, "recursive"));
    Assert.assertEquals(TruffleCompilerOptions.getValue(TruffleMaximumRecursiveInlining) + 1, countInlines(decisions, "callee"));
}
Also used : TruffleInlining(org.graalvm.compiler.truffle.runtime.TruffleInlining) Test(org.junit.Test)

Example 18 with TruffleInlining

use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.

the class BasicTruffleInliningTest method testInlineIntoBigFunctions.

@Test
public void testInlineIntoBigFunctions() {
    // @formatter:off
    TruffleInlining decisions = builder.target("callee").target("caller", TruffleCompilerOptions.getValue(TruffleInliningMaxCallerSize) - 3).calls("callee").buildDecisions();
    // @formatter:on
    assertInlined(decisions, "callee");
}
Also used : TruffleInlining(org.graalvm.compiler.truffle.runtime.TruffleInlining) Test(org.junit.Test)

Example 19 with TruffleInlining

use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.

the class BasicTruffleInliningTest method testWideInline.

@Test
public void testWideInline() {
    int width = 1000;
    builder.target("leaf").target("main");
    for (Integer i = 0; i < width; i++) {
        builder.calls("leaf");
    }
    TruffleInlining decisions = builder.buildDecisions();
    Assert.assertEquals(width, countInlines(decisions, "leaf"));
}
Also used : TruffleInlining(org.graalvm.compiler.truffle.runtime.TruffleInlining) Test(org.junit.Test)

Example 20 with TruffleInlining

use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.

the class BasicTruffleInliningTest method testDontInlineIntoBigFunctions.

@Test
public void testDontInlineIntoBigFunctions() {
    // @formatter:off
    TruffleInlining decisions = builder.target("callee").target("caller", TruffleCompilerOptions.getValue(TruffleInliningMaxCallerSize)).calls("callee").buildDecisions();
    // @formatter:on
    assertNotInlined(decisions, "callee");
}
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