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);
}
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());
}
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);
}
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);
}
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);
}
Aggregations