]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Merge branch 'master' into v2.1
authorMike Pall <mike>
Fri, 20 May 2016 18:26:39 +0000 (20:26 +0200)
committerMike Pall <mike>
Fri, 20 May 2016 18:26:39 +0000 (20:26 +0200)
1  2 
doc/status.html
src/lj_asm_arm.h
src/lj_asm_mips.h
src/lj_asm_ppc.h
src/lj_asm_x86.h
src/lj_record.c

diff --cc doc/status.html
Simple merge
index ff4068a37fa09d1b611b205e25ba01cd468bcb52,a722a11f225356579a25ce4ed59120d6bca549b6..c64d59e759c53f30229512917e8d5b94069fa124
@@@ -907,9 -960,22 +907,8 @@@ static void asm_hrefk(ASMState *as, IRI
      emit_opk(as, ARMI_ADD, dest, node, ofs, RSET_GPR);
  }
  
 -static void asm_newref(ASMState *as, IRIns *ir)
 -{
 -  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];
 -  IRRef args[3];
 -  if (ir->r == RID_SINK)
 -    return;
 -  args[0] = ASMREF_L;     /* lua_State *L */
 -  args[1] = ir->op1;      /* GCtab *t     */
 -  args[2] = ASMREF_TMP1;  /* cTValue *key */
 -  asm_setupresult(as, ir, ci);  /* TValue * */
 -  asm_gencall(as, ci, args);
 -  asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2);
 -}
 -
  static void asm_uref(ASMState *as, IRIns *ir)
  {
-   /* NYI: Check that UREFO is still open and not aliasing a slot. */
    Reg dest = ra_dest(as, ir, RSET_GPR);
    if (irref_isk(ir->op1)) {
      GCfunc *fn = ir_kfunc(IR(ir->op1));
index 7bd72fda387fb875933a0c04ffc4b361511aa449,66953aac43200fb531230cc6bc67840e19df2534..ecb38c5dd27504a725510b9bc64295359ec1b756
@@@ -808,9 -777,22 +808,8 @@@ nolo
      emit_tsi(as, MIPSI_ADDU, dest, node, ra_allock(as, ofs, allow));
  }
  
 -static void asm_newref(ASMState *as, IRIns *ir)
 -{
 -  if (ir->r != RID_SINK) {
 -    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];
 -    IRRef args[3];
 -    args[0] = ASMREF_L;     /* lua_State *L */
 -    args[1] = ir->op1;      /* GCtab *t     */
 -    args[2] = ASMREF_TMP1;  /* cTValue *key */
 -    asm_setupresult(as, ir, ci);  /* TValue * */
 -    asm_gencall(as, ci, args);
 -    asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2);
 -  }
 -}
 -
  static void asm_uref(ASMState *as, IRIns *ir)
  {
-   /* NYI: Check that UREFO is still open and not aliasing a slot. */
    Reg dest = ra_dest(as, ir, RSET_GPR);
    if (irref_isk(ir->op1)) {
      GCfunc *fn = ir_kfunc(IR(ir->op1));
index 0ebed40fdaa6e9e0c6873f19947878a15b1fb05e,e1b0c9808f12a701b3c2d34365f406477b5162a9..4cf1649a8550f1f717e910140c150cb783ae78db
@@@ -715,9 -773,22 +715,8 @@@ static void asm_hrefk(ASMState *as, IRI
    }
  }
  
 -static void asm_newref(ASMState *as, IRIns *ir)
 -{
 -  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];
 -  IRRef args[3];
 -  if (ir->r == RID_SINK)
 -    return;
 -  args[0] = ASMREF_L;     /* lua_State *L */
 -  args[1] = ir->op1;      /* GCtab *t     */
 -  args[2] = ASMREF_TMP1;  /* cTValue *key */
 -  asm_setupresult(as, ir, ci);  /* TValue * */
 -  asm_gencall(as, ci, args);
 -  asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2);
 -}
 -
  static void asm_uref(ASMState *as, IRIns *ir)
  {
-   /* NYI: Check that UREFO is still open and not aliasing a slot. */
    Reg dest = ra_dest(as, ir, RSET_GPR);
    if (irref_isk(ir->op1)) {
      GCfunc *fn = ir_kfunc(IR(ir->op1));
index 66fb44030f9fc43df6b68754c4bfd2e58a5ce5da,db3e49f856ce646862c62cc402bf0dbcf7469803..6cd3800d6726c1872aef64a910e26e38a0225004
@@@ -1155,9 -1178,43 +1155,8 @@@ static void asm_hrefk(ASMState *as, IRI
  #endif
  }
  
 -static void asm_newref(ASMState *as, IRIns *ir)
 -{
 -  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];
 -  IRRef args[3];
 -  IRIns *irkey;
 -  Reg tmp;
 -  if (ir->r == RID_SINK)
 -    return;
 -  args[0] = ASMREF_L;     /* lua_State *L */
 -  args[1] = ir->op1;      /* GCtab *t     */
 -  args[2] = ASMREF_TMP1;  /* cTValue *key */
 -  asm_setupresult(as, ir, ci);  /* TValue * */
 -  asm_gencall(as, ci, args);
 -  tmp = ra_releasetmp(as, ASMREF_TMP1);
 -  irkey = IR(ir->op2);
 -  if (irt_isnum(irkey->t)) {
 -    /* For numbers use the constant itself or a spill slot as a TValue. */
 -    if (irref_isk(ir->op2))
 -      emit_loada(as, tmp, ir_knum(irkey));
 -    else
 -      emit_rmro(as, XO_LEA, tmp|REX_64, RID_ESP, ra_spill(as, irkey));
 -  } else {
 -    /* Otherwise use g->tmptv to hold the TValue. */
 -    if (!irref_isk(ir->op2)) {
 -      Reg src = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, tmp));
 -      emit_movtomro(as, REX_64IR(irkey, src), tmp, 0);
 -    } else if (!irt_ispri(irkey->t)) {
 -      emit_movmroi(as, tmp, 0, irkey->i);
 -    }
 -    if (!(LJ_64 && irt_islightud(irkey->t)))
 -      emit_movmroi(as, tmp, 4, irt_toitype(irkey->t));
 -    emit_loada(as, tmp, &J2G(as->J)->tmptv);
 -  }
 -}
 -
  static void asm_uref(ASMState *as, IRIns *ir)
  {
-   /* NYI: Check that UREFO is still open and not aliasing a slot. */
    Reg dest = ra_dest(as, ir, RSET_GPR);
    if (irref_isk(ir->op1)) {
      GCfunc *fn = ir_kfunc(IR(ir->op1));
diff --cc src/lj_record.c
index 8a72b0c991e9c0a79aa214945c95584c113f8c28,44b3667fc0e4e43c4c1010a504c2848404388d00..568b73aa0bb6a157e32079732c9170fdfe1f04c2
@@@ -1546,8 -1349,11 +1547,11 @@@ noconstify
        uvval(uvp) < tvref(J->L->maxstack)) {
        int32_t slot = (int32_t)(uvval(uvp) - (J->L->base - J->baseslot));
        if (slot >= 0) {  /* Aliases an SSA slot? */
 -                    lj_ir_kint(J, (slot - 1) * -8)));
+       emitir(IRTG(IR_EQ, IRT_P32),
+              REF_BASE,
+              emitir(IRT(IR_ADD, IRT_P32), uref,
++                    lj_ir_kint(J, (slot - 1 - LJ_FR2) * -8)));
        slot -= (int32_t)J->baseslot;  /* Note: slot number may be negative! */
-       /* NYI: add IR to guard that it's still aliasing the same slot. */
        if (val == 0) {
          return getslot(J, slot);
        } else {