use of com.oracle.truffle.llvm.runtime.types.Type in project sulong by graalvm.
the class LLVMFrameNullerUtil method nullObject.
public static void nullObject(VirtualFrame frame, FrameSlot frameSlot) {
CompilerAsserts.partialEvaluationConstant(frameSlot.getInfo());
CompilerAsserts.partialEvaluationConstant(frameSlot.getInfo() == null);
if (frameSlot.getInfo() != null) {
Type type = (Type) frameSlot.getInfo();
CompilerAsserts.partialEvaluationConstant(Type.isFunctionOrFunctionPointer(type));
CompilerAsserts.partialEvaluationConstant(type instanceof VectorType);
CompilerAsserts.partialEvaluationConstant(type instanceof VariableBitWidthType);
CompilerAsserts.partialEvaluationConstant(type instanceof PrimitiveType && ((PrimitiveType) type).getPrimitiveKind() == PrimitiveKind.X86_FP80);
if (Type.isFunctionOrFunctionPointer(type)) {
nullFunction(frame, frameSlot);
} else if (type instanceof VectorType && ((VectorType) type).getElementType() instanceof PrimitiveType) {
nullVector(frame, frameSlot, ((PrimitiveType) ((VectorType) type).getElementType()).getPrimitiveKind());
} else if (type instanceof VectorType && ((VectorType) type).getElementType() instanceof PointerType) {
frame.setObject(frameSlot, LLVMAddressVector.createNullVector());
} else if (type instanceof VariableBitWidthType) {
nullIVarBit(frame, frameSlot);
} else if (type instanceof PrimitiveType && ((PrimitiveType) type).getPrimitiveKind() == PrimitiveKind.X86_FP80) {
null80BitFloat(frame, frameSlot);
}
}
// This is a best effort approach. It could still be that LLVMAddress clashes with some
// other class.
nullAddress(frame, frameSlot);
}
Aggregations