Search in sources :

Example 11 with BaseQuickNode

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

the class BytecodeNode method quickenArrayLength.

private int quickenArrayLength(VirtualFrame frame, int top, int curBCI) {
    CompilerDirectives.transferToInterpreterAndInvalidate();
    BaseQuickNode arrayLengthNode;
    synchronized (this) {
        if (bs.currentVolatileBC(curBCI) == SLIM_QUICK) {
            arrayLengthNode = sparseNodes[curBCI];
        } else {
            arrayLengthNode = injectQuick(curBCI, new ArrayLengthQuickNode(top, curBCI), SLIM_QUICK);
        }
    }
    return arrayLengthNode.execute(frame) - Bytecodes.stackEffectOf(ARRAYLENGTH);
}
Also used : ArrayLengthQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.ArrayLengthQuickNode) BaseQuickNode(com.oracle.truffle.espresso.nodes.quick.BaseQuickNode)

Example 12 with BaseQuickNode

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

the class BytecodeNode method quickenPutField.

public int quickenPutField(VirtualFrame frame, int top, int curBCI, int opcode, int statementIndex, Field field) {
    CompilerDirectives.transferToInterpreterAndInvalidate();
    assert opcode == PUTFIELD;
    BaseQuickNode putField = tryPatchQuick(curBCI, () -> new QuickenedPutFieldNode(top, curBCI, field, statementIndex));
    return putField.execute(frame) - Bytecodes.stackEffectOf(opcode);
}
Also used : QuickenedPutFieldNode(com.oracle.truffle.espresso.nodes.quick.interop.QuickenedPutFieldNode) BaseQuickNode(com.oracle.truffle.espresso.nodes.quick.BaseQuickNode)

Example 13 with BaseQuickNode

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

the class BytecodeNode method reQuickenInvoke.

/**
 * Revert speculative quickening e.g. revert inlined fields accessors to a normal invoke.
 * INVOKEVIRTUAL -> QUICK (InlinedGetter/SetterNode) -> QUICK (InvokeVirtualNode)
 */
public int reQuickenInvoke(VirtualFrame frame, int top, int curBCI, int opcode, int statementIndex, Method resolutionSeed) {
    CompilerDirectives.transferToInterpreterAndInvalidate();
    assert Bytecodes.isInvoke(opcode);
    BaseQuickNode invoke = null;
    synchronized (this) {
        assert bs.currentBC(curBCI) == QUICK;
        char nodeIndex = readCPI(curBCI);
        invoke = dispatchQuickened(top, curBCI, readOriginalCPI(curBCI), opcode, statementIndex, resolutionSeed, false);
        nodes[nodeIndex] = nodes[nodeIndex].replace(invoke);
    }
    // Perform the call outside of the lock.
    return invoke.execute(frame);
}
Also used : BaseQuickNode(com.oracle.truffle.espresso.nodes.quick.BaseQuickNode)

Aggregations

BaseQuickNode (com.oracle.truffle.espresso.nodes.quick.BaseQuickNode)13 TruffleSafepoint (com.oracle.truffle.api.TruffleSafepoint)3 Method (com.oracle.truffle.espresso.impl.Method)3 ArrayKlass (com.oracle.truffle.espresso.impl.ArrayKlass)2 Klass (com.oracle.truffle.espresso.impl.Klass)2 AbstractTruffleException (com.oracle.truffle.api.exception.AbstractTruffleException)1 ExplodeLoop (com.oracle.truffle.api.nodes.ExplodeLoop)1 BytecodeLookupSwitch (com.oracle.truffle.espresso.bytecode.BytecodeLookupSwitch)1 BytecodeStream (com.oracle.truffle.espresso.bytecode.BytecodeStream)1 BytecodeTableSwitch (com.oracle.truffle.espresso.bytecode.BytecodeTableSwitch)1 RuntimeConstantPool (com.oracle.truffle.espresso.classfile.RuntimeConstantPool)1 InvokeDynamicConstant (com.oracle.truffle.espresso.classfile.constantpool.InvokeDynamicConstant)1 ExceptionHandler (com.oracle.truffle.espresso.meta.ExceptionHandler)1 Meta (com.oracle.truffle.espresso.meta.Meta)1 CheckCastQuickNode (com.oracle.truffle.espresso.nodes.quick.CheckCastQuickNode)1 InstanceOfQuickNode (com.oracle.truffle.espresso.nodes.quick.InstanceOfQuickNode)1 ArrayLengthQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.ArrayLengthQuickNode)1 ByteArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.ByteArrayLoadQuickNode)1 ByteArrayStoreQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.ByteArrayStoreQuickNode)1 CharArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.CharArrayLoadQuickNode)1