diff options
author | Mike Pall <mike> | 2010-12-05 18:59:34 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-12-05 18:59:34 +0100 |
commit | 6a7605ec85a6e5f91fc539a9e5c18659d73f3530 (patch) | |
tree | 1d2a8db0e2f1e6dcca30a0bcbf2b91bf88154600 /src/lj_record.c | |
parent | 26830d070df51c72819d1e5515ff5cce0f1132fa (diff) | |
download | luajit-6a7605ec85a6e5f91fc539a9e5c18659d73f3530.tar.gz luajit-6a7605ec85a6e5f91fc539a9e5c18659d73f3530.tar.bz2 luajit-6a7605ec85a6e5f91fc539a9e5c18659d73f3530.zip |
Rename IRT_PTR to IRT_P32.
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 90c06218..de3f6a64 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -594,7 +594,7 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) | |||
594 | } else { /* Return to lower frame. Guard for the target we return to. */ | 594 | } else { /* Return to lower frame. Guard for the target we return to. */ |
595 | TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); | 595 | TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); |
596 | TRef trpc = lj_ir_kptr(J, (void *)frame_pc(frame)); | 596 | TRef trpc = lj_ir_kptr(J, (void *)frame_pc(frame)); |
597 | emitir(IRTG(IR_RETF, IRT_PTR), trpt, trpc); | 597 | emitir(IRTG(IR_RETF, IRT_P32), trpt, trpc); |
598 | J->retdepth++; | 598 | J->retdepth++; |
599 | J->needsnap = 1; | 599 | J->needsnap = 1; |
600 | lua_assert(J->baseslot == 1); | 600 | lua_assert(J->baseslot == 1); |
@@ -826,12 +826,12 @@ static void rec_idx_abc(jit_State *J, TRef asizeref, TRef ikey, uint32_t asize) | |||
826 | /* Runtime value for stop of loop is within bounds? */ | 826 | /* Runtime value for stop of loop is within bounds? */ |
827 | if ((int64_t)stop + ofs < (int64_t)asize) { | 827 | if ((int64_t)stop + ofs < (int64_t)asize) { |
828 | /* Emit invariant bounds check for stop. */ | 828 | /* Emit invariant bounds check for stop. */ |
829 | emitir(IRTG(IR_ABC, IRT_PTR), asizeref, ofs == 0 ? J->scev.stop : | 829 | emitir(IRTG(IR_ABC, IRT_P32), asizeref, ofs == 0 ? J->scev.stop : |
830 | emitir(IRTI(IR_ADD), J->scev.stop, ofsref)); | 830 | emitir(IRTI(IR_ADD), J->scev.stop, ofsref)); |
831 | /* Emit invariant bounds check for start, if not const or negative. */ | 831 | /* Emit invariant bounds check for start, if not const or negative. */ |
832 | if (!(J->scev.dir && J->scev.start && | 832 | if (!(J->scev.dir && J->scev.start && |
833 | (int64_t)IR(J->scev.start)->i + ofs >= 0)) | 833 | (int64_t)IR(J->scev.start)->i + ofs >= 0)) |
834 | emitir(IRTG(IR_ABC, IRT_PTR), asizeref, ikey); | 834 | emitir(IRTG(IR_ABC, IRT_P32), asizeref, ikey); |
835 | return; | 835 | return; |
836 | } | 836 | } |
837 | } | 837 | } |
@@ -861,8 +861,8 @@ static TRef rec_idx_key(jit_State *J, RecordIndex *ix) | |||
861 | if ((MSize)k < t->asize) { /* Currently an array key? */ | 861 | if ((MSize)k < t->asize) { /* Currently an array key? */ |
862 | TRef arrayref; | 862 | TRef arrayref; |
863 | rec_idx_abc(J, asizeref, ikey, t->asize); | 863 | rec_idx_abc(J, asizeref, ikey, t->asize); |
864 | arrayref = emitir(IRT(IR_FLOAD, IRT_PTR), ix->tab, IRFL_TAB_ARRAY); | 864 | arrayref = emitir(IRT(IR_FLOAD, IRT_P32), ix->tab, IRFL_TAB_ARRAY); |
865 | return emitir(IRT(IR_AREF, IRT_PTR), arrayref, ikey); | 865 | return emitir(IRT(IR_AREF, IRT_P32), arrayref, ikey); |
866 | } else { /* Currently not in array (may be an array extension)? */ | 866 | } else { /* Currently not in array (may be an array extension)? */ |
867 | emitir(IRTGI(IR_ULE), asizeref, ikey); /* Inv. bounds check. */ | 867 | emitir(IRTGI(IR_ULE), asizeref, ikey); /* Inv. bounds check. */ |
868 | if (k == 0 && tref_isk(key)) | 868 | if (k == 0 && tref_isk(key)) |
@@ -894,13 +894,13 @@ static TRef rec_idx_key(jit_State *J, RecordIndex *ix) | |||
894 | TRef node, kslot; | 894 | TRef node, kslot; |
895 | TRef hm = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_HMASK); | 895 | TRef hm = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_HMASK); |
896 | emitir(IRTGI(IR_EQ), hm, lj_ir_kint(J, (int32_t)t->hmask)); | 896 | emitir(IRTGI(IR_EQ), hm, lj_ir_kint(J, (int32_t)t->hmask)); |
897 | node = emitir(IRT(IR_FLOAD, IRT_PTR), ix->tab, IRFL_TAB_NODE); | 897 | node = emitir(IRT(IR_FLOAD, IRT_P32), ix->tab, IRFL_TAB_NODE); |
898 | kslot = lj_ir_kslot(J, key, hslot / sizeof(Node)); | 898 | kslot = lj_ir_kslot(J, key, hslot / sizeof(Node)); |
899 | return emitir(IRTG(IR_HREFK, IRT_PTR), node, kslot); | 899 | return emitir(IRTG(IR_HREFK, IRT_P32), node, kslot); |
900 | } | 900 | } |
901 | } | 901 | } |
902 | /* Fall back to a regular hash lookup. */ | 902 | /* Fall back to a regular hash lookup. */ |
903 | return emitir(IRT(IR_HREF, IRT_PTR), ix->tab, key); | 903 | return emitir(IRT(IR_HREF, IRT_P32), ix->tab, key); |
904 | } | 904 | } |
905 | 905 | ||
906 | /* Determine whether a key is NOT one of the fast metamethod names. */ | 906 | /* Determine whether a key is NOT one of the fast metamethod names. */ |
@@ -979,7 +979,7 @@ TRef lj_record_idx(jit_State *J, RecordIndex *ix) | |||
979 | IRType t = itype2irt(oldv); | 979 | IRType t = itype2irt(oldv); |
980 | TRef res; | 980 | TRef res; |
981 | if (oldv == niltvg(J2G(J))) { | 981 | if (oldv == niltvg(J2G(J))) { |
982 | emitir(IRTG(IR_EQ, IRT_PTR), xref, lj_ir_kptr(J, niltvg(J2G(J)))); | 982 | emitir(IRTG(IR_EQ, IRT_P32), xref, lj_ir_kptr(J, niltvg(J2G(J)))); |
983 | res = TREF_NIL; | 983 | res = TREF_NIL; |
984 | } else { | 984 | } else { |
985 | res = emitir(IRTG(loadop, t), xref, 0); | 985 | res = emitir(IRTG(loadop, t), xref, 0); |
@@ -1001,7 +1001,7 @@ TRef lj_record_idx(jit_State *J, RecordIndex *ix) | |||
1001 | if (hasmm) | 1001 | if (hasmm) |
1002 | emitir(IRTG(loadop, IRT_NIL), xref, 0); /* Guard for nil value. */ | 1002 | emitir(IRTG(loadop, IRT_NIL), xref, 0); /* Guard for nil value. */ |
1003 | else if (xrefop == IR_HREF) | 1003 | else if (xrefop == IR_HREF) |
1004 | emitir(IRTG(oldv == niltvg(J2G(J)) ? IR_EQ : IR_NE, IRT_PTR), | 1004 | emitir(IRTG(oldv == niltvg(J2G(J)) ? IR_EQ : IR_NE, IRT_P32), |
1005 | xref, lj_ir_kptr(J, niltvg(J2G(J)))); | 1005 | xref, lj_ir_kptr(J, niltvg(J2G(J)))); |
1006 | if (ix->idxchain && lj_record_mm_lookup(J, ix, MM_newindex)) { | 1006 | if (ix->idxchain && lj_record_mm_lookup(J, ix, MM_newindex)) { |
1007 | lua_assert(hasmm); | 1007 | lua_assert(hasmm); |
@@ -1012,13 +1012,13 @@ TRef lj_record_idx(jit_State *J, RecordIndex *ix) | |||
1012 | TRef key = ix->key; | 1012 | TRef key = ix->key; |
1013 | if (tref_isinteger(key)) /* NEWREF needs a TValue as a key. */ | 1013 | if (tref_isinteger(key)) /* NEWREF needs a TValue as a key. */ |
1014 | key = emitir(IRTN(IR_TONUM), key, 0); | 1014 | key = emitir(IRTN(IR_TONUM), key, 0); |
1015 | xref = emitir(IRT(IR_NEWREF, IRT_PTR), ix->tab, key); | 1015 | xref = emitir(IRT(IR_NEWREF, IRT_P32), ix->tab, key); |
1016 | keybarrier = 0; /* NEWREF already takes care of the key barrier. */ | 1016 | keybarrier = 0; /* NEWREF already takes care of the key barrier. */ |
1017 | } | 1017 | } |
1018 | } else if (!lj_opt_fwd_wasnonnil(J, loadop, tref_ref(xref))) { | 1018 | } else if (!lj_opt_fwd_wasnonnil(J, loadop, tref_ref(xref))) { |
1019 | /* Cannot derive that the previous value was non-nil, must do checks. */ | 1019 | /* Cannot derive that the previous value was non-nil, must do checks. */ |
1020 | if (xrefop == IR_HREF) /* Guard against store to niltv. */ | 1020 | if (xrefop == IR_HREF) /* Guard against store to niltv. */ |
1021 | emitir(IRTG(IR_NE, IRT_PTR), xref, lj_ir_kptr(J, niltvg(J2G(J)))); | 1021 | emitir(IRTG(IR_NE, IRT_P32), xref, lj_ir_kptr(J, niltvg(J2G(J)))); |
1022 | if (ix->idxchain) { /* Metamethod lookup required? */ | 1022 | if (ix->idxchain) { /* Metamethod lookup required? */ |
1023 | /* A check for NULL metatable is cheaper (hoistable) than a load. */ | 1023 | /* A check for NULL metatable is cheaper (hoistable) than a load. */ |
1024 | if (!mt) { | 1024 | if (!mt) { |
@@ -1039,7 +1039,7 @@ TRef lj_record_idx(jit_State *J, RecordIndex *ix) | |||
1039 | emitir(IRT(IR_TBAR, IRT_NIL), ix->tab, 0); | 1039 | emitir(IRT(IR_TBAR, IRT_NIL), ix->tab, 0); |
1040 | /* Invalidate neg. metamethod cache for stores with certain string keys. */ | 1040 | /* Invalidate neg. metamethod cache for stores with certain string keys. */ |
1041 | if (!nommstr(J, ix->key)) { | 1041 | if (!nommstr(J, ix->key)) { |
1042 | TRef fref = emitir(IRT(IR_FREF, IRT_PTR), ix->tab, IRFL_TAB_NOMM); | 1042 | TRef fref = emitir(IRT(IR_FREF, IRT_P32), ix->tab, IRFL_TAB_NOMM); |
1043 | emitir(IRT(IR_FSTORE, IRT_U8), fref, lj_ir_kint(J, 0)); | 1043 | emitir(IRT(IR_FSTORE, IRT_U8), fref, lj_ir_kint(J, 0)); |
1044 | } | 1044 | } |
1045 | J->needsnap = 1; | 1045 | J->needsnap = 1; |
@@ -1075,10 +1075,10 @@ static TRef rec_upvalue(jit_State *J, uint32_t uv, TRef val) | |||
1075 | } | 1075 | } |
1076 | } | 1076 | } |
1077 | } | 1077 | } |
1078 | uref = tref_ref(emitir(IRTG(IR_UREFO, IRT_PTR), fn, uv)); | 1078 | uref = tref_ref(emitir(IRTG(IR_UREFO, IRT_P32), fn, uv)); |
1079 | } else { | 1079 | } else { |
1080 | needbarrier = 1; | 1080 | needbarrier = 1; |
1081 | uref = tref_ref(emitir(IRTG(IR_UREFC, IRT_PTR), fn, uv)); | 1081 | uref = tref_ref(emitir(IRTG(IR_UREFC, IRT_P32), fn, uv)); |
1082 | } | 1082 | } |
1083 | if (val == 0) { /* Upvalue load */ | 1083 | if (val == 0) { /* Upvalue load */ |
1084 | IRType t = itype2irt(uvval(uvp)); | 1084 | IRType t = itype2irt(uvval(uvp)); |
@@ -1218,10 +1218,10 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults) | |||
1218 | else | 1218 | else |
1219 | emitir(IRTGI(IR_EQ), fr, lj_ir_kint(J, frame_ftsz(J->L->base-1))); | 1219 | emitir(IRTGI(IR_EQ), fr, lj_ir_kint(J, frame_ftsz(J->L->base-1))); |
1220 | vbase = emitir(IRTI(IR_SUB), REF_BASE, fr); | 1220 | vbase = emitir(IRTI(IR_SUB), REF_BASE, fr); |
1221 | vbase = emitir(IRT(IR_ADD, IRT_PTR), vbase, lj_ir_kint(J, frofs-8)); | 1221 | vbase = emitir(IRT(IR_ADD, IRT_P32), vbase, lj_ir_kint(J, frofs-8)); |
1222 | for (i = 0; i < nload; i++) { | 1222 | for (i = 0; i < nload; i++) { |
1223 | IRType t = itype2irt(&J->L->base[i-1-nvararg]); | 1223 | IRType t = itype2irt(&J->L->base[i-1-nvararg]); |
1224 | TRef aref = emitir(IRT(IR_AREF, IRT_PTR), | 1224 | TRef aref = emitir(IRT(IR_AREF, IRT_P32), |
1225 | vbase, lj_ir_kint(J, (int32_t)i)); | 1225 | vbase, lj_ir_kint(J, (int32_t)i)); |
1226 | TRef tr = emitir(IRTG(IR_VLOAD, t), aref, 0); | 1226 | TRef tr = emitir(IRTG(IR_VLOAD, t), aref, 0); |
1227 | if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */ | 1227 | if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */ |
@@ -1268,9 +1268,9 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults) | |||
1268 | if (idx != 0 && idx <= nvararg) { | 1268 | if (idx != 0 && idx <= nvararg) { |
1269 | IRType t; | 1269 | IRType t; |
1270 | TRef aref, vbase = emitir(IRTI(IR_SUB), REF_BASE, fr); | 1270 | TRef aref, vbase = emitir(IRTI(IR_SUB), REF_BASE, fr); |
1271 | vbase = emitir(IRT(IR_ADD, IRT_PTR), vbase, lj_ir_kint(J, frofs-8)); | 1271 | vbase = emitir(IRT(IR_ADD, IRT_P32), vbase, lj_ir_kint(J, frofs-8)); |
1272 | t = itype2irt(&J->L->base[idx-2-nvararg]); | 1272 | t = itype2irt(&J->L->base[idx-2-nvararg]); |
1273 | aref = emitir(IRT(IR_AREF, IRT_PTR), vbase, tridx); | 1273 | aref = emitir(IRT(IR_AREF, IRT_P32), vbase, tridx); |
1274 | tr = emitir(IRTG(IR_VLOAD, t), aref, 0); | 1274 | tr = emitir(IRTG(IR_VLOAD, t), aref, 0); |
1275 | if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */ | 1275 | if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */ |
1276 | } | 1276 | } |
@@ -1913,7 +1913,7 @@ void lj_record_setup(jit_State *J) | |||
1913 | J->bc_extent = ~(MSize)0; | 1913 | J->bc_extent = ~(MSize)0; |
1914 | 1914 | ||
1915 | /* Emit instructions for fixed references. Also triggers initial IR alloc. */ | 1915 | /* Emit instructions for fixed references. Also triggers initial IR alloc. */ |
1916 | emitir_raw(IRT(IR_BASE, IRT_PTR), J->parent, J->exitno); | 1916 | emitir_raw(IRT(IR_BASE, IRT_P32), J->parent, J->exitno); |
1917 | for (i = 0; i <= 2; i++) { | 1917 | for (i = 0; i <= 2; i++) { |
1918 | IRIns *ir = IR(REF_NIL-i); | 1918 | IRIns *ir = IR(REF_NIL-i); |
1919 | ir->i = 0; | 1919 | ir->i = 0; |