aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-03-28 06:47:04 +0200
committerMike Pall <mike>2010-03-28 06:47:04 +0200
commit1130ade4de66de1abc0246ba0c96a6d301d13398 (patch)
treec8a20fe013c63e2dcd869d1a756c9e4b9a57b848 /src
parent44756ded7ae7bcf66bd657f5d8084be5ba4fb43f (diff)
downloadluajit-1130ade4de66de1abc0246ba0c96a6d301d13398.tar.gz
luajit-1130ade4de66de1abc0246ba0c96a6d301d13398.tar.bz2
luajit-1130ade4de66de1abc0246ba0c96a6d301d13398.zip
Also merge EQ(HREF, niltv) in backend.
Diffstat (limited to 'src')
-rw-r--r--src/lj_asm.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index ba34bff8..81b73867 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -1599,7 +1599,8 @@ static uint32_t ir_khash(IRIns *ir)
1599static MCode *merge_href_niltv(ASMState *as, IRIns *ir) 1599static MCode *merge_href_niltv(ASMState *as, IRIns *ir)
1600{ 1600{
1601 /* Assumes nothing else generates NE of HREF. */ 1601 /* Assumes nothing else generates NE of HREF. */
1602 if (ir[1].o == IR_NE && ir[1].op1 == as->curins) { 1602 if ((ir[1].o == IR_NE || ir[1].o == IR_EQ) && ir[1].op1 == as->curins &&
1603 ra_hasreg(ir->r)) {
1603 if (LJ_64 && *as->mcp != XI_ARITHi) 1604 if (LJ_64 && *as->mcp != XI_ARITHi)
1604 as->mcp += 7+6; 1605 as->mcp += 7+6;
1605 else 1606 else
@@ -1639,10 +1640,12 @@ static void asm_href(ASMState *as, IRIns *ir)
1639 1640
1640 /* Key not found in chain: jump to exit (if merged with NE) or load niltv. */ 1641 /* Key not found in chain: jump to exit (if merged with NE) or load niltv. */
1641 l_end = emit_label(as); 1642 l_end = emit_label(as);
1642 if (nilexit) 1643 if (nilexit && ir[1].o == IR_NE) {
1643 emit_jcc(as, CC_E, nilexit); /* XI_JMP is not found by lj_asm_patchexit. */ 1644 emit_jcc(as, CC_E, nilexit); /* XI_JMP is not found by lj_asm_patchexit. */
1644 else 1645 nilexit = NULL;
1646 } else {
1645 emit_loada(as, dest, niltvg(J2G(as->J))); 1647 emit_loada(as, dest, niltvg(J2G(as->J)));
1648 }
1646 1649
1647 /* Follow hash chain until the end. */ 1650 /* Follow hash chain until the end. */
1648 l_loop = emit_sjcc_label(as, CC_NZ); 1651 l_loop = emit_sjcc_label(as, CC_NZ);
@@ -1651,7 +1654,10 @@ static void asm_href(ASMState *as, IRIns *ir)
1651 l_next = emit_label(as); 1654 l_next = emit_label(as);
1652 1655
1653 /* Type and value comparison. */ 1656 /* Type and value comparison. */
1654 emit_sjcc(as, CC_E, l_end); 1657 if (nilexit)
1658 emit_jcc(as, CC_E, nilexit);
1659 else
1660 emit_sjcc(as, CC_E, l_end);
1655 if (irt_isnum(kt)) { 1661 if (irt_isnum(kt)) {
1656 if (isk) { 1662 if (isk) {
1657 /* Assumes -0.0 is already canonicalized to +0.0. */ 1663 /* Assumes -0.0 is already canonicalized to +0.0. */