Index: vm/jitrino/src/jet/cg_fld_arr.cpp =================================================================== --- vm/jitrino/src/jet/cg_fld_arr.cpp (revision 542750) +++ vm/jitrino/src/jet/cg_fld_arr.cpp (working copy) @@ -342,9 +342,23 @@ } else { if (is_big(jt)){ - Opnd where_hi(jt, where.base(), where.disp()+4, - where.index(), where.scale()); - vpush2(where, where_hi); + // if in lazy resolution mode the field may be not resolved + // it is pessimistically considered as a volatile one. + if ( (!fieldOp.fld) || field_is_volatile(fieldOp.fld) ) { + vpush2(i64,i64); // 2 slots of 32-bit. Both have i64 type + Opnd transitSlot(dbl64, m_base, vstack_off(0)); + AR freg = valloc(dbl64); + mov(freg, where.as_type(dbl64)); // load volatile with one (atomic) inst + mov(transitSlot, freg); // put it onto stack + Val& v_lo = vstack(0); v_lo.to_mem(m_base, vstack_off(0)); + Val& v_hi = vstack(1); v_hi.to_mem(m_base, vstack_off(1)); + rref(v_lo); + rref(v_hi); + } else { + Opnd where_hi(jt, where.base(), where.disp()+4, + where.index(), where.scale()); + vpush2(where, where_hi); + } } else { vpush(where); @@ -390,14 +404,30 @@ } else { vunref(jt, where); - Val& val = vstack(0, vis_mem(0)); - do_mov(where, val, fieldIsMagic); - if (is_big(jt)) { - Opnd where_hi(jt, where.base(), where.disp()+4, - where.index(), where.scale()); - vunref(jt, where_hi); - Opnd val_hi = vstack(1, vis_mem(1)).as_opnd(); - do_mov(where_hi, val_hi); + // if in lazy resolution mode the field may be not resolved + // it is pessimistically considered as a volatile one. + if (is_big(jt) && + ((!fieldOp.fld) || field_is_volatile(fieldOp.fld))) { + Val& val = vstack(0); + if (!vis_mem(0)) { + rfree(val); + val.to_mem(m_base, vstack_off(0)); + rref(val); + } + Opnd value(i64, m_base, vstack_off(0)); + AR freg = valloc(dbl64); // transit XMM reg + mov(freg, value.as_type(dbl64)); // from stack to reg + mov(where.as_type(dbl64), freg); // store volatile with one (atomic) inst + } else { + Val& val = vstack(0, vis_mem(0)); + do_mov(where, val); + if (is_big(jt)) { + Opnd where_hi(jt, where.base(), where.disp()+4, + where.index(), where.scale()); + vunref(jt, where_hi); + Opnd val_hi = vstack(1, vis_mem(1)).as_opnd(); + do_mov(where_hi, val_hi); + } } }