Search in sources :

Example 1 with JavaMethod

use of jdk.vm.ci.meta.JavaMethod in project graal by oracle.

the class NodeSourcePosition method verifyCaller.

private static boolean verifyCaller(NodeSourcePosition current, NodeSourcePosition caller) {
    if (!STRICT_SOURCE_POSITION) {
        return true;
    }
    if (BytecodeFrame.isPlaceholderBci(caller.getBCI())) {
        return true;
    }
    int opcode = BytecodeDisassembler.getBytecodeAt(caller.getMethod(), caller.getBCI());
    JavaMethod method = BytecodeDisassembler.getInvokedMethodAt(caller.getMethod(), caller.getBCI());
    /*
         * It's not really possible to match the declaring classes since this might be an interface
         * invoke. Matching name and signature probably provides enough accuracy.
         */
    assert method == null || (method.getName().equals(current.getMethod().getName()) && method.getSignature().equals(current.getMethod().getSignature())) || caller.getMethod().getName().equals("linkToTargetMethod") || opcode == Bytecodes.INVOKEDYNAMIC || caller.getMethod().getDeclaringClass().getName().startsWith("Ljava/lang/invoke/LambdaForm$") || current.getMethod().getName().equals("callInlined") : "expected " + method + " but found " + current.getMethod();
    return true;
}
Also used : JavaMethod(jdk.vm.ci.meta.JavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Example 2 with JavaMethod

use of jdk.vm.ci.meta.JavaMethod in project graal by oracle.

the class BytecodeParser method lookupMethod.

private JavaMethod lookupMethod(int cpi, int opcode) {
    maybeEagerlyResolve(cpi, opcode);
    JavaMethod result = constantPool.lookupMethod(cpi, opcode);
    assert !graphBuilderConfig.unresolvedIsError() || result instanceof ResolvedJavaMethod : result;
    return result;
}
Also used : JavaMethod(jdk.vm.ci.meta.JavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Example 3 with JavaMethod

use of jdk.vm.ci.meta.JavaMethod in project graal by oracle.

the class BytecodeParser method genInvokeInterface.

protected void genInvokeInterface(int cpi, int opcode) {
    JavaMethod target = lookupMethod(cpi, opcode);
    genInvokeInterface(target);
}
Also used : JavaMethod(jdk.vm.ci.meta.JavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Example 4 with JavaMethod

use of jdk.vm.ci.meta.JavaMethod in project graal by oracle.

the class BytecodeParser method genInvokeStatic.

protected void genInvokeStatic(int cpi, int opcode) {
    JavaMethod target = lookupMethod(cpi, opcode);
    assert !uninitializedIsError || (target instanceof ResolvedJavaMethod && ((ResolvedJavaMethod) target).getDeclaringClass().isInitialized()) : target;
    genInvokeStatic(target);
}
Also used : JavaMethod(jdk.vm.ci.meta.JavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Example 5 with JavaMethod

use of jdk.vm.ci.meta.JavaMethod in project graal by oracle.

the class BytecodeParser method genInvokeVirtual.

protected void genInvokeVirtual(int cpi, int opcode) {
    JavaMethod target = lookupMethod(cpi, opcode);
    genInvokeVirtual(target);
}
Also used : JavaMethod(jdk.vm.ci.meta.JavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Aggregations

JavaMethod (jdk.vm.ci.meta.JavaMethod)13 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)12 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)3 DebugDumpScope (org.graalvm.compiler.debug.DebugDumpScope)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1 ArrayList (java.util.ArrayList)1 Formattable (java.util.Formattable)1 Formatter (java.util.Formatter)1 InstalledCode (jdk.vm.ci.code.InstalledCode)1 ConstantPool (jdk.vm.ci.meta.ConstantPool)1 CompilationResult (org.graalvm.compiler.code.CompilationResult)1 CompilationIdentifier (org.graalvm.compiler.core.common.CompilationIdentifier)1 DebugConfig.asJavaMethod (org.graalvm.compiler.debug.DebugConfig.asJavaMethod)1 DebugContext (org.graalvm.compiler.debug.DebugContext)1 Graph (org.graalvm.compiler.graph.Graph)1 Node (org.graalvm.compiler.graph.Node)1 DirectCallTargetNode (org.graalvm.compiler.nodes.DirectCallTargetNode)1 Invoke (org.graalvm.compiler.nodes.Invoke)1 LoweredCallTargetNode (org.graalvm.compiler.nodes.LoweredCallTargetNode)1