Search in sources :

Example 1 with RuntimeBytecodeParser

use of com.oracle.svm.graal.hosted.GraalFeature.RuntimeBytecodeParser in project graal by oracle.

the class Target_com_oracle_truffle_api_interop_java_ObjectProxyHandler method handleNeverPartOfCompilation.

private boolean handleNeverPartOfCompilation(GraphBuilderContext b, ResolvedJavaMethod targetMethod, ValueNode messageNode) {
    String message = "CompilerAsserts.neverPartOfCompilation()";
    if (messageNode != null && messageNode.isConstant()) {
        message = messageNode.asConstant().toValueString();
    }
    NeverPartOfCompilationNode neverPartOfCompilation = b.add(new NeverPartOfCompilationNode(message));
    if (Options.TruffleCheckNeverPartOfCompilation.getValue()) {
        if (neverPartOfCompilation.stateAfter().getMethod().getDeclaringClass().equals(targetMethod.getDeclaringClass())) {
        /* Ignore internal use from another method in CompilerAsserts class. */
        } else {
            CallTreeNode callerNode = ((RuntimeBytecodeParser) b).getCallTreeNode();
            CallTreeNode calleeNode = new CallTreeNode(targetMethod, targetMethod, callerNode, callerNode.getLevel() + 1, GraalFeature.buildSourceReference(neverPartOfCompilation.stateAfter()));
            neverPartOfCompilationViolations.add(calleeNode);
        }
    }
    return true;
}
Also used : CallTreeNode(com.oracle.svm.graal.hosted.GraalFeature.CallTreeNode) NeverPartOfCompilationNode(org.graalvm.compiler.truffle.compiler.nodes.asserts.NeverPartOfCompilationNode) RuntimeBytecodeParser(com.oracle.svm.graal.hosted.GraalFeature.RuntimeBytecodeParser)

Aggregations

CallTreeNode (com.oracle.svm.graal.hosted.GraalFeature.CallTreeNode)1 RuntimeBytecodeParser (com.oracle.svm.graal.hosted.GraalFeature.RuntimeBytecodeParser)1 NeverPartOfCompilationNode (org.graalvm.compiler.truffle.compiler.nodes.asserts.NeverPartOfCompilationNode)1