diff options
author | Mike Pall <mike> | 2016-05-23 06:24:19 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2016-05-23 06:46:30 +0200 |
commit | 747feb6e4ef2a8147e18a92e76b9befa8de8a7b5 (patch) | |
tree | b759a428ca4d4e92c6ea714a5b81bb8d9dff0b0e | |
parent | 37e1e70313367d0264be9a2b9e563a8a94745303 (diff) | |
download | luajit-747feb6e4ef2a8147e18a92e76b9befa8de8a7b5.tar.gz luajit-747feb6e4ef2a8147e18a92e76b9befa8de8a7b5.tar.bz2 luajit-747feb6e4ef2a8147e18a92e76b9befa8de8a7b5.zip |
x86: Don't spill an explicit REF_BASE in the IR.
Thanks to Vyacheslav Egorov.
-rw-r--r-- | src/lj_asm_x86.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index db3e49f8..a380094b 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
@@ -325,11 +325,11 @@ static Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow) | |||
325 | as->mrm.base = as->mrm.idx = RID_NONE; | 325 | as->mrm.base = as->mrm.idx = RID_NONE; |
326 | return RID_MRM; | 326 | return RID_MRM; |
327 | } | 327 | } |
328 | } else if (ir->o == IR_KINT64) { | 328 | } else if (ref == REF_BASE || ir->o == IR_KINT64) { |
329 | RegSet avail = as->freeset & ~as->modset & RSET_GPR; | 329 | RegSet avail = as->freeset & ~as->modset & RSET_GPR; |
330 | lua_assert(allow != RSET_EMPTY); | 330 | lua_assert(allow != RSET_EMPTY); |
331 | if (!(avail & (avail-1))) { /* Fuse if less than two regs available. */ | 331 | if (!(avail & (avail-1))) { /* Fuse if less than two regs available. */ |
332 | as->mrm.ofs = ptr2addr(ir_kint64(ir)); | 332 | as->mrm.ofs = ptr2addr(ref == REF_BASE ? (void *)&J2G(as->J)->jit_base : (void *)ir_kint64(ir)); |
333 | as->mrm.base = as->mrm.idx = RID_NONE; | 333 | as->mrm.base = as->mrm.idx = RID_NONE; |
334 | return RID_MRM; | 334 | return RID_MRM; |
335 | } | 335 | } |
@@ -369,7 +369,7 @@ static Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow) | |||
369 | return RID_MRM; | 369 | return RID_MRM; |
370 | } | 370 | } |
371 | } | 371 | } |
372 | if (!(as->freeset & allow) && !irref_isk(ref) && | 372 | if (!(as->freeset & allow) && !emit_canremat(ref) && |
373 | (allow == RSET_EMPTY || ra_hasspill(ir->s) || iscrossref(as, ref))) | 373 | (allow == RSET_EMPTY || ra_hasspill(ir->s) || iscrossref(as, ref))) |
374 | goto fusespill; | 374 | goto fusespill; |
375 | return ra_allocref(as, ref, allow); | 375 | return ra_allocref(as, ref, allow); |