Search in sources :

Example 1 with DoubleArrayLoadQuickNode

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

the class BytecodeNode method quickenArrayLoad.

private int quickenArrayLoad(VirtualFrame frame, int top, int curBCI, int loadOpcode) {
    CompilerDirectives.transferToInterpreterAndInvalidate();
    assert IALOAD <= loadOpcode && loadOpcode <= SALOAD;
    BaseQuickNode arrayLoadNode;
    synchronized (this) {
        if (bs.currentVolatileBC(curBCI) == SLIM_QUICK) {
            arrayLoadNode = sparseNodes[curBCI];
        } else {
            // @formatter:off
            switch(loadOpcode) {
                case BALOAD:
                    arrayLoadNode = new ByteArrayLoadQuickNode(top, curBCI);
                    break;
                case SALOAD:
                    arrayLoadNode = new ShortArrayLoadQuickNode(top, curBCI);
                    break;
                case CALOAD:
                    arrayLoadNode = new CharArrayLoadQuickNode(top, curBCI);
                    break;
                case IALOAD:
                    arrayLoadNode = new IntArrayLoadQuickNode(top, curBCI);
                    break;
                case FALOAD:
                    arrayLoadNode = new FloatArrayLoadQuickNode(top, curBCI);
                    break;
                case LALOAD:
                    arrayLoadNode = new LongArrayLoadQuickNode(top, curBCI);
                    break;
                case DALOAD:
                    arrayLoadNode = new DoubleArrayLoadQuickNode(top, curBCI);
                    break;
                case AALOAD:
                    arrayLoadNode = new ReferenceArrayLoadQuickNode(top, curBCI);
                    break;
                default:
                    CompilerDirectives.transferToInterpreter();
                    throw EspressoError.shouldNotReachHere("unexpected kind");
            }
            // @formatter:on
            arrayLoadNode = injectQuick(curBCI, arrayLoadNode, SLIM_QUICK);
        }
    }
    return arrayLoadNode.execute(frame) - Bytecodes.stackEffectOf(loadOpcode);
}
Also used : ReferenceArrayLoadQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.ReferenceArrayLoadQuickNode) ByteArrayLoadQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.ByteArrayLoadQuickNode) ShortArrayLoadQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.ShortArrayLoadQuickNode) FloatArrayLoadQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.FloatArrayLoadQuickNode) LongArrayLoadQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.LongArrayLoadQuickNode) BaseQuickNode(com.oracle.truffle.espresso.nodes.quick.BaseQuickNode) CharArrayLoadQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.CharArrayLoadQuickNode) IntArrayLoadQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.IntArrayLoadQuickNode) DoubleArrayLoadQuickNode(com.oracle.truffle.espresso.nodes.quick.interop.DoubleArrayLoadQuickNode)

Aggregations

BaseQuickNode (com.oracle.truffle.espresso.nodes.quick.BaseQuickNode)1 ByteArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.ByteArrayLoadQuickNode)1 CharArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.CharArrayLoadQuickNode)1 DoubleArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.DoubleArrayLoadQuickNode)1 FloatArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.FloatArrayLoadQuickNode)1 IntArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.IntArrayLoadQuickNode)1 LongArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.LongArrayLoadQuickNode)1 ReferenceArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.ReferenceArrayLoadQuickNode)1 ShortArrayLoadQuickNode (com.oracle.truffle.espresso.nodes.quick.interop.ShortArrayLoadQuickNode)1