neutrino: add luajit

Luajit is a dynamic scripting language completely compatible to lua 5.1. the whole VM has been rewritten from the ground up
and is relentlessly optimized for performance. It combines a high-speed interpreter, written in assembler, with a state-of-the-art JIT compiler.
A substantial reduction of the overhead associated with dynamic languages allows it to break into the performance range traditionally reserved for offline,
static language compilers.

https://luajit.org/luajit.html
https://github.com/LuaJIT/LuaJIT/tree/master

There was additional code needed to enable neutrino to compile against lua 5.1. This was mostly taken from the luaposix compat-headers.
There are still some minor issue that will be easy to fix but it's up and running so damn fast!

Signed-off-by: Markus Volk <f_l_k@t-online.de>


Origin commit data
------------------
Branch: ni/coolstream
Commit: ae2df0de4f
Author: Markus Volk <f_l_k@t-online.de>
Date: 2020-09-17 (Thu, 17 Sep 2020)



------------------
This commit was generated by Migit
This commit is contained in:
Markus Volk
2020-09-17 12:12:15 +02:00
committed by vanhofen
parent 3a69b4d40b
commit 1134b182a4
5 changed files with 82 additions and 10 deletions

View File

@@ -1253,4 +1253,41 @@ int CLuaInstance::scale2Res(lua_State *L)
return 1;
}
#if LUA_COMPAT_5_2
void lua_pushunsigned (lua_State *L, lua_Unsigned n) {
lua_pushnumber(L, lua_unsigned2number(n));
}
lua_Unsigned luaL_checkunsigned (lua_State *L, int i) {
lua_Unsigned result;
lua_Number n = lua_tonumber(L, i);
if (n == 0 && !lua_isnumber(L, i))
luaL_checktype(L, i, LUA_TNUMBER);
lua_number2unsigned(result, n);
return result;
}
int lua_absindex (lua_State *L, int i) {
if (i < 0 && i > LUA_REGISTRYINDEX)
i += lua_gettop(L) + 1;
return i;
}
void lua_rawgetp (lua_State *L, int i, const void *p) {
int abs_i = lua_absindex(L, i);
lua_pushlightuserdata(L, (void*)p);
lua_rawget(L, abs_i);
}
void lua_rawsetp (lua_State *L, int i, const void *p) {
int abs_i = lua_absindex(L, i);
luaL_checkstack(L, 1, "not enough stack slots");
lua_pushlightuserdata(L, (void*)p);
lua_insert(L, -2);
lua_rawset(L, abs_i);
}
#endif
/* --------------------------------------------------------------- */