Search in sources :

Example 6 with FrameSlotTypeException

use of com.oracle.truffle.api.frame.FrameSlotTypeException in project sulong by graalvm.

the class LLVMLandingpadNode method executeGeneric.

@Override
public Object executeGeneric(VirtualFrame frame) {
    try {
        LLVMException exception = (LLVMException) frame.getObject(exceptionSlot);
        Object unwindHeader = exception.getUnwindHeader();
        LLVMStack.StackPointer stack = (LLVMStack.StackPointer) getStack.executeGeneric(frame);
        int clauseId = getEntryIdentifier(frame, stack, unwindHeader);
        if (clauseId == 0 && !cleanup) {
            throw exception;
        } else {
            LLVMAddress executeLLVMAddress = allocateLandingPadValue.execute(frame);
            LLVMAddress pair0 = executeLLVMAddress;
            getMemory().putAddress(pair0, unwindHeaderToNative.executeWithTarget(unwindHeader));
            getMemory().putI32(executeLLVMAddress.getVal() + LLVMExpressionNode.ADDRESS_SIZE_IN_BYTES, clauseId);
            return executeLLVMAddress;
        }
    } catch (FrameSlotTypeException e) {
        CompilerDirectives.transferToInterpreter();
        throw new IllegalStateException(e);
    }
}
Also used : FrameSlotTypeException(com.oracle.truffle.api.frame.FrameSlotTypeException) LLVMAddress(com.oracle.truffle.llvm.runtime.LLVMAddress) LLVMException(com.oracle.truffle.llvm.runtime.LLVMException) LLVMStack(com.oracle.truffle.llvm.runtime.memory.LLVMStack)

Aggregations

FrameSlotTypeException (com.oracle.truffle.api.frame.FrameSlotTypeException)6 PascalRuntimeException (cz.cuni.mff.d3s.trupple.language.runtime.exceptions.PascalRuntimeException)4 FileValue (cz.cuni.mff.d3s.trupple.language.runtime.customvalues.FileValue)2 CallTarget (com.oracle.truffle.api.CallTarget)1 RootCallTarget (com.oracle.truffle.api.RootCallTarget)1 FrameSlot (com.oracle.truffle.api.frame.FrameSlot)1 VirtualFrame (com.oracle.truffle.api.frame.VirtualFrame)1 UnexpectedResultException (com.oracle.truffle.api.nodes.UnexpectedResultException)1 LLVMAddress (com.oracle.truffle.llvm.runtime.LLVMAddress)1 LLVMException (com.oracle.truffle.llvm.runtime.LLVMException)1 LLVMStack (com.oracle.truffle.llvm.runtime.memory.LLVMStack)1 EnumValue (cz.cuni.mff.d3s.trupple.language.runtime.customvalues.EnumValue)1 RecordValue (cz.cuni.mff.d3s.trupple.language.runtime.customvalues.RecordValue)1 OptimizedCallTarget (org.graalvm.compiler.truffle.runtime.OptimizedCallTarget)1 Test (org.junit.Test)1 DataPoint (org.junit.experimental.theories.DataPoint)1