mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 07:34:07 +00:00
Also merge EQ(HREF, niltv) in backend.
This commit is contained in:
parent
44756ded7a
commit
1130ade4de
12
src/lj_asm.c
12
src/lj_asm.c
@ -1599,7 +1599,8 @@ static uint32_t ir_khash(IRIns *ir)
|
|||||||
static MCode *merge_href_niltv(ASMState *as, IRIns *ir)
|
static MCode *merge_href_niltv(ASMState *as, IRIns *ir)
|
||||||
{
|
{
|
||||||
/* Assumes nothing else generates NE of HREF. */
|
/* Assumes nothing else generates NE of HREF. */
|
||||||
if (ir[1].o == IR_NE && ir[1].op1 == as->curins) {
|
if ((ir[1].o == IR_NE || ir[1].o == IR_EQ) && ir[1].op1 == as->curins &&
|
||||||
|
ra_hasreg(ir->r)) {
|
||||||
if (LJ_64 && *as->mcp != XI_ARITHi)
|
if (LJ_64 && *as->mcp != XI_ARITHi)
|
||||||
as->mcp += 7+6;
|
as->mcp += 7+6;
|
||||||
else
|
else
|
||||||
@ -1639,10 +1640,12 @@ static void asm_href(ASMState *as, IRIns *ir)
|
|||||||
|
|
||||||
/* Key not found in chain: jump to exit (if merged with NE) or load niltv. */
|
/* Key not found in chain: jump to exit (if merged with NE) or load niltv. */
|
||||||
l_end = emit_label(as);
|
l_end = emit_label(as);
|
||||||
if (nilexit)
|
if (nilexit && ir[1].o == IR_NE) {
|
||||||
emit_jcc(as, CC_E, nilexit); /* XI_JMP is not found by lj_asm_patchexit. */
|
emit_jcc(as, CC_E, nilexit); /* XI_JMP is not found by lj_asm_patchexit. */
|
||||||
else
|
nilexit = NULL;
|
||||||
|
} else {
|
||||||
emit_loada(as, dest, niltvg(J2G(as->J)));
|
emit_loada(as, dest, niltvg(J2G(as->J)));
|
||||||
|
}
|
||||||
|
|
||||||
/* Follow hash chain until the end. */
|
/* Follow hash chain until the end. */
|
||||||
l_loop = emit_sjcc_label(as, CC_NZ);
|
l_loop = emit_sjcc_label(as, CC_NZ);
|
||||||
@ -1651,6 +1654,9 @@ static void asm_href(ASMState *as, IRIns *ir)
|
|||||||
l_next = emit_label(as);
|
l_next = emit_label(as);
|
||||||
|
|
||||||
/* Type and value comparison. */
|
/* Type and value comparison. */
|
||||||
|
if (nilexit)
|
||||||
|
emit_jcc(as, CC_E, nilexit);
|
||||||
|
else
|
||||||
emit_sjcc(as, CC_E, l_end);
|
emit_sjcc(as, CC_E, l_end);
|
||||||
if (irt_isnum(kt)) {
|
if (irt_isnum(kt)) {
|
||||||
if (isk) {
|
if (isk) {
|
||||||
|
Loading…
Reference in New Issue
Block a user