+ }
+ break;
+
+ case ICMD_PUTSTATICCONST: /* ... ==> ... */
+ /* val = value (in current instruction) */
+ /* op1 = type, val.a = field address (in */
+ /* following NOP) */
+
+ /* If the static fields' class is not yet initialized, we do it */
+ /* now. The call code is generated later. */
+ if (!((fieldinfo *) iptr[1].val.a)->class->initialized) {
+ codegen_addclinitref(cd, cd->mcodeptr, ((fieldinfo *) iptr[1].val.a)->class);
+
+ /* This is just for debugging purposes. Is very difficult to */
+ /* read patched code. Here we patch the following 5 nop's */
+ /* so that the real code keeps untouched. */
+ if (showdisassemble) {
+ x86_64_nop(cd); x86_64_nop(cd); x86_64_nop(cd);
+ x86_64_nop(cd); x86_64_nop(cd);
+ }
+ }
+
+ /* This approach is much faster than moving the field address */
+ /* inline into a register. */
+ a = dseg_addaddress(cd, &(((fieldinfo *) iptr[1].val.a)->value));
+ x86_64_mov_membase_reg(cd, RIP, -(((ptrint) cd->mcodeptr + 7) - (ptrint) cd->mcodebase) + a, REG_ITMP1);
+ switch (iptr->op1) {
+ case TYPE_INT:
+ case TYPE_FLT:
+ x86_64_movl_imm_membase(cd, iptr->val.i, REG_ITMP1, 0);
+ break;
+ case TYPE_LNG:
+ case TYPE_ADR:
+ case TYPE_DBL:
+ if (IS_IMM32(iptr->val.l)) {
+ x86_64_mov_imm_membase(cd, iptr->val.l, REG_ITMP1, 0);
+ } else {
+ x86_64_movl_imm_membase(cd, iptr->val.l, REG_ITMP1, 0);
+ x86_64_movl_imm_membase(cd, iptr->val.l >> 32, REG_ITMP1, 4);
+ }
+ break;