Skip to content

Commit

Permalink
Merge from LuaJIT upstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
akopytov committed Oct 16, 2016
1 parent 0e5ebc6 commit 8b581ae
Show file tree
Hide file tree
Showing 168 changed files with 177 additions and 6,156 deletions.
18 changes: 3 additions & 15 deletions third_party/luajit/luajit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ABIVER= 5.1
# Change the installation path as needed. This automatically adjusts
# the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path!
#
export PREFIX= /home/cbaylis/work-local/luajit/install
export PREFIX= /usr/local
export MULTILIB= lib
##############################################################################

Expand Down Expand Up @@ -86,8 +86,8 @@ FILE_MAN= luajit.1
FILE_PC= luajit.pc
FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h
FILES_JITLIB= bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua \
dis_x86.lua dis_x64.lua dis_arm.lua dis_arm64.lua \
dis_ppc.lua dis_mips.lua dis_mipsel.lua vmdef.lua
dis_x86.lua dis_x64.lua dis_arm.lua dis_ppc.lua \
dis_mips.lua dis_mipsel.lua vmdef.lua

ifeq (,$(findstring Windows,$(OS)))
HOST_SYS:= $(shell uname -s)
Expand Down Expand Up @@ -163,15 +163,3 @@ clean:
.PHONY: all install amalg clean

##############################################################################

LUAJIT?=$(shell pwd)/src/luajit
define RUN_LUA_TEST
$(MAKE) LUAJIT="$(LUA_EXECUTOR) $(LUAJIT)" LUA_PATH="$(shell pwd)/src/?.lua;;" -C test $@
endef

# Find all tests inside the test folder.
LUA_TEST_SRC=$(wildcard test/*.lua)
ALL_LUA_TEST=$(LUA_TEST_SRC:test/%.lua=test_%)

$(ALL_LUA_TEST) test skipped: all
$(call RUN_LUA_TEST)
1 change: 1 addition & 0 deletions third_party/luajit/luajit/doc/extensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ <h2 id="lua53">Extensions from Lua 5.3</h2>
LuaJIT supports some extensions from Lua&nbsp;5.3:
<ul>
<li>Unicode escape <tt>'\u{XX...}'</tt> embeds the UTF-8 encoding in string literals.</li>
<li>The argument table <tt>arg</tt> can be read (and modified) by <tt>LUA_INIT</tt> and <tt>-e</tt> chunks.</li>
</ul>

<h2 id="exceptions">C++ Exception Interoperability</h2>
Expand Down
7 changes: 4 additions & 3 deletions third_party/luajit/luajit/doc/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,15 @@ <h2 id="cross">Cross-compiling LuaJIT</h2>
ISDKP=$(xcrun --sdk iphoneos --show-sdk-path)
ICC=$(xcrun --sdk iphoneos --find clang)
ISDKF="-arch armv7 -isysroot $ISDKP"
make HOST_CC="clang -m32 -arch i386" CROSS="$(dirname $ICC)/" \
TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
make DEFAULT_CC=clang HOST_CC="clang -m32 -arch i386" \
CROSS="$(dirname $ICC)/" TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS

# iOS/ARM64
ISDKP=$(xcrun --sdk iphoneos --show-sdk-path)
ICC=$(xcrun --sdk iphoneos --find clang)
ISDKF="-arch arm64 -isysroot $ISDKP"
make CROSS="$(dirname $ICC)/" TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
make DEFAULT_CC=clang CROSS="$(dirname $ICC)/" \
TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
</pre>

<h3 id="consoles">Cross-compiling for consoles</h3>
Expand Down
6 changes: 1 addition & 5 deletions third_party/luajit/luajit/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CCOPT= -O2 -fomit-frame-pointer
CCOPT_x86= -march=i686 -msse -msse2 -mfpmath=sse
CCOPT_x64=
CCOPT_arm=
CCOPT_arm64= -fno-omit-frame-pointer
CCOPT_arm64=
CCOPT_ppc=
CCOPT_mips=
#
Expand Down Expand Up @@ -166,10 +166,6 @@ else
HOST_SYS= Windows
HOST_MSYS= cygwin
endif
# Use Clang for OSX host.
ifeq (Darwin,$(HOST_SYS))
DEFAULT_CC= clang
endif
endif

##############################################################################
Expand Down
8 changes: 4 additions & 4 deletions third_party/luajit/luajit/src/host/genminilua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ local function merge_includes(src)
if includes[name] then return "" end
includes[name] = true
local fp = assert(io.open(LUA_SOURCE..name, "r"))
local src = fp:read("*a")
local inc = fp:read("*a")
assert(fp:close())
src = gsub(src, "#ifndef%s+%w+_h\n#define%s+%w+_h\n", "")
src = gsub(src, "#endif%s*$", "")
return merge_includes(src)
inc = gsub(inc, "#ifndef%s+%w+_h\n#define%s+%w+_h\n", "")
inc = gsub(inc, "#endif%s*$", "")
return merge_includes(inc)
end)
end

Expand Down
4 changes: 2 additions & 2 deletions third_party/luajit/luajit/src/jit/bcsave.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ extern "C"
#ifdef _WIN32
__declspec(dllexport)
#endif
const char %s%s[] = {
const unsigned char %s%s[] = {
]], LJBC_PREFIX, ctx.modname))
else
fp:write(string.format([[
#define %s%s_SIZE %d
static const char %s%s[] = {
static const unsigned char %s%s[] = {
]], LJBC_PREFIX, ctx.modname, #s, LJBC_PREFIX, ctx.modname))
end
local t, n, m = {}, 0, 0
Expand Down
2 changes: 1 addition & 1 deletion third_party/luajit/luajit/src/jit/dis_arm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

local type = type
local sub, byte, format = string.sub, string.byte, string.format
local match, gmatch, gsub = string.match, string.gmatch, string.gsub
local match, gmatch = string.match, string.gmatch
local concat = table.concat
local bit = require("bit")
local band, bor, ror, tohex = bit.band, bit.bor, bit.ror, bit.tohex
Expand Down
Loading

0 comments on commit 8b581ae

Please sign in to comment.