String buffers, part 3d: Compile string buffer methods and functions.

Sponsored by fmad.io.
This commit is contained in:
Mike Pall
2021-07-19 16:53:30 +02:00
parent 2182630903
commit 29bc1f04ac
18 changed files with 625 additions and 87 deletions

View File

@@ -941,25 +941,27 @@ LJ_NOINLINE void lj_err_optype_call(lua_State *L, TValue *o)
/* Error in context of caller. */
LJ_NOINLINE void lj_err_callermsg(lua_State *L, const char *msg)
{
TValue *frame = L->base-1;
TValue *pframe = NULL;
if (frame_islua(frame)) {
pframe = frame_prevl(frame);
} else if (frame_iscont(frame)) {
if (frame_iscont_fficb(frame)) {
pframe = frame;
frame = NULL;
} else {
pframe = frame_prevd(frame);
TValue *frame = NULL, *pframe = NULL;
if (!(LJ_HASJIT && tvref(G(L)->jit_base))) {
frame = L->base-1;
if (frame_islua(frame)) {
pframe = frame_prevl(frame);
} else if (frame_iscont(frame)) {
if (frame_iscont_fficb(frame)) {
pframe = frame;
frame = NULL;
} else {
pframe = frame_prevd(frame);
#if LJ_HASFFI
/* Remove frame for FFI metamethods. */
if (frame_func(frame)->c.ffid >= FF_ffi_meta___index &&
frame_func(frame)->c.ffid <= FF_ffi_meta___tostring) {
L->base = pframe+1;
L->top = frame;
setcframe_pc(cframe_raw(L->cframe), frame_contpc(frame));
}
/* Remove frame for FFI metamethods. */
if (frame_func(frame)->c.ffid >= FF_ffi_meta___index &&
frame_func(frame)->c.ffid <= FF_ffi_meta___tostring) {
L->base = pframe+1;
L->top = frame;
setcframe_pc(cframe_raw(L->cframe), frame_contpc(frame));
}
#endif
}
}
}
lj_debug_addloc(L, msg, pframe, frame);