|
@@ -97,6 +97,10 @@ static const char boot_lua[] =
|
|
|
#include "boot.lua"
|
|
|
;
|
|
|
|
|
|
+static const char jit_setup_lua[] =
|
|
|
+#include "jitsetup.lua"
|
|
|
+;
|
|
|
+
|
|
|
// All modules define a c-accessible luaopen
|
|
|
// so let's make use of those, instead
|
|
|
// of addressing implementations directly.
|
|
@@ -160,6 +164,7 @@ extern "C"
|
|
|
extern int luaopen_love_window(lua_State*);
|
|
|
#endif
|
|
|
extern int luaopen_love_nogame(lua_State*);
|
|
|
+ extern int luaopen_love_jitsetup(lua_State*);
|
|
|
extern int luaopen_love_arg(lua_State*);
|
|
|
extern int luaopen_love_callbacks(lua_State*);
|
|
|
extern int luaopen_love_boot(lua_State*);
|
|
@@ -224,6 +229,7 @@ static const luaL_Reg modules[] = {
|
|
|
{ "love.window", luaopen_love_window },
|
|
|
#endif
|
|
|
{ "love.nogame", luaopen_love_nogame },
|
|
|
+ { "love.jitsetup", luaopen_love_jitsetup },
|
|
|
{ "love.arg", luaopen_love_arg },
|
|
|
{ "love.callbacks", luaopen_love_callbacks },
|
|
|
{ "love.boot", luaopen_love_boot },
|
|
@@ -404,6 +410,15 @@ static void luax_addcompatibilityalias(lua_State *L, const char *module, const c
|
|
|
|
|
|
int luaopen_love(lua_State *L)
|
|
|
{
|
|
|
+ // Preload module loaders.
|
|
|
+ for (int i = 0; modules[i].name != nullptr; i++)
|
|
|
+ love::luax_preload(L, modules[i].func, modules[i].name);
|
|
|
+
|
|
|
+ // jitsetup is also loaded in the love executable runlove function. It's
|
|
|
+ // needed here too for threads. Note that it doesn't use the love table.
|
|
|
+ love::luax_require(L, "love.jitsetup");
|
|
|
+ lua_pop(L, 1);
|
|
|
+
|
|
|
love::luax_insistpinnedthread(L);
|
|
|
|
|
|
love::luax_insistglobal(L, "love");
|
|
@@ -501,10 +516,6 @@ int luaopen_love(lua_State *L)
|
|
|
lua_setfield(L, -2, "hasDeprecationOutput");
|
|
|
}
|
|
|
|
|
|
- // Preload module loaders.
|
|
|
- for (int i = 0; modules[i].name != nullptr; i++)
|
|
|
- love::luax_preload(L, modules[i].func, modules[i].name);
|
|
|
-
|
|
|
// Necessary for Data-creating methods to work properly in Data subclasses.
|
|
|
love::luax_require(L, "love.data");
|
|
|
lua_pop(L, 1);
|
|
@@ -657,6 +668,14 @@ int luaopen_love_nogame(lua_State *L)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+int luaopen_love_jitsetup(lua_State *L)
|
|
|
+{
|
|
|
+ if (luaL_loadbuffer(L, jit_setup_lua, sizeof(jit_setup_lua), "jitsetup.lua") == 0)
|
|
|
+ lua_call(L, 0, 1);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
int luaopen_love_arg(lua_State *L)
|
|
|
{
|
|
|
if (luaL_loadbuffer(L, arg_lua, sizeof(arg_lua), "arg.lua") == 0)
|