Merge branch 'main' into 12.0-development

This commit is contained in:
Sasha Szpakowski
2023-12-02 13:40:49 -04:00
12 changed files with 78 additions and 88 deletions
+6 -2
View File
@@ -33,9 +33,9 @@ jit.opt.start("maxtrace=2000", "maxrecord=8000")
-- and higher than the default (512) because that's already too low.
jit.opt.start("maxmcode=16384")
if jit.arch == "arm64" then
if jit.arch == "arm64" or jit.arch == "arm" then
-- https://github.com/LuaJIT/LuaJIT/issues/285
-- LuaJIT 2.1 on arm64 currently (as of commit b4b2dce) can only use memory
-- LuaJIT 2.1 on arm(64) currently (as of commit b4b2dce) can only use memory
-- for JIT compilation within a certain short range. Other libraries such as
-- SDL can take all the usable space in that range and cause attempts at JIT
-- compilation to both fail and take a long time.
@@ -62,6 +62,10 @@ if jit.arch == "arm64" then
jit.opt.start("sizemcode=128")
for i=1, 100 do end
-- Actually just turn the whole thing off for arm(64). It's very hard to get
-- reliable performance in non-trivial games even with the above workaround.
jit.off()
else
-- Somewhat arbitrary value (>= the default).
jit.opt.start("sizemcode=128")
-10
View File
@@ -38,10 +38,6 @@
#ifdef LOVE_ANDROID
#include <SDL.h>
extern "C"
{
#include "luajit.h"
}
#endif // LOVE_ANDROID
#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK
@@ -529,11 +525,6 @@ int luaopen_love(lua_State *L)
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");
@@ -553,7 +544,6 @@ int luaopen_love(lua_State *L)
lua_setfield(L, -2, "_version_codename");
#ifdef LOVE_ANDROID
luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE | LUAJIT_MODE_OFF);
lua_register(L, "print", w_print_sdl_log);
#endif
@@ -32,6 +32,8 @@ namespace physics
namespace box2d
{
love::Type DistanceJoint::type("DistanceJoint", &Joint::type);
DistanceJoint::DistanceJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, bool collideConnected)
: Joint(body1, body2)
, joint(NULL)
@@ -39,6 +39,8 @@ class DistanceJoint : public Joint
{
public:
static love::Type type;
/**
* Creates a DistanceJoint connecting body1 to body2.
**/
+8
View File
@@ -25,6 +25,7 @@
#ifdef LOVE_BUILD_STANDALONE
extern "C" int luaopen_love(lua_State * L);
extern "C" int luaopen_love_jitsetup(lua_State * L);
#endif // LOVE_BUILD_STANDALONE
namespace love
@@ -55,6 +56,13 @@ void LuaThread::threadFunction()
luaL_openlibs(L);
#ifdef LOVE_BUILD_STANDALONE
// Call LuaJIT-specific setup again. While it's quite late to call it at
// this point, it still needed to turn off JIT compilation (if necessary)
// for this thread.
luax_preload(L, luaopen_love_jitsetup, "love.jitsetup");
luax_require(L, "love.jitsetup");
lua_pop(L, 1);
luax_preload(L, luaopen_love, "love");
luax_require(L, "love");
lua_pop(L, 1);