use of com.oracle.truffle.api.frame.FrameSlotKind in project sulong by graalvm.
the class LLVMContext method getGlobalFrameSlot.
public FrameSlot getGlobalFrameSlot(Object symbol, Type type) {
FrameSlotKind kind;
if (type instanceof PrimitiveType) {
switch(((PrimitiveType) type).getPrimitiveKind()) {
case DOUBLE:
kind = FrameSlotKind.Double;
break;
case FLOAT:
kind = FrameSlotKind.Float;
break;
case HALF:
case I16:
case I32:
kind = FrameSlotKind.Int;
break;
case I1:
kind = FrameSlotKind.Boolean;
break;
case I64:
kind = FrameSlotKind.Long;
break;
case I8:
kind = FrameSlotKind.Byte;
break;
default:
kind = FrameSlotKind.Object;
break;
}
} else {
kind = FrameSlotKind.Object;
}
FrameSlot frameSlot = globalFrameDescriptor.findOrAddFrameSlot(symbol, type, kind);
return frameSlot;
}
use of com.oracle.truffle.api.frame.FrameSlotKind in project sulong by graalvm.
the class AsmFactory method addFrameSlot.
void addFrameSlot(String reg, Type type) {
if (!registers.contains(reg)) {
registers.add(reg);
FrameSlotKind kind;
if (type instanceof PrimitiveType) {
PrimitiveKind primitiveKind = ((PrimitiveType) type).getPrimitiveKind();
switch(primitiveKind) {
case I8:
kind = FrameSlotKind.Byte;
break;
case I32:
kind = FrameSlotKind.Int;
break;
case I64:
kind = FrameSlotKind.Long;
break;
default:
kind = FrameSlotKind.Illegal;
break;
}
} else if (type instanceof PointerType) {
kind = FrameSlotKind.Object;
} else {
kind = FrameSlotKind.Illegal;
}
this.frameDescriptor.addFrameSlot(reg, type, kind);
}
}
Aggregations