val.load(eContext);
// Put static field
if (!fieldRef.isWide()) {
final WordItem wval = (WordItem) val;
final GPR valr = wval.getRegister();
if (os.isCode32() || (wval.getType() != JvmType.REFERENCE)) {
if (sf.isShared()) {
helper.writePutStaticsEntry(curInstrLabel, valr, sf);
} else {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext,
JvmType.REFERENCE, false);
helper.writePutStaticsEntry(curInstrLabel, valr, sf, tmp);
L1AHelper.releaseRegister(eContext, tmp);
}
} else {
if (sf.isShared()) {
helper.writePutStaticsEntry64(curInstrLabel, (GPR64) valr, sf);
} else {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false);
helper.writePutStaticsEntry64(curInstrLabel, (GPR64) valr, sf, tmp);
L1AHelper.releaseRegister(eContext, tmp);
}
}
if (!sf.isPrimitive() && helper.needsWriteBarrier()) {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext, JvmType.INT, false);
helper.writePutstaticWriteBarrier(sf, valr, tmp);
L1AHelper.releaseRegister(eContext, tmp);
}
} else {
final DoubleWordItem dval = (DoubleWordItem) val;
if (os.isCode32()) {
if (sf.isShared()) {
helper.writePutStaticsEntry64(curInstrLabel, dval.getLsbRegister(eContext), dval
.getMsbRegister(eContext), sf);
} else {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false);
helper.writePutStaticsEntry64(curInstrLabel, dval.getLsbRegister(eContext),
dval.getMsbRegister(eContext), sf, tmp);
L1AHelper.releaseRegister(eContext, tmp);
}
} else {
if (sf.isShared()) {
helper.writePutStaticsEntry64(curInstrLabel, dval.getRegister(eContext), sf);
} else {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false);
helper.writePutStaticsEntry64(curInstrLabel, dval.getRegister(eContext), sf, tmp);
L1AHelper.releaseRegister(eContext, tmp);
}
}
}