mirror of
https://github.com/love2d/megasource.git
synced 2026-08-17 19:24:09 +02:00
Update LuaJIT to the latest 2.1.0 source (0bee44c)
This commit is contained in:
+16
-13
@@ -41,15 +41,22 @@ LJ_FUNC void lj_lib_checknumber(lua_State *L, int narg);
|
||||
LJ_FUNC lua_Number lj_lib_checknum(lua_State *L, int narg);
|
||||
LJ_FUNC int32_t lj_lib_checkint(lua_State *L, int narg);
|
||||
LJ_FUNC int32_t lj_lib_optint(lua_State *L, int narg, int32_t def);
|
||||
LJ_FUNC int32_t lj_lib_checkbit(lua_State *L, int narg);
|
||||
LJ_FUNC GCfunc *lj_lib_checkfunc(lua_State *L, int narg);
|
||||
LJ_FUNC GCtab *lj_lib_checktab(lua_State *L, int narg);
|
||||
LJ_FUNC GCtab *lj_lib_checktabornil(lua_State *L, int narg);
|
||||
LJ_FUNC int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst);
|
||||
|
||||
/* Avoid including lj_frame.h. */
|
||||
#if LJ_GC64
|
||||
#define lj_lib_upvalue(L, n) \
|
||||
(&gcval(L->base-2)->fn.c.upvalue[(n)-1])
|
||||
#elif LJ_FR2
|
||||
#define lj_lib_upvalue(L, n) \
|
||||
(&gcref((L->base-2)->gcr)->fn.c.upvalue[(n)-1])
|
||||
#else
|
||||
#define lj_lib_upvalue(L, n) \
|
||||
(&gcref((L->base-1)->fr.func)->fn.c.upvalue[(n)-1])
|
||||
#endif
|
||||
|
||||
#if LJ_TARGET_WINDOWS
|
||||
#define lj_lib_checkfpu(L) \
|
||||
@@ -60,23 +67,14 @@ LJ_FUNC int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst);
|
||||
#define lj_lib_checkfpu(L) UNUSED(L)
|
||||
#endif
|
||||
|
||||
/* Push internal function on the stack. */
|
||||
static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f,
|
||||
int id, int n)
|
||||
{
|
||||
GCfunc *fn;
|
||||
lua_pushcclosure(L, f, n);
|
||||
fn = funcV(L->top-1);
|
||||
fn->c.ffid = (uint8_t)id;
|
||||
setmref(fn->c.pc, &G(L)->bc_cfunc_int);
|
||||
}
|
||||
|
||||
LJ_FUNC GCfunc *lj_lib_pushcc(lua_State *L, lua_CFunction f, int id, int n);
|
||||
#define lj_lib_pushcf(L, fn, id) (lj_lib_pushcc(L, (fn), (id), 0))
|
||||
|
||||
/* Library function declarations. Scanned by buildvm. */
|
||||
#define LJLIB_CF(name) static int lj_cf_##name(lua_State *L)
|
||||
#define LJLIB_ASM(name) static int lj_ffh_##name(lua_State *L)
|
||||
#define LJLIB_ASM_(name)
|
||||
#define LJLIB_LUA(name)
|
||||
#define LJLIB_SET(name)
|
||||
#define LJLIB_PUSH(arg)
|
||||
#define LJLIB_REC(handler)
|
||||
@@ -88,6 +86,10 @@ static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f,
|
||||
|
||||
LJ_FUNC void lj_lib_register(lua_State *L, const char *libname,
|
||||
const uint8_t *init, const lua_CFunction *cf);
|
||||
LJ_FUNC void lj_lib_prereg(lua_State *L, const char *name, lua_CFunction f,
|
||||
GCtab *env);
|
||||
LJ_FUNC int lj_lib_postreg(lua_State *L, lua_CFunction cf, int id,
|
||||
const char *name);
|
||||
|
||||
/* Library init data tags. */
|
||||
#define LIBINIT_LENMASK 0x3f
|
||||
@@ -96,7 +98,8 @@ LJ_FUNC void lj_lib_register(lua_State *L, const char *libname,
|
||||
#define LIBINIT_ASM 0x40
|
||||
#define LIBINIT_ASM_ 0x80
|
||||
#define LIBINIT_STRING 0xc0
|
||||
#define LIBINIT_MAXSTR 0x39
|
||||
#define LIBINIT_MAXSTR 0x38
|
||||
#define LIBINIT_LUA 0xf9
|
||||
#define LIBINIT_SET 0xfa
|
||||
#define LIBINIT_NUMBER 0xfb
|
||||
#define LIBINIT_COPY 0xfc
|
||||
|
||||
Reference in New Issue
Block a user