Search in sources :

Example 6 with DebugExprType

use of com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType in project graal by oracle.

the class DebugExprNodeFactory method createDereferenceNode.

public DebugExpressionPair createDereferenceNode(DebugExpressionPair pointerPair) {
    checkError(pointerPair, "*");
    DebugExprDereferenceNode node = DebugExprDereferenceNodeGen.create(pointerPair.getNode());
    DebugExprType type = pointerPair.getType().getInnerType();
    return DebugExpressionPair.create(node, type);
}
Also used : DebugExprType(com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType)

Example 7 with DebugExprType

use of com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType in project graal by oracle.

the class DebugExprNodeFactory method createCompareNode.

public DebugExpressionPair createCompareNode(DebugExpressionPair left, CompareKind op, DebugExpressionPair right) {
    checkError(left, op.name());
    checkError(right, op.name());
    DebugExprType commonType = DebugExprType.commonType(left.getType(), right.getType());
    DebugExpressionPair leftPair = createCastIfNecessary(left, commonType);
    DebugExpressionPair rightPair = createCastIfNecessary(right, commonType);
    CompareOperator cop;
    if (commonType.isFloatingType()) {
        cop = getFloatingCompareOperator(op);
    } else if (commonType.isUnsigned()) {
        cop = getUnsignedCompareOperator(op);
    } else {
        cop = getSignedCompareOperator(op);
    }
    LLVMExpressionNode node = CommonNodeFactory.createComparison(cop, commonType.getLLVMRuntimeType(), leftPair.getNode(), rightPair.getNode());
    return DebugExpressionPair.create(node, DebugExprType.getBoolType());
}
Also used : CompareOperator(com.oracle.truffle.llvm.runtime.CompareOperator) DebugExprType(com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType) LLVMExpressionNode(com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode)

Example 8 with DebugExprType

use of com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType in project graal by oracle.

the class DebugExprNodeFactory method createObjectMember.

public DebugExpressionPair createObjectMember(DebugExpressionPair receiver, String fieldName) {
    LLVMExpressionNode baseNode = receiver.getNode();
    DebugExprObjectMemberNode node = DebugExprObjectMemberNodeGen.create(baseNode, fieldName);
    DebugExprType type = node.getType(frame);
    return DebugExpressionPair.create(node, type);
}
Also used : DebugExprType(com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType) LLVMExpressionNode(com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode)

Example 9 with DebugExprType

use of com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType in project graal by oracle.

the class DebugExprObjectMemberNode method findMemberAndType.

private Pair<Object, DebugExprType> findMemberAndType(Object baseMember) {
    InteropLibrary library = InteropLibrary.getFactory().getUncached();
    if (baseMember != null && library.isMemberExisting(baseMember, fieldName)) {
        try {
            Object member = library.readMember(baseMember, fieldName);
            LLVMDebuggerValue ldv = (LLVMDebuggerValue) member;
            Object metaObj = ldv.resolveMetaObject();
            DebugExprType type = DebugExprType.getTypeFromSymbolTableMetaObject(metaObj);
            return Pair.create(member, type);
        } catch (UnsupportedMessageException e1) {
            throw DebugExprException.symbolNotFound(this, fieldName, baseMember);
        } catch (UnknownIdentifierException e1) {
            throw DebugExprException.symbolNotFound(this, e1.getUnknownIdentifier(), baseMember);
        } catch (ClassCastException e1) {
            throw DebugExprException.symbolNotFound(this, fieldName, baseMember);
        }
    }
    throw DebugExprException.symbolNotFound(this, fieldName, baseMember);
}
Also used : DebugExprType(com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType) UnsupportedMessageException(com.oracle.truffle.api.interop.UnsupportedMessageException) UnknownIdentifierException(com.oracle.truffle.api.interop.UnknownIdentifierException) InteropLibrary(com.oracle.truffle.api.interop.InteropLibrary) LLVMDebuggerValue(com.oracle.truffle.llvm.runtime.debug.LLVMDebuggerValue)

Example 10 with DebugExprType

use of com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType in project graal by oracle.

the class DebugExprNodeFactory method createRemNode.

public DebugExpressionPair createRemNode(DebugExpressionPair left, DebugExpressionPair right) {
    checkError(left, "%");
    checkError(right, "%");
    DebugExprType commonType = DebugExprType.commonType(left.getType(), right.getType());
    ArithmeticOperation op = commonType.isUnsigned() ? ArithmeticOperation.UREM : ArithmeticOperation.REM;
    LLVMExpressionNode node = CommonNodeFactory.createArithmeticOp(op, commonType.getLLVMRuntimeType(), left.getNode(), right.getNode());
    return DebugExpressionPair.create(node, commonType);
}
Also used : DebugExprType(com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType) LLVMExpressionNode(com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode) ArithmeticOperation(com.oracle.truffle.llvm.runtime.ArithmeticOperation)

Aggregations

DebugExprType (com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprType)12 LLVMExpressionNode (com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode)5 InteropLibrary (com.oracle.truffle.api.interop.InteropLibrary)3 UnknownIdentifierException (com.oracle.truffle.api.interop.UnknownIdentifierException)3 UnsupportedMessageException (com.oracle.truffle.api.interop.UnsupportedMessageException)3 LLVMDebuggerValue (com.oracle.truffle.llvm.runtime.debug.LLVMDebuggerValue)3 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)2 ArithmeticOperation (com.oracle.truffle.llvm.runtime.ArithmeticOperation)2 Specialization (com.oracle.truffle.api.dsl.Specialization)1 NodeLibrary (com.oracle.truffle.api.interop.NodeLibrary)1 CompareOperator (com.oracle.truffle.llvm.runtime.CompareOperator)1 LLVMFunctionDescriptor (com.oracle.truffle.llvm.runtime.LLVMFunctionDescriptor)1 LLVMSourcePointerType (com.oracle.truffle.llvm.runtime.debug.type.LLVMSourcePointerType)1 LLVMSourceType (com.oracle.truffle.llvm.runtime.debug.type.LLVMSourceType)1 LLVMDebugObject (com.oracle.truffle.llvm.runtime.debug.value.LLVMDebugObject)1 LLVMDebugValue (com.oracle.truffle.llvm.runtime.debug.value.LLVMDebugValue)1 Builder (com.oracle.truffle.llvm.runtime.debug.value.LLVMDebugValue.Builder)1 LLVMManagedPointer (com.oracle.truffle.llvm.runtime.pointer.LLVMManagedPointer)1 Type (com.oracle.truffle.llvm.runtime.types.Type)1