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,
(VmSharedStaticsEntry) sf);
} else {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext,
JvmType.REFERENCE, false);
helper.writePutStaticsEntry(curInstrLabel, valr,
(VmIsolatedStaticsEntry) sf, tmp);
L1AHelper.releaseRegister(eContext, tmp);
}
} else {
if (sf.isShared()) {
helper.writePutStaticsEntry64(curInstrLabel, (GPR64) valr,
(VmSharedStaticsEntry) sf);
} else {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext,
JvmType.REFERENCE, false);
helper.writePutStaticsEntry64(curInstrLabel, (GPR64) valr,
(VmIsolatedStaticsEntry) 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),
(VmSharedStaticsEntry) sf);
} else {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext,
JvmType.REFERENCE, false);
helper.writePutStaticsEntry64(curInstrLabel, dval
.getLsbRegister(eContext), dval
.getMsbRegister(eContext),
(VmIsolatedStaticsEntry) sf, tmp);
L1AHelper.releaseRegister(eContext, tmp);
}
} else {
if (sf.isShared()) {
helper.writePutStaticsEntry64(curInstrLabel, dval
.getRegister(eContext), (VmSharedStaticsEntry) sf);
} else {
final GPR tmp = (GPR) L1AHelper.requestRegister(eContext,
JvmType.REFERENCE, false);
helper.writePutStaticsEntry64(curInstrLabel, dval
.getRegister(eContext),
(VmIsolatedStaticsEntry) sf, tmp);
L1AHelper.releaseRegister(eContext, tmp);