summaryrefslogtreecommitdiff
path: root/src/lj_opt_fold.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-01-09 23:59:43 +0100
committerMike Pall <mike>2010-01-09 23:59:43 +0100
commit99d153bef9725db226614558d01df829afafee3c (patch)
treeec5c4778a0ac5e054fc8c3d337381e1d52f626bc /src/lj_opt_fold.c
parent2cc554db0cb37ac3600cccab97c657bb532e3c4e (diff)
downloadluajit-99d153bef9725db226614558d01df829afafee3c.tar.gz
luajit-99d153bef9725db226614558d01df829afafee3c.tar.bz2
luajit-99d153bef9725db226614558d01df829afafee3c.zip
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.
Diffstat (limited to 'src/lj_opt_fold.c')
-rw-r--r--src/lj_opt_fold.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c
index 41c87e2f..a8550e1f 100644
--- a/src/lj_opt_fold.c
+++ b/src/lj_opt_fold.c
@@ -1146,12 +1146,12 @@ LJFOLDF(cse_uref)
1146 if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) { 1146 if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) {
1147 IRRef ref = J->chain[fins->o]; 1147 IRRef ref = J->chain[fins->o];
1148 GCfunc *fn = ir_kfunc(fleft); 1148 GCfunc *fn = ir_kfunc(fleft);
1149 GCupval *uv = gco2uv(gcref(fn->l.uvptr[fins->op2])); 1149 GCupval *uv = gco2uv(gcref(fn->l.uvptr[(fins->op2 >> 8)]));
1150 while (ref > 0) { 1150 while (ref > 0) {
1151 IRIns *ir = IR(ref); 1151 IRIns *ir = IR(ref);
1152 if (irref_isk(ir->op1)) { 1152 if (irref_isk(ir->op1)) {
1153 GCfunc *fn2 = ir_kfunc(IR(ir->op1)); 1153 GCfunc *fn2 = ir_kfunc(IR(ir->op1));
1154 if (gco2uv(gcref(fn2->l.uvptr[ir->op2])) == uv) { 1154 if (gco2uv(gcref(fn2->l.uvptr[(ir->op2 >> 8)])) == uv) {
1155 if (fins->o == IR_UREFO && gcstep_barrier(J, ref)) 1155 if (fins->o == IR_UREFO && gcstep_barrier(J, ref))
1156 break; 1156 break;
1157 return ref; 1157 return ref;