diff options
author | Mike Pall <mike> | 2010-03-28 06:49:09 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-03-28 06:49:09 +0200 |
commit | e4bca9545186ffd6b9ee03f711adfa495d55c0fc (patch) | |
tree | 3fcbec0bc44e5ff92c81ffe0e0d2ba747b699c0d /src/lj_record.c | |
parent | 1130ade4de66de1abc0246ba0c96a6d301d13398 (diff) | |
download | luajit-e4bca9545186ffd6b9ee03f711adfa495d55c0fc.tar.gz luajit-e4bca9545186ffd6b9ee03f711adfa495d55c0fc.tar.bz2 luajit-e4bca9545186ffd6b9ee03f711adfa495d55c0fc.zip |
Generate EQ(HREF, niltv) for load path, too (better CSE).
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 29c024bf..e89d9c26 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -981,7 +981,13 @@ static TRef rec_idx(jit_State *J, RecordIndex *ix) | |||
981 | 981 | ||
982 | if (ix->val == 0) { /* Indexed load */ | 982 | if (ix->val == 0) { /* Indexed load */ |
983 | IRType t = itype2irt(oldv); | 983 | IRType t = itype2irt(oldv); |
984 | TRef res = emitir(IRTG(loadop, t), xref, 0); | 984 | TRef res; |
985 | if (oldv == niltvg(J2G(J))) { | ||
986 | emitir(IRTG(IR_EQ, IRT_PTR), xref, lj_ir_kptr(J, niltvg(J2G(J)))); | ||
987 | res = TREF_NIL; | ||
988 | } else { | ||
989 | res = emitir(IRTG(loadop, t), xref, 0); | ||
990 | } | ||
985 | if (t == IRT_NIL && ix->idxchain && rec_mm_lookup(J, ix, MM_index)) | 991 | if (t == IRT_NIL && ix->idxchain && rec_mm_lookup(J, ix, MM_index)) |
986 | goto handlemm; | 992 | goto handlemm; |
987 | if (irtype_ispri(t)) res = TREF_PRI(t); /* Canonicalize primitives. */ | 993 | if (irtype_ispri(t)) res = TREF_PRI(t); /* Canonicalize primitives. */ |