Improve alias analysis of upvalues using a disambiguation hash value.

All upvalue objects hold a disambiguation hash value now.
It's built from the parent prototype and the slot number.
Different hash values imply the upvalues cannot alias.
Same hash values don't imply anything (collision or different closures).
Upvalue disambiguation makes use of a reduced hash due to IR contraints.
This commit is contained in:
Mike Pall
2010-01-09 23:59:43 +01:00
parent 2cc554db0c
commit 99d153bef9
7 changed files with 32 additions and 13 deletions

View File

@@ -397,6 +397,8 @@ local function dump_ir(tr, dumpsnap, dumpreg)
local litn = litname[op]
if litn and litn[op2] then
out:write(" ", litn[op2])
elseif op == "UREFO " or op == "UREFC " then
out:write(format(" #%-3d", shr(op2, 8)))
else
out:write(format(" #%-3d", op2))
end