checkBounds(ref, idx); if (idx.getKind() == Item.Kind.CONSTANT) { final int i = idx.getValue(); if (val.getKind() == Item.Kind.CONSTANT) { final int vc = val.getValue(); os.writeMOV_Const(r, i + VmArray.DATA_OFFSET * 4, vc); } else { final Register v = val.getRegister(); os.writeMOV(INTSIZE, r, i + VmArray.DATA_OFFSET * 4, v); } } else { final Register i = idx.getRegister(); val.load(eContext); if (val.getKind() == Item.Kind.CONSTANT) {     } else { final Register v = val.getRegister(); os.writeMOV(INTSIZE, r, i, 4, VmArray.DATA_OFFSET * 4, v); } } val.release(eContext); idx.release(eContext); ref.release(eContext); }
checkBounds(ref, idx); if (idx.isConstant()) { final int i = idx.getValue(); if (val.isConstant()) { final int vc = val.getValue(); os.writeMOV_Const(r, i + VmArray.DATA_OFFSET * 4, vc); } else { final Register v = val.getRegister(); os.writeMOV(INTSIZE, r, i + VmArray.DATA_OFFSET * 4, v); } } else { final Register i = idx.getRegister(); val.load(eContext); if (val.isConstant()) {     } else { final Register v = val.getRegister(); os.writeMOV(INTSIZE, r, i, 4, VmArray.DATA_OFFSET * 4, v); } } val.release(eContext); idx.release(eContext); ref.release(eContext); }
    public final void visit_iastore() {        IntItem val = vstack.popInt();        IntItem idx = vstack.popInt();        RefItem ref = vstack.popRef();        val.loadIf(eContext, ~Item.Kind.CONSTANT);        idx.loadIf(eContext, ~Item.Kind.CONSTANT);        ref.load(eContext);        final Register r = ref.getRegister();        checkBounds(ref, idx);        if (idx.getKind() == Item.Kind.CONSTANT) {            final int i = idx.getValue();            if (val.getKind() == Item.Kind.CONSTANT) {                final int vc = val.getValue();                os.writeMOV_Const(r, i + VmArray.DATA_OFFSET * 4, vc);            } else {                final Register v = val.getRegister();                os.writeMOV(INTSIZE, r, i + VmArray.DATA_OFFSET * 4, v);            }        } else {            final Register i = idx.getRegister();            val.load(eContext); //tmp            if (val.getKind() == Item.Kind.CONSTANT) {                // int vc = val.getValue();                //TODO: implement writeMOV_Const disp[reg][idx], imm32                //os.writeMOV_Const(r, idx.getRegister(), 4,                // VmArray.DATA_OFFSET * 4, vc);            } else {                final Register v = val.getRegister();                os.writeMOV(INTSIZE, r, i, 4, VmArray.DATA_OFFSET * 4, v);            }        }        val.release(eContext);        idx.release(eContext);        ref.release(eContext);    }