Search in sources :

Example 1 with TruffleCallBoundary

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

the class HotSpotTruffleRuntime method setDontInlineCallBoundaryMethod.

/**
 * Prevents C1 or C2 from inlining a call to a method annotated by {@link TruffleCallBoundary}
 * so that we never miss the chance to switch from the Truffle interpreter to compiled code.
 *
 * @see HotSpotTruffleCompiler#installTruffleCallBoundaryMethods()
 */
public static void setDontInlineCallBoundaryMethod() {
    MetaAccessProvider metaAccess = getMetaAccess();
    ResolvedJavaType type = metaAccess.lookupJavaType(OptimizedCallTarget.class);
    for (ResolvedJavaMethod method : type.getDeclaredMethods()) {
        if (method.getAnnotation(TruffleCallBoundary.class) != null) {
            setNotInlinableOrCompilable(method);
        }
    }
}
Also used : TruffleCallBoundary(org.graalvm.compiler.truffle.runtime.TruffleCallBoundary) MetaAccessProvider(jdk.vm.ci.meta.MetaAccessProvider) ResolvedJavaType(jdk.vm.ci.meta.ResolvedJavaType) HotSpotResolvedJavaMethod(jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Aggregations

HotSpotResolvedJavaMethod (jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod)1 MetaAccessProvider (jdk.vm.ci.meta.MetaAccessProvider)1 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)1 TruffleCallBoundary (org.graalvm.compiler.truffle.runtime.TruffleCallBoundary)1