diff options
Diffstat (limited to 'Build/source/libs/luajit/LuaJIT-PATCHES/patch-05-LuaJITTeX')
-rw-r--r-- | Build/source/libs/luajit/LuaJIT-PATCHES/patch-05-LuaJITTeX | 75 |
1 files changed, 20 insertions, 55 deletions
diff --git a/Build/source/libs/luajit/LuaJIT-PATCHES/patch-05-LuaJITTeX b/Build/source/libs/luajit/LuaJIT-PATCHES/patch-05-LuaJITTeX index 3a05a52d896..c2818a71b9d 100644 --- a/Build/source/libs/luajit/LuaJIT-PATCHES/patch-05-LuaJITTeX +++ b/Build/source/libs/luajit/LuaJIT-PATCHES/patch-05-LuaJITTeX @@ -1,6 +1,6 @@ -diff -ur LuaJIT-2.1.0-beta1.orig/src/lj_def.h LuaJIT-2.1.0-beta1/src/lj_def.h ---- LuaJIT-2.1.0-beta1.orig/src/lj_def.h 2015-08-25 23:35:00.000000000 +0200 -+++ LuaJIT-2.1.0-beta1/src/lj_def.h 2015-09-04 08:51:52.000000000 +0200 +diff -bur LuaJIT-src-orig/src/lj_def.h LuaJIT-src/src/lj_def.h +--- LuaJIT-src-orig/src/lj_def.h 2016-03-07 09:43:42.728069718 +0100 ++++ LuaJIT-src/src/lj_def.h 2016-03-07 12:23:43.327910115 +0100 @@ -66,7 +66,7 @@ #define LJ_MAX_BCINS (1<<26) /* Max. # of bytecode instructions. */ #define LJ_MAX_SLOTS 250 /* Max. # of slots in a Lua func. */ @@ -10,9 +10,10 @@ diff -ur LuaJIT-2.1.0-beta1.orig/src/lj_def.h LuaJIT-2.1.0-beta1/src/lj_def.h #define LJ_MAX_IDXCHAIN 100 /* __index/__newindex chain limit. */ #define LJ_STACK_EXTRA (5+2*LJ_FR2) /* Extra stack space (metamethods). */ -diff -ur LuaJIT-2.1.0-beta1.orig/src/lj_str.c LuaJIT-2.1.0-beta1/src/lj_str.c ---- LuaJIT-2.1.0-beta1.orig/src/lj_str.c 2015-08-25 23:35:00.000000000 +0200 -+++ LuaJIT-2.1.0-beta1/src/lj_str.c 2015-09-04 08:51:52.000000000 +0200 + +diff -bur LuaJIT-src-orig/src/lj_str.c LuaJIT-src/src/lj_str.c +--- LuaJIT-src-orig/src/lj_str.c 2016-03-07 09:43:42.696069718 +0100 ++++ LuaJIT-src/src/lj_str.c 2016-03-07 12:25:22.031908474 +0100 @@ -118,6 +118,16 @@ g->strhash = newhash; } @@ -30,7 +31,7 @@ diff -ur LuaJIT-2.1.0-beta1.orig/src/lj_str.c LuaJIT-2.1.0-beta1/src/lj_str.c /* Intern a string and return string object. */ GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx) { -@@ -126,27 +136,44 @@ +@@ -126,9 +136,22 @@ GCobj *o; MSize len = (MSize)lenx; MSize a, b, h = len; @@ -51,58 +52,22 @@ diff -ur LuaJIT-2.1.0-beta1.orig/src/lj_str.c LuaJIT-2.1.0-beta1/src/lj_str.c + } else { + /* LuaJIT 2.0.2 hash function */ /* Compute string hash. Constants taken from lookup3 hash by Bob Jenkins. */ -- if (len >= 4) { /* Caveat: unaligned access! */ -- a = lj_getu32(str); -- h ^= lj_getu32(str+len-4); -- b = lj_getu32(str+(len>>1)-2); -- h ^= b; h -= lj_rol(b, 14); -- b += lj_getu32(str+(len>>2)-1); -- } else if (len > 0) { -- a = *(const uint8_t *)str; -- h ^= *(const uint8_t *)(str+len-1); -- b = *(const uint8_t *)(str+(len>>1)); -- h ^= b; h -= lj_rol(b, 14); -- } else { -- return &g->strempty; -- } -- a ^= h; a -= lj_rol(h, 11); -- b ^= a; b -= lj_rol(a, 25); -- h ^= b; h -= lj_rol(b, 16); -+ if (len >= 4) { /* Caveat: unaligned access! */ -+ a = lj_getu32(str); -+ h ^= lj_getu32(str+len-4); -+ b = lj_getu32(str+(len>>1)-2); -+ h ^= b; h -= lj_rol(b, 14); -+ b += lj_getu32(str+(len>>2)-1); -+ } else if (len > 0) { -+ a = *(const uint8_t *)str; -+ h ^= *(const uint8_t *)(str+len-1); -+ b = *(const uint8_t *)(str+(len>>1)); -+ h ^= b; h -= lj_rol(b, 14); -+ } else { + if (len >= 4) { /* Caveat: unaligned access! */ + a = lj_getu32(str); +@@ -142,11 +165,15 @@ + b = *(const uint8_t *)(str+(len>>1)); + h ^= b; h -= lj_rol(b, 14); + } else { + /* Already done, kept for reference */ -+ return &g->strempty; -+ } -+ a ^= h; a -= lj_rol(h, 11); -+ b ^= a; b -= lj_rol(a, 25); -+ h ^= b; h -= lj_rol(b, 16); + return &g->strempty; + } + a ^= h; a -= lj_rol(h, 11); + b ^= a; b -= lj_rol(a, 25); + h ^= b; h -= lj_rol(b, 16); + } + + /* Check if the string has already been interned. */ o = gcref(g->strhash[h & g->strmask]); if (LJ_LIKELY((((uintptr_t)str+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) { -Only in LuaJIT-2.1.0-beta1/src: lj_str.c.orig -diff -ur LuaJIT-2.1.0-beta1.orig/src/lua.h LuaJIT-2.1.0-beta1/src/lua.h ---- LuaJIT-2.1.0-beta1.orig/src/lua.h 2015-09-04 08:42:39.000000000 +0200 -+++ LuaJIT-2.1.0-beta1/src/lua.h 2015-09-04 08:51:52.000000000 +0200 -@@ -103,6 +103,9 @@ - typedef LUA_INTEGER lua_Integer; - - -+/* communication with LuaJiTTeX */ -+LUA_API int luajittex_choose_hash_function; -+ - - /* - ** state manipulation + |