diff --git a/src/lj_bc.h b/src/lj_bc.h index af532716..02356e5b 100644 --- a/src/lj_bc.h +++ b/src/lj_bc.h @@ -144,7 +144,6 @@ _(GSET, var, ___, str, newindex) \ _(TGETV, dst, var, var, index) \ _(TGETS, dst, var, str, index) \ - _(TGETSS, dst, var, str, index) \ _(TGETB, dst, var, lit, index) \ _(TGETR, dst, var, var, index) \ _(TSETV, var, var, var, newindex) \ @@ -260,8 +259,6 @@ static LJ_AINLINE int bc_isret(BCOp op) return (op == BC_RETM || op == BC_RET || op == BC_RET0 || op == BC_RET1); } -#define bc_isalias(op) ((op) == BC_TGETSS) - LJ_DATA const uint16_t lj_bc_mode[]; LJ_DATA const uint16_t lj_bc_ofs[]; diff --git a/src/lj_debug.c b/src/lj_debug.c index 65e7fac2..112f5358 100644 --- a/src/lj_debug.c +++ b/src/lj_debug.c @@ -271,10 +271,13 @@ restart: return "global"; case BC_TGETS: *name = strdata(gco2str(proto_kgc(pt, ~(ptrdiff_t)bc_c(ins)))); + if (ip > proto_bc(pt)) { + BCIns insp = ip[-1]; + if (bc_op(insp) == BC_MOV && bc_a(insp) == ra+1+LJ_FR2 && + bc_d(insp) == bc_b(ins)) + return "method"; + } return "field"; - case BC_TGETSS: - *name = strdata(gco2str(proto_kgc(pt, ~(ptrdiff_t)bc_c(ins)))); - return "method"; case BC_UGET: *name = lj_debug_uvname(pt, bc_d(ins)); return "upvalue"; diff --git a/src/lj_parse.c b/src/lj_parse.c index 42006483..9ddf60ed 100644 --- a/src/lj_parse.c +++ b/src/lj_parse.c @@ -675,7 +675,7 @@ static void bcemit_method(FuncState *fs, ExpDesc *e, ExpDesc *key) idx = const_str(fs, key); if (idx <= BCMAX_C) { bcreg_reserve(fs, 2+LJ_FR2); - bcemit_ABC(fs, BC_TGETSS, func, obj, idx); + bcemit_ABC(fs, BC_TGETS, func, obj, idx); } else { bcreg_reserve(fs, 3+LJ_FR2); bcemit_AD(fs, BC_KSTR, func+2+LJ_FR2, idx); diff --git a/src/lj_record.c b/src/lj_record.c index e15d4099..8ec0346e 100644 --- a/src/lj_record.c +++ b/src/lj_record.c @@ -2503,12 +2503,6 @@ void lj_record_ins(jit_State *J) /* fallthrough */ case BC_TGETV: case BC_TGETS: case BC_TSETV: case BC_TSETS: ix.idxchain = LJ_MAX_IDXCHAIN; - ix.mtspec = 0; - rc = lj_record_idx(J, &ix); - break; - case BC_TGETSS: - ix.idxchain = LJ_MAX_IDXCHAIN; - ix.mtspec = 1; rc = lj_record_idx(J, &ix); break; case BC_TGETR: case BC_TSETR: diff --git a/src/vm_arm.dasc b/src/vm_arm.dasc index 41419336..770c1602 100644 --- a/src/vm_arm.dasc +++ b/src/vm_arm.dasc @@ -2592,10 +2592,6 @@ static void build_subroutines(BuildCtx *ctx) static void build_ins(BuildCtx *ctx, BCOp op, int defop) { int vk = 0; - - if (bc_isalias(op)) - return; - |=>defop: switch (op) { @@ -3546,7 +3542,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | b ->vmeta_tgetv break; case BC_TGETS: - |=>BC_TGETSS: | decode_RB8 RB, INS | and RC, RC, #255 | // RA = dst*8, RB = table*8, RC = str_const (~) diff --git a/src/vm_arm64.dasc b/src/vm_arm64.dasc index b03f0171..3448d0d2 100644 --- a/src/vm_arm64.dasc +++ b/src/vm_arm64.dasc @@ -2226,10 +2226,6 @@ static void build_subroutines(BuildCtx *ctx) static void build_ins(BuildCtx *ctx, BCOp op, int defop) { int vk = 0; - - if (bc_isalias(op)) - return; - |=>defop: switch (op) { @@ -2996,7 +2992,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | b ->BC_TGETS_Z break; case BC_TGETS: - |=>BC_TGETSS: | decode_RB RB, INS | and RC, RC, #255 | // RA = dst, RB = table, RC = str_const (~) diff --git a/src/vm_mips.dasc b/src/vm_mips.dasc index d863ddf8..34645bf1 100644 --- a/src/vm_mips.dasc +++ b/src/vm_mips.dasc @@ -2981,10 +2981,6 @@ static void build_subroutines(BuildCtx *ctx) static void build_ins(BuildCtx *ctx, BCOp op, int defop) { int vk = 0; - - if (bc_isalias(op)) - return; - |=>defop: switch (op) { @@ -4080,7 +4076,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) |. nop break; case BC_TGETS: - |=>BC_TGETSS: | // RA = dst*8, RB = table*8, RC = str_const*4 (~) | decode_RB8a RB, INS | decode_RB8b RB diff --git a/src/vm_mips64.dasc b/src/vm_mips64.dasc index bb13b0a0..651bc42e 100644 --- a/src/vm_mips64.dasc +++ b/src/vm_mips64.dasc @@ -3104,10 +3104,6 @@ static void build_subroutines(BuildCtx *ctx) static void build_ins(BuildCtx *ctx, BCOp op, int defop) { int vk = 0; - - if (bc_isalias(op)) - return; - |=>defop: switch (op) { @@ -4294,7 +4290,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) |. nop break; case BC_TGETS: - |=>BC_TGETSS: | // RA = dst*8, RB = table*8, RC = str_const*8 (~) | decode_RB8a RB, INS | decode_RB8b RB diff --git a/src/vm_ppc.dasc b/src/vm_ppc.dasc index 2976cc39..3cad37d2 100644 --- a/src/vm_ppc.dasc +++ b/src/vm_ppc.dasc @@ -3310,10 +3310,6 @@ static void build_subroutines(BuildCtx *ctx) static void build_ins(BuildCtx *ctx, BCOp op, int defop) { int vk = 0; - - if (bc_isalias(op)) - return; - |=>defop: switch (op) { @@ -4567,7 +4563,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | b ->BC_TGETS_Z // String key? break; case BC_TGETS: - |=>BC_TGETSS: | // RA = dst*8, RB = table*8, RC = str_const*8 (~) | lwzux CARG1, RB, BASE | srwi TMP1, RC, 1 diff --git a/src/vm_x64.dasc b/src/vm_x64.dasc index a5313bae..03d96557 100644 --- a/src/vm_x64.dasc +++ b/src/vm_x64.dasc @@ -2796,10 +2796,6 @@ static void build_subroutines(BuildCtx *ctx) static void build_ins(BuildCtx *ctx, BCOp op, int defop) { int vk = 0; - - if (bc_isalias(op)) - return; - |// Note: aligning all instructions does not pay off. |=>defop: @@ -3682,7 +3678,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | jmp ->BC_TGETS_Z break; case BC_TGETS: - |=>BC_TGETSS: | ins_ABC // RA = dst, RB = table, RC = str const (~) | mov TAB:RB, [BASE+RB*8] | not RC diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index c3277fd3..18ca87b5 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc @@ -3381,10 +3381,6 @@ static void build_subroutines(BuildCtx *ctx) static void build_ins(BuildCtx *ctx, BCOp op, int defop) { int vk = 0; - - if (bc_isalias(op)) - return; - |// Note: aligning all instructions does not pay off. |=>defop: @@ -4313,7 +4309,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | jmp ->BC_TGETS_Z break; case BC_TGETS: - |=>BC_TGETSS: | ins_ABC // RA = dst, RB = table, RC = str const (~) | not RCa | mov STR:RC, [KBASE+RC*4]