From: Mike Pall Date: Mon, 19 Aug 2024 14:22:55 +0000 (+0200) Subject: Merge branch 'master' into v2.1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fddc9650d85ec6021c4e3509753b9a88766c5ae1;p=thirdparty%2FLuaJIT.git Merge branch 'master' into v2.1 --- fddc9650d85ec6021c4e3509753b9a88766c5ae1 diff --cc src/lj_asm_mips.h index 5b83e34d,3adb62f4..2f64f491 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h @@@ -455,30 -397,9 +455,30 @@@ static void asm_retf(ASMState *as, IRIn emit_setgl(as, base, jit_base); emit_addptr(as, base, -8*delta); asm_guard(as, MIPSI_BNE, RID_TMP, - ra_allock(as, i32ptr(pc), rset_exclude(RSET_GPR, base))); - emit_tsi(as, MIPSI_LW, RID_TMP, base, LJ_BE ? -8 : -4); + ra_allock(as, igcptr(pc), rset_exclude(RSET_GPR, base))); - emit_tsi(as, MIPSI_AL, RID_TMP, base, -8); ++ emit_tsi(as, MIPSI_AL, RID_TMP, base, (LJ_BE || LJ_FR2) ? -8 : -4); +} + +/* -- Buffer operations --------------------------------------------------- */ + +#if LJ_HASBUFFER +static void asm_bufhdr_write(ASMState *as, Reg sb) +{ + Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb)); + IRIns irgc; + irgc.ot = IRT(0, IRT_PGC); /* GC type. */ + emit_storeofs(as, &irgc, RID_TMP, sb, offsetof(SBuf, L)); + if ((as->flags & JIT_F_MIPSXXR2)) { + emit_tsml(as, LJ_64 ? MIPSI_DINS : MIPSI_INS, RID_TMP, tmp, + lj_fls(SBUF_MASK_FLAG), 0); + } else { + emit_dst(as, MIPSI_OR, RID_TMP, RID_TMP, tmp); + emit_tsi(as, MIPSI_ANDI, tmp, tmp, SBUF_MASK_FLAG); + } + emit_getgl(as, RID_TMP, cur_L); + emit_loadofs(as, &irgc, tmp, sb, offsetof(SBuf, L)); } +#endif /* -- Type conversions ---------------------------------------------------- */ diff --cc src/lj_gc.c index 9cabdef0,25374d03..69e78706 --- a/src/lj_gc.c +++ b/src/lj_gc.c @@@ -608,9 -568,8 +608,8 @@@ void lj_gc_freeall(global_State *g /* Free everything, except super-fixed objects (the main thread). */ g->gc.currentwhite = LJ_GC_WHITES | LJ_GC_SFIXED; gc_fullsweep(g, &g->gc.root); - strmask = g->str.mask; - for (i = 0; i <= strmask; i++) /* Free all string hash chains. */ - for (i = g->strmask; i != ~(MSize)0; i--) /* Free all string hash chains. */ - gc_fullsweep(g, &g->strhash[i]); ++ for (i = g->str.mask; i != ~(MSize)0; i--) /* Free all string hash chains. */ + gc_sweepstr(g, &g->str.tab[i]); } /* -- Collector ----------------------------------------------------------- */