aboutsummaryrefslogtreecommitdiff
path: root/src/lj_opt_mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_opt_mem.c')
-rw-r--r--src/lj_opt_mem.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lj_opt_mem.c b/src/lj_opt_mem.c
index 351d958c..631ac9e4 100644
--- a/src/lj_opt_mem.c
+++ b/src/lj_opt_mem.c
@@ -464,18 +464,23 @@ doemit:
464*/ 464*/
465static AliasRet aa_uref(IRIns *refa, IRIns *refb) 465static AliasRet aa_uref(IRIns *refa, IRIns *refb)
466{ 466{
467 if (refa->o != refb->o)
468 return ALIAS_NO; /* Different UREFx type. */
469 if (refa->op1 == refb->op1) { /* Same function. */ 467 if (refa->op1 == refb->op1) { /* Same function. */
470 if (refa->op2 == refb->op2) 468 if (refa->op2 == refb->op2)
471 return ALIAS_MUST; /* Same function, same upvalue idx. */ 469 return ALIAS_MUST; /* Same function, same upvalue idx. */
472 else 470 else
473 return ALIAS_NO; /* Same function, different upvalue idx. */ 471 return ALIAS_NO; /* Same function, different upvalue idx. */
474 } else { /* Different functions, check disambiguation hash values. */ 472 } else { /* Different functions, check disambiguation hash values. */
475 if (((refa->op2 ^ refb->op2) & 0xff)) 473 if (((refa->op2 ^ refb->op2) & 0xff)) {
476 return ALIAS_NO; /* Upvalues with different hash values cannot alias. */ 474 return ALIAS_NO; /* Upvalues with different hash values cannot alias. */
477 else 475 } else if (refa->o != refb->o) {
478 return ALIAS_MAY; /* No conclusion can be drawn for same hash value. */ 476 /* Different UREFx type, but need to confirm the UREFO really is open. */
477 if (irt_type(refa->t) == IRT_IGC) refa->t.irt += IRT_PGC-IRT_IGC;
478 else if (irt_type(refb->t) == IRT_IGC) refb->t.irt += IRT_PGC-IRT_IGC;
479 return ALIAS_NO;
480 } else {
481 /* No conclusion can be drawn for same hash value and same UREFx type. */
482 return ALIAS_MAY;
483 }
479 } 484 }
480} 485}
481 486