diff options
| author | Mike Pall <mike> | 2026-07-20 10:20:28 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2026-07-20 10:20:28 +0200 |
| commit | 6f2ec80c11c2bd23e2ba792ae27a4febc8dddc8c (patch) | |
| tree | 58ddd00fc12a6718b736ce893c4470cbceca2332 /src | |
| parent | 329b7912088095a00685285180d705f6d131e6f0 (diff) | |
| parent | 14d8a7a27dc8c626ab9e7c7e9e50b6df6def4f03 (diff) | |
| download | luajit-temp-v3bp-syntax1.tar.gz luajit-temp-v3bp-syntax1.tar.bz2 luajit-temp-v3bp-syntax1.zip | |
Merge branch 'v2.1' into temp-v3bp-syntax1temp-v3bp-syntax1
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_asm_x86.h | 11 | ||||
| -rw-r--r-- | src/lj_ccallback.c | 4 | ||||
| -rw-r--r-- | src/lj_profile.c | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 943cf2b77..3c024092c 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
| @@ -1112,10 +1112,12 @@ static void asm_tvptr(ASMState *as, Reg dest, IRRef ref, MSize mode) | |||
| 1112 | } else { | 1112 | } else { |
| 1113 | #if LJ_GC64 | 1113 | #if LJ_GC64 |
| 1114 | if (irref_isk(ref)) { | 1114 | if (irref_isk(ref)) { |
| 1115 | Reg tmp; | ||
| 1115 | TValue k; | 1116 | TValue k; |
| 1116 | lj_ir_kvalue(as->J->L, &k, ir); | 1117 | lj_ir_kvalue(as->J->L, &k, ir); |
| 1117 | emit_movmroi(as, dest, 4, k.u32.hi); | 1118 | tmp = ra_scratch(as, rset_exclude(RSET_GPR, dest)); |
| 1118 | emit_movmroi(as, dest, 0, k.u32.lo); | 1119 | emit_rmro(as, XO_MOVto, tmp|REX_64, dest, 0); |
| 1120 | emit_loadu64(as, tmp, k.u64); | ||
| 1119 | } else { | 1121 | } else { |
| 1120 | /* TODO: 64 bit store + 32 bit load-modify-store is suboptimal. */ | 1122 | /* TODO: 64 bit store + 32 bit load-modify-store is suboptimal. */ |
| 1121 | Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, dest)); | 1123 | Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, dest)); |
| @@ -2787,8 +2789,9 @@ static void asm_stack_restore(ASMState *as, SnapShot *snap) | |||
| 2787 | emit_i32(as, -1); | 2789 | emit_i32(as, -1); |
| 2788 | emit_rmro(as, XO_MOVmi, REX_64, RID_BASE, ofs); | 2790 | emit_rmro(as, XO_MOVmi, REX_64, RID_BASE, ofs); |
| 2789 | } else { | 2791 | } else { |
| 2790 | emit_movmroi(as, RID_BASE, ofs+4, k.u32.hi); | 2792 | Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, RID_BASE)); |
| 2791 | emit_movmroi(as, RID_BASE, ofs, k.u32.lo); | 2793 | emit_rmro(as, XO_MOVto, tmp|REX_64, RID_BASE, ofs); |
| 2794 | emit_loadu64(as, tmp, k.u64); | ||
| 2792 | } | 2795 | } |
| 2793 | #else | 2796 | #else |
| 2794 | } else if (!irt_ispri(ir->t)) { | 2797 | } else if (!irt_ispri(ir->t)) { |
diff --git a/src/lj_ccallback.c b/src/lj_ccallback.c index 724dea607..2ed84507a 100644 --- a/src/lj_ccallback.c +++ b/src/lj_ccallback.c | |||
| @@ -704,6 +704,10 @@ static void callback_conv_result(CTState *cts, lua_State *L, TValue *o) | |||
| 704 | if (ctr->size <= 4 && | 704 | if (ctr->size <= 4 && |
| 705 | (LJ_ABI_SOFTFP || ctype_isinteger_or_bool(ctr->info))) | 705 | (LJ_ABI_SOFTFP || ctype_isinteger_or_bool(ctr->info))) |
| 706 | *(int64_t *)dp = (int64_t)*(int32_t *)dp; | 706 | *(int64_t *)dp = (int64_t)*(int32_t *)dp; |
| 707 | #elif LJ_TARGET_X64 | ||
| 708 | /* Always zero-extend results to 64 bits. */ | ||
| 709 | if (ctr->size <= 4 && ctype_isinteger_or_bool(ctr->info)) | ||
| 710 | *(uint64_t *)dp = (uint64_t)*(uint32_t *)dp; | ||
| 707 | #endif | 711 | #endif |
| 708 | #if LJ_TARGET_X86 | 712 | #if LJ_TARGET_X86 |
| 709 | if (ctype_isfp(ctr->info)) | 713 | if (ctype_isfp(ctr->info)) |
diff --git a/src/lj_profile.c b/src/lj_profile.c index 5b2a2b6c7..ea65fcb8f 100644 --- a/src/lj_profile.c +++ b/src/lj_profile.c | |||
| @@ -359,6 +359,7 @@ LUA_API void luaJIT_profile_stop(lua_State *L) | |||
| 359 | ProfileState *ps = &profile_state; | 359 | ProfileState *ps = &profile_state; |
| 360 | global_State *g = ps->g; | 360 | global_State *g = ps->g; |
| 361 | if (G(L) == g) { /* Only stop profiler if started by this VM. */ | 361 | if (G(L) == g) { /* Only stop profiler if started by this VM. */ |
| 362 | ps->g = NULL; | ||
| 362 | profile_timer_stop(ps); | 363 | profile_timer_stop(ps); |
| 363 | g->hookmask &= ~HOOK_PROFILE; | 364 | g->hookmask &= ~HOOK_PROFILE; |
| 364 | lj_dispatch_update(g, 0); | 365 | lj_dispatch_update(g, 0); |
| @@ -368,7 +369,6 @@ LUA_API void luaJIT_profile_stop(lua_State *L) | |||
| 368 | #endif | 369 | #endif |
| 369 | lj_buf_free(g, &ps->sb); | 370 | lj_buf_free(g, &ps->sb); |
| 370 | ps->sb.w = ps->sb.e = NULL; | 371 | ps->sb.w = ps->sb.e = NULL; |
| 371 | ps->g = NULL; | ||
| 372 | } | 372 | } |
| 373 | } | 373 | } |
| 374 | 374 | ||
