final boolean isfloat = JvmType.isFloat(type);
// Pop & load
final RefItem ref = vstack.popRef();
ref.load(eContext);
final GPR refr = ref.getRegister();
// get field
final Item result;
if (!fieldRef.isWide()) {
if (isfloat) {
result = ifac.createFPUStack(JvmType.FLOAT);
os.writeFLD32(refr, fieldOffset);
vstack.fpuStack.push(result);
} else {
final char fieldType = field.getSignature().charAt(0);
final WordItem iw = L1AHelper.requestWordRegister(eContext,
type, (fieldType != 'I') && (type != JvmType.REFERENCE));
final GPR iwr = iw.getRegister();
switch (fieldType) {
case 'Z': // boolean
os.writeMOVZX(iwr, refr, fieldOffset, BITS8);
break;
case 'B': // byte
os.writeMOVSX(iwr, refr, fieldOffset, BITS8);
break;
case 'C': // char
os.writeMOVZX(iwr, refr, fieldOffset, BITS16);
break;
case 'S': // short
os.writeMOVSX(iwr, refr, fieldOffset, BITS16);
break;
case 'I': // int
case 'L': // Object
case '[': // array
os.writeMOV(iwr.getSize(), iwr, refr, fieldOffset);
break;
default:
throw new IllegalArgumentException("Unknown fieldType " + fieldType);
}
result = iw;
}
} else {
if (isfloat) {
result = ifac.createFPUStack(JvmType.DOUBLE);
os.writeFLD64(refr, fieldOffset);
vstack.fpuStack.push(result);
} else {
final DoubleWordItem idw = L1AHelper
.requestDoubleWordRegisters(eContext, type);
if (os.isCode32()) {
final GPR lsb = idw.getLsbRegister(eContext);
final GPR msb = idw.getMsbRegister(eContext);
os.writeMOV(BITS32, lsb, refr, fieldOffset + LSB);
os.writeMOV(BITS32, msb, refr, fieldOffset + MSB);
} else {
final GPR64 reg = idw.getRegister(eContext);
os.writeMOV(BITS64, reg, refr, fieldOffset);