Search in sources :

Example 1 with EspressoRootNode

use of com.oracle.truffle.espresso.nodes.EspressoRootNode in project graal by oracle.

the class JDWPContextImpl method clearFrameMonitors.

@Override
public void clearFrameMonitors(CallFrame frame) {
    RootNode rootNode = frame.getRootNode();
    if (rootNode instanceof EspressoRootNode) {
        EspressoRootNode espressoRootNode = (EspressoRootNode) rootNode;
        espressoRootNode.abortInternalMonitors(frame.getFrame());
    }
}
Also used : EspressoRootNode(com.oracle.truffle.espresso.nodes.EspressoRootNode) RootNode(com.oracle.truffle.api.nodes.RootNode) EspressoRootNode(com.oracle.truffle.espresso.nodes.EspressoRootNode)

Example 2 with EspressoRootNode

use of com.oracle.truffle.espresso.nodes.EspressoRootNode in project graal by oracle.

the class JDWPContextImpl method getNextBCI.

@Override
public int getNextBCI(RootNode callerRoot, Frame frame) {
    if (callerRoot instanceof EspressoRootNode) {
        EspressoRootNode espressoRootNode = (EspressoRootNode) callerRoot;
        int bci = (int) readBCIFromFrame(callerRoot, frame);
        if (bci != -1) {
            BytecodeStream bs = new BytecodeStream(espressoRootNode.getMethodVersion().getOriginalCode());
            return bs.nextBCI(bci);
        }
    }
    return -1;
}
Also used : BytecodeStream(com.oracle.truffle.espresso.bytecode.BytecodeStream) EspressoRootNode(com.oracle.truffle.espresso.nodes.EspressoRootNode)

Example 3 with EspressoRootNode

use of com.oracle.truffle.espresso.nodes.EspressoRootNode in project graal by oracle.

the class InvokeStaticQuickNode method execute.

@Override
public int execute(VirtualFrame frame) {
    // Support for AccessController.doPrivileged.
    if (callsDoPrivileged) {
        EspressoRootNode rootNode = (EspressoRootNode) getRootNode();
        if (rootNode != null) {
            // Put cookie in the caller frame.
            rootNode.setFrameId(frame, VM.GlobalFrameIDs.getID());
        }
    }
    Object[] args = BytecodeNode.popArguments(frame, top, false, method.getMethod().getParsedSignature());
    Object result = invokeStatic.execute(args);
    if (!returnsPrimitiveType) {
        getBytecodeNode().checkNoForeignObjectAssumption((StaticObject) result);
    }
    return (getResultAt() - top) + BytecodeNode.putKind(frame, getResultAt(), result, method.getMethod().getReturnKind());
}
Also used : EspressoRootNode(com.oracle.truffle.espresso.nodes.EspressoRootNode) StaticObject(com.oracle.truffle.espresso.runtime.StaticObject)

Example 4 with EspressoRootNode

use of com.oracle.truffle.espresso.nodes.EspressoRootNode in project graal by oracle.

the class VM method getRawEspressoRootFromFrame.

/**
 * Returns the espresso root node for this frame, event if it comes from a different context.
 */
private static EspressoRootNode getRawEspressoRootFromFrame(FrameInstance frameInstance) {
    if (frameInstance.getCallTarget() instanceof RootCallTarget) {
        RootCallTarget callTarget = (RootCallTarget) frameInstance.getCallTarget();
        RootNode rootNode = callTarget.getRootNode();
        if (rootNode instanceof EspressoRootNode) {
            return ((EspressoRootNode) rootNode);
        }
    }
    return null;
}
Also used : RootNode(com.oracle.truffle.api.nodes.RootNode) EspressoRootNode(com.oracle.truffle.espresso.nodes.EspressoRootNode) EspressoRootNode(com.oracle.truffle.espresso.nodes.EspressoRootNode) RootCallTarget(com.oracle.truffle.api.RootCallTarget)

Example 5 with EspressoRootNode

use of com.oracle.truffle.espresso.nodes.EspressoRootNode in project graal by oracle.

the class VM method getMethodFromFrame.

@TruffleBoundary
public Method getMethodFromFrame(FrameInstance frameInstance) {
    EspressoRootNode root = getRawEspressoRootFromFrame(frameInstance);
    if (root == null) {
        return null;
    }
    Method method = root.getMethod();
    if (method.getContext() != getContext()) {
        return null;
    }
    return method;
}
Also used : EspressoRootNode(com.oracle.truffle.espresso.nodes.EspressoRootNode) Method(com.oracle.truffle.espresso.impl.Method) TruffleBoundary(com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)

Aggregations

EspressoRootNode (com.oracle.truffle.espresso.nodes.EspressoRootNode)9 RootNode (com.oracle.truffle.api.nodes.RootNode)4 Method (com.oracle.truffle.espresso.impl.Method)3 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)2 RootCallTarget (com.oracle.truffle.api.RootCallTarget)2 BytecodeNode (com.oracle.truffle.espresso.nodes.BytecodeNode)2 TruffleStackTrace (com.oracle.truffle.api.TruffleStackTrace)1 TruffleStackTraceElement (com.oracle.truffle.api.TruffleStackTraceElement)1 Node (com.oracle.truffle.api.nodes.Node)1 BytecodeStream (com.oracle.truffle.espresso.bytecode.BytecodeStream)1 CallFrame (com.oracle.truffle.espresso.jdwp.api.CallFrame)1 MonitorStackInfo (com.oracle.truffle.espresso.jdwp.api.MonitorStackInfo)1 QuickNode (com.oracle.truffle.espresso.nodes.quick.QuickNode)1 EspressoException (com.oracle.truffle.espresso.runtime.EspressoException)1 StaticObject (com.oracle.truffle.espresso.runtime.StaticObject)1 ArrayList (java.util.ArrayList)1