diff options
Diffstat (limited to 'src/lj_opt_mem.c')
-rw-r--r-- | src/lj_opt_mem.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/lj_opt_mem.c b/src/lj_opt_mem.c index 521c8590..57948311 100644 --- a/src/lj_opt_mem.c +++ b/src/lj_opt_mem.c | |||
@@ -277,12 +277,17 @@ static AliasRet aa_uref(IRIns *refa, IRIns *refb) | |||
277 | { | 277 | { |
278 | if (refa->o != refb->o) | 278 | if (refa->o != refb->o) |
279 | return ALIAS_NO; /* Different UREFx type. */ | 279 | return ALIAS_NO; /* Different UREFx type. */ |
280 | if (refa->op1 != refb->op1) | 280 | if (refa->op1 == refb->op1) { /* Same function. */ |
281 | return ALIAS_MAY; /* Different function. */ | 281 | if (refa->op2 == refb->op2) |
282 | else if (refa->op2 == refb->op2) | 282 | return ALIAS_MUST; /* Same function, same upvalue idx. */ |
283 | return ALIAS_MUST; /* Same function, same upvalue idx. */ | 283 | else |
284 | else | 284 | return ALIAS_NO; /* Same function, different upvalue idx. */ |
285 | return ALIAS_NO; /* Same function, different upvalue idx. */ | 285 | } else { /* Different functions, check disambiguation hash values. */ |
286 | if (((refa->op2 ^ refb->op2) & 0xff)) | ||
287 | return ALIAS_NO; /* Upvalues with different hash values cannot alias. */ | ||
288 | else | ||
289 | return ALIAS_MAY; /* No conclusion can be drawn for same hash value. */ | ||
290 | } | ||
286 | } | 291 | } |
287 | 292 | ||
288 | /* ULOAD forwarding. */ | 293 | /* ULOAD forwarding. */ |