aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2025-07-24 15:41:35 +0200
committerMike Pall <mike>2025-07-24 15:41:35 +0200
commiteed22e9ad925baf718186cd3931f6547fd912551 (patch)
tree4d69cc1c0ffc446e250e42c66f277f221e8d30bd /src
parentf9140a622a0c44a99efb391cc1c2358bc8098ab7 (diff)
parentc92d0cb19263e7e302b4740ba6617a32c201c613 (diff)
downloadluajit-eed22e9ad925baf718186cd3931f6547fd912551.tar.gz
luajit-eed22e9ad925baf718186cd3931f6547fd912551.tar.bz2
luajit-eed22e9ad925baf718186cd3931f6547fd912551.zip
Merge branch 'master' into v2.1
Diffstat (limited to 'src')
-rw-r--r--src/lj_asm_x86.h3
-rw-r--r--src/lj_crecord.c11
-rw-r--r--src/lj_debug.c1
3 files changed, 9 insertions, 6 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h
index 936ff438..774e77b4 100644
--- a/src/lj_asm_x86.h
+++ b/src/lj_asm_x86.h
@@ -2084,7 +2084,8 @@ static void asm_intarith(ASMState *as, IRIns *ir, x86Arith xa)
2084 RegSet allow = RSET_GPR; 2084 RegSet allow = RSET_GPR;
2085 Reg dest, right; 2085 Reg dest, right;
2086 int32_t k = 0; 2086 int32_t k = 0;
2087 if (as->flagmcp == as->mcp) { /* Drop test r,r instruction. */ 2087 if (as->flagmcp == as->mcp && xa != XOg_X_IMUL) {
2088 /* Drop test r,r instruction. */
2088 MCode *p = as->mcp + ((LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2); 2089 MCode *p = as->mcp + ((LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2);
2089 MCode *q = p[0] == 0x0f ? p+1 : p; 2090 MCode *q = p[0] == 0x0f ? p+1 : p;
2090 if ((*q & 15) < 14) { 2091 if ((*q & 15) < 14) {
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index bbf002bd..27f2c1dd 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -1261,6 +1261,7 @@ static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd)
1261 if (ctype_isfunc(info)) { 1261 if (ctype_isfunc(info)) {
1262 TRef func = emitir(IRT(IR_FLOAD, tp), J->base[0], IRFL_CDATA_PTR); 1262 TRef func = emitir(IRT(IR_FLOAD, tp), J->base[0], IRFL_CDATA_PTR);
1263 CType *ctr = ctype_rawchild(cts, ct); 1263 CType *ctr = ctype_rawchild(cts, ct);
1264 CTInfo ctr_info = ctr->info; /* crec_call_args may invalidate ctr. */
1264 IRType t = crec_ct2irt(cts, ctr); 1265 IRType t = crec_ct2irt(cts, ctr);
1265 TRef tr; 1266 TRef tr;
1266 TValue tv; 1267 TValue tv;
@@ -1268,11 +1269,11 @@ static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd)
1268 tv.u64 = ((uintptr_t)cdata_getptr(cdataptr(cd), (LJ_64 && tp == IRT_P64) ? 8 : 4) >> 2) | U64x(800000000, 00000000); 1269 tv.u64 = ((uintptr_t)cdata_getptr(cdataptr(cd), (LJ_64 && tp == IRT_P64) ? 8 : 4) >> 2) | U64x(800000000, 00000000);
1269 if (tvistrue(lj_tab_get(J->L, cts->miscmap, &tv))) 1270 if (tvistrue(lj_tab_get(J->L, cts->miscmap, &tv)))
1270 lj_trace_err(J, LJ_TRERR_BLACKL); 1271 lj_trace_err(J, LJ_TRERR_BLACKL);
1271 if (ctype_isvoid(ctr->info)) { 1272 if (ctype_isvoid(ctr_info)) {
1272 t = IRT_NIL; 1273 t = IRT_NIL;
1273 rd->nres = 0; 1274 rd->nres = 0;
1274 } else if (!(ctype_isnum(ctr->info) || ctype_isptr(ctr->info) || 1275 } else if (!(ctype_isnum(ctr_info) || ctype_isptr(ctr_info) ||
1275 ctype_isenum(ctr->info)) || t == IRT_CDATA) { 1276 ctype_isenum(ctr_info)) || t == IRT_CDATA) {
1276 lj_trace_err(J, LJ_TRERR_NYICALL); 1277 lj_trace_err(J, LJ_TRERR_NYICALL);
1277 } 1278 }
1278 if ((info & CTF_VARARG) 1279 if ((info & CTF_VARARG)
@@ -1283,7 +1284,7 @@ static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd)
1283 func = emitir(IRT(IR_CARG, IRT_NIL), func, 1284 func = emitir(IRT(IR_CARG, IRT_NIL), func,
1284 lj_ir_kint(J, ctype_typeid(cts, ct))); 1285 lj_ir_kint(J, ctype_typeid(cts, ct)));
1285 tr = emitir(IRT(IR_CALLXS, t), crec_call_args(J, rd, cts, ct), func); 1286 tr = emitir(IRT(IR_CALLXS, t), crec_call_args(J, rd, cts, ct), func);
1286 if (ctype_isbool(ctr->info)) { 1287 if (ctype_isbool(ctr_info)) {
1287 if (frame_islua(J->L->base-1) && bc_b(frame_pc(J->L->base-1)[-1]) == 1) { 1288 if (frame_islua(J->L->base-1) && bc_b(frame_pc(J->L->base-1)[-1]) == 1) {
1288 /* Don't check result if ignored. */ 1289 /* Don't check result if ignored. */
1289 tr = TREF_NIL; 1290 tr = TREF_NIL;
@@ -1299,7 +1300,7 @@ static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd)
1299 tr = TREF_TRUE; 1300 tr = TREF_TRUE;
1300 } 1301 }
1301 } else if (t == IRT_PTR || (LJ_64 && t == IRT_P32) || 1302 } else if (t == IRT_PTR || (LJ_64 && t == IRT_P32) ||
1302 t == IRT_I64 || t == IRT_U64 || ctype_isenum(ctr->info)) { 1303 t == IRT_I64 || t == IRT_U64 || ctype_isenum(ctr_info)) {
1303 TRef trid = lj_ir_kint(J, ctype_cid(info)); 1304 TRef trid = lj_ir_kint(J, ctype_cid(info));
1304 tr = emitir(IRTG(IR_CNEWI, IRT_CDATA), trid, tr); 1305 tr = emitir(IRTG(IR_CNEWI, IRT_CDATA), trid, tr);
1305 if (t == IRT_I64 || t == IRT_U64) lj_needsplit(J); 1306 if (t == IRT_I64 || t == IRT_U64) lj_needsplit(J);
diff --git a/src/lj_debug.c b/src/lj_debug.c
index b3d52afc..f9392d8e 100644
--- a/src/lj_debug.c
+++ b/src/lj_debug.c
@@ -101,6 +101,7 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
101 pt = funcproto(fn); 101 pt = funcproto(fn);
102 pos = proto_bcpos(pt, ins) - 1; 102 pos = proto_bcpos(pt, ins) - 1;
103#if LJ_HASJIT 103#if LJ_HASJIT
104 if (pos == NO_BCPOS) return 1; /* Pretend it's the first bytecode. */
104 if (pos > pt->sizebc) { /* Undo the effects of lj_trace_exit for JLOOP. */ 105 if (pos > pt->sizebc) { /* Undo the effects of lj_trace_exit for JLOOP. */
105 if (bc_isret(bc_op(ins[-1]))) { 106 if (bc_isret(bc_op(ins[-1]))) {
106 GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins)); 107 GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins));