diff --git a/CMakeLists.txt b/CMakeLists.txt index 903ffffd..dd2903bc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,7 +167,7 @@ endif() set(MEGA_ZLIB_VER "1.2.11") set(MEGA_LUA51_VER "5.1.5") -set(MEGA_LUAJIT_VER "2.0.5") +set(MEGA_LUAJIT_VER "2.1.0-0bee44c") set(MEGA_LIBOGG_VER "1.3.2") set(MEGA_LIBVORBIS_VER "1.3.5") set(MEGA_LIBTHEORA_VER "1.1.1") diff --git a/libs/LuaJIT/.gitignore b/libs/LuaJIT/.gitignore new file mode 100644 index 00000000..1a07bf75 --- /dev/null +++ b/libs/LuaJIT/.gitignore @@ -0,0 +1,11 @@ +*.[oa] +*.so +*.obj +*.lib +*.exp +*.dll +*.exe +*.manifest +*.dmp +*.swp +.tags diff --git a/libs/LuaJIT/Makefile b/libs/LuaJIT/Makefile index ecce9ec5..0f933089 100644 --- a/libs/LuaJIT/Makefile +++ b/libs/LuaJIT/Makefile @@ -14,9 +14,10 @@ ############################################################################## MAJVER= 2 -MINVER= 0 -RELVER= 5 -VERSION= $(MAJVER).$(MINVER).$(RELVER) +MINVER= 1 +RELVER= 0 +PREREL= -beta3 +VERSION= $(MAJVER).$(MINVER).$(RELVER)$(PREREL) ABIVER= 5.1 ############################################################################## @@ -84,8 +85,10 @@ FILE_SO= libluajit.so 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 v.lua dump.lua dis_x86.lua dis_x64.lua dis_arm.lua \ - dis_ppc.lua dis_mips.lua dis_mipsel.lua bcsave.lua vmdef.lua +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_arm64be.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua \ + dis_mips64.lua dis_mips64el.lua vmdef.lua ifeq (,$(findstring Windows,$(OS))) HOST_SYS:= $(shell uname -s) @@ -115,7 +118,7 @@ install: $(INSTALL_DEP) $(MKDIR) $(INSTALL_DIRS) cd src && $(INSTALL_X) $(FILE_T) $(INSTALL_T) cd src && test -f $(FILE_A) && $(INSTALL_F) $(FILE_A) $(INSTALL_STATIC) || : - $(RM) $(INSTALL_TSYM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) + $(RM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) cd src && test -f $(FILE_SO) && \ $(INSTALL_X) $(FILE_SO) $(INSTALL_DYN) && \ $(LDCONFIG) $(INSTALL_LIB) && \ @@ -127,12 +130,18 @@ install: $(INSTALL_DEP) $(RM) $(FILE_PC).tmp cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC) cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB) - $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM) @echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ====" + @echo "" + @echo "Note: the development releases deliberately do NOT install a symlink for luajit" + @echo "You can do this now by running this command (with sudo):" + @echo "" + @echo " $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)" + @echo "" + uninstall: @echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ====" - $(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC) + $(UNINSTALL) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC) for file in $(FILES_JITLIB); do \ $(UNINSTALL) $(INSTALL_JITLIB)/$$file; \ done diff --git a/libs/LuaJIT/README b/libs/LuaJIT/README index 6cb7cebb..2b9ae9d2 100644 --- a/libs/LuaJIT/README +++ b/libs/LuaJIT/README @@ -1,5 +1,5 @@ -README for LuaJIT 2.0.5 ------------------------ +README for LuaJIT 2.1.0-beta3 +----------------------------- LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. diff --git a/libs/LuaJIT/doc/bluequad-print.css b/libs/LuaJIT/doc/bluequad-print.css index 62e1c165..d5a3ea3a 100644 --- a/libs/LuaJIT/doc/bluequad-print.css +++ b/libs/LuaJIT/doc/bluequad-print.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2017 Mike Pall. +/* Copyright (C) 2004-2018 Mike Pall. * * You are welcome to use the general ideas of this design for your own sites. * But please do not steal the stylesheet, the layout or the color scheme. diff --git a/libs/LuaJIT/doc/bluequad.css b/libs/LuaJIT/doc/bluequad.css index be2c4bf2..cfc889af 100644 --- a/libs/LuaJIT/doc/bluequad.css +++ b/libs/LuaJIT/doc/bluequad.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2017 Mike Pall. +/* Copyright (C) 2004-2018 Mike Pall. * * You are welcome to use the general ideas of this design for your own sites. * But please do not steal the stylesheet, the layout or the color scheme. diff --git a/libs/LuaJIT/doc/changes.html b/libs/LuaJIT/doc/changes.html index 4a4d4fb9..1208ac83 100644 --- a/libs/LuaJIT/doc/changes.html +++ b/libs/LuaJIT/doc/changes.html @@ -3,8 +3,7 @@ LuaJIT Change History - - + @@ -44,6 +43,8 @@ div.major { max-width: 600px; padding: 1em; margin: 1em 0 1em 0; } jit.* Library
  • Lua/C API +
  • +Profiler
  • Status @@ -72,6 +73,96 @@ to see whether newer versions are available.

    +

    LuaJIT 2.1.0-beta3 — 2017-05-01

    + + +

    LuaJIT 2.1.0-beta2 — 2016-03-03

    + + +

    LuaJIT 2.1.0-beta1 — 2015-08-25

    +

    +This is a brief summary of the major changes in LuaJIT 2.1 compared to 2.0. +Please take a look at the commit history for more details. +

    + +
    + +

    LuaJIT 2.0.5 — 2017-05-01

    - -
    -

    LuaJIT 1.1.8 — 2012-04-16

    - - -

    LuaJIT 1.1.7 — 2011-05-05

    - - -

    LuaJIT 1.1.6 — 2010-03-28

    - - -

    LuaJIT 1.1.5 — 2008-10-25

    - - -

    LuaJIT 1.1.4 — 2008-02-05

    - - -

    LuaJIT 1.1.3 — 2007-05-24

    - - -

    LuaJIT 1.1.2 — 2006-06-24

    - - -

    LuaJIT 1.1.1 — 2006-06-20

    - -

    -This release is in sync with Coco 1.1.1 (see the -» Coco Change History). -

    - -

    LuaJIT 1.1.0 — 2006-03-13

    - -

    -This release is in sync with Coco 1.1.0 (see the -» Coco Change History). -

    -
    - -
    -

    LuaJIT 1.0.3 — 2005-09-08

    - -

    -This is the first public release of LuaJIT. -

    - -

    LuaJIT 1.0.2 — 2005-09-02

    - -

    -Not released because Lua 5.1 alpha came out today. -

    - -

    LuaJIT 1.0.1 — 2005-08-31

    - -

    -Interim non-public release. -Special thanks to Adam D. Moss for reporting most of the bugs. -

    - -

    LuaJIT 1.0.0 — 2005-08-29

    -

    -This is the initial non-public release of LuaJIT. -

    -

  • Lua/C API +
  • +Profiler
  • Status @@ -91,7 +92,7 @@ xD("fyZKB8xv\"FJytmz8.KAB0u52D")

    Copyright

    All documentation is -Copyright © 2005-2017 Mike Pall. +Copyright © 2005-2018 Mike Pall.

    @@ -99,7 +100,7 @@ Copyright © 2005-2017 Mike Pall.
  • Lua/C API +
  • +Profiler
  • Status @@ -89,8 +90,8 @@ other Lua/C API functions).

    The third argument specifies the mode, which is 'or'ed with a flag. -The flag can be LUAJIT_MODE_OFF to turn a feature on, -LUAJIT_MODE_ON to turn a feature off, or +The flag can be LUAJIT_MODE_OFF to turn a feature off, +LUAJIT_MODE_ON to turn a feature on, or LUAJIT_MODE_FLUSH to flush cached code.

    @@ -177,7 +178,7 @@ Also note that this mechanism is not without overhead.

  • Lua/C API +
  • +Profiler
  • Status @@ -320,7 +321,7 @@ without undue conversion penalties.
  • Lua/C API +
  • +Profiler
  • Status @@ -466,6 +467,10 @@ otherwise. The following parameters are currently defined: eabiEABI variant of the standard ABI winWindows variant of the standard ABI + +uwpUniversal Windows Platform + +gc6464 bit GC references

    ffi.os

    @@ -542,8 +547,8 @@ corresponding ctype. The parser for Lua source code treats numeric literals with the suffixes LL or ULL as signed or unsigned 64 bit integers. Case doesn't matter, but uppercase is recommended for -readability. It handles both decimal (42LL) and hexadecimal -(0x2aLL) literals. +readability. It handles decimal (42LL), hexadecimal +(0x2aLL) and binary (0b101010LL) literals.

    The imaginary part of complex numbers can be specified by suffixing @@ -556,7 +561,7 @@ named i.

  • Lua/C API +
  • +Profiler
  • Status @@ -183,6 +184,8 @@ a typedef, except re-declarations will be ignored): uint16_t, uint32_t, uint64_t, intptr_t, uintptr_t.
  • +
  • From <unistd.h> (POSIX): ssize_t.
  • +

    You're encouraged to use these types in preference to @@ -730,6 +733,22 @@ You'll have to explicitly convert a 64 bit integer to a Lua number (e.g. for regular floating-point calculations) with tonumber(). But note this may incur a precision loss. +

  • 64 bit bitwise operations: the rules for 64 bit +arithmetic operators apply analogously.
    + +Unlike the other bit.* operations, bit.tobit() +converts a cdata number via int64_t to int32_t and +returns a Lua number.
    + +For bit.band(), bit.bor() and bit.bxor(), the +conversion to int64_t or uint64_t applies to +all arguments, if any argument is a cdata number.
    + +For all other operations, only the first argument is used to determine +the output type. This implies that a cdata number as a shift count for +shifts and rotates is accepted, but that alone does not cause +a cdata number output. +

    Comparisons of cdata objects

    @@ -844,7 +863,7 @@ place of a type, you'd need to use ffi.typeof("int") instead.

    The main use for parameterized types are libraries implementing abstract data types -(» example), +(example), similar to what can be achieved with C++ template metaprogramming. Another use case are derived types of anonymous structs, which avoids pollution of the global struct namespace. @@ -1201,14 +1220,12 @@ The following operations are currently not compiled and may exhibit suboptimal performance, especially when used in inner loops:

  • Status @@ -151,7 +152,7 @@ Contains the target OS name:

    jit.arch

    Contains the target architecture name: -"x86", "x64", "arm", "ppc", "ppcspe", or "mips". +"x86", "x64", "arm", "arm64", "ppc", "mips" or "mips64".

    jit.opt.* — JIT compiler optimization control

    @@ -189,7 +190,7 @@ if you want to know more.
  • Lua/C API +
  • +Profiler
  • Status @@ -113,6 +114,9 @@ bit.lshift bit.rshift bit.arshift bit.rol bit.ror bit.bswap This module is a LuaJIT built-in — you don't need to download or install Lua BitOp. The Lua BitOp site has full documentation for all » Lua BitOp API functions. +The FFI adds support for +64 bit bitwise operations, +using the same API functions.

    Please make sure to require the module before using any of @@ -146,6 +150,11 @@ LuaJIT adds some extra functions to the Lua/C API.

    +

    Profiler

    +

    +LuaJIT has an integrated profiler. +

    +

    Enhanced Standard Library Functions

    xpcall(f, err [,args...]) passes arguments

    @@ -173,7 +182,7 @@ in "-inf".

    tonumber() etc. use builtin string to number conversion

    All string-to-number conversions consistently convert integer and -floating-point inputs in decimal and hexadecimal on all platforms. +floating-point inputs in decimal, hexadecimal and binary on all platforms. strtod() is not used anymore, which avoids numerous problems with poor C library implementations. The builtin conversion function provides full precision according to the IEEE-754 standard, it @@ -197,6 +206,36 @@ for dot releases (x.y.0 → x.y.1), but may change with major or minor releases (2.0 → 2.1) or between any beta release. Foreign bytecode (e.g. from Lua 5.1) is incompatible and cannot be loaded.

    +

    +Note: LJ_GC64 mode requires a different frame layout, which implies +a different, incompatible bytecode format for all 64 bit ports. This may be +rectified in the future. +

    + +

    table.new(narray, nhash) allocates a pre-sized table

    +

    +An extra library function table.new() can be made available via +require("table.new"). This creates a pre-sized table, just like +the C API equivalent lua_createtable(). This is useful for big +tables if the final table size is known and automatic table resizing is +too expensive. +

    + +

    table.clear(tab) clears a table

    +

    +An extra library function table.clear() can be made available +via require("table.clear"). This clears all keys and values +from a table, but preserves the allocated array/hash sizes. This is +useful when a table, which is linked from multiple places, needs to be +cleared and/or when recycling a table for use by the same context. This +avoids managing backlinks, saves an allocation and the overhead of +incremental array/hash part growth. +

    +

    +Please note this function is meant for very specific situations. In most +cases it's better to replace the (usually single) link with a new table +and let the GC do its work. +

    Enhanced PRNG for math.random()

    @@ -213,6 +252,10 @@ for every call. The result is uniformly distributed between 0.0 and 1.0. It's correctly scaled up and rounded for math.random(n [,m]) to preserve uniformity.

    +

    +Important: Neither this nor any other PRNG based on the simplistic +math.random() API is suitable for cryptographic use. +

    io.* functions handle 64 bit file offsets

    @@ -271,6 +314,26 @@ indexes for varargs.

  • debug.getupvalue() and debug.setupvalue() handle C functions.
  • debug.upvalueid() and debug.upvaluejoin().
  • +
  • Lua/C API extensions: +lua_version() +lua_upvalueid() +lua_upvaluejoin() +lua_loadx() +lua_copy() +lua_tonumberx() +lua_tointegerx() +luaL_fileresult() +luaL_execresult() +luaL_loadfilex() +luaL_loadbufferx() +luaL_traceback() +luaL_setfuncs() +luaL_pushmodule() +luaL_newlibtable() +luaL_newlib() +luaL_testudata() +luaL_setmetatable() +
  • Command line option -E.
  • Command line checks __tostring for errors.
  • @@ -296,6 +359,8 @@ exit status.
  • debug.setmetatable() returns object.
  • debug.getuservalue() and debug.setuservalue().
  • Remove math.mod(), string.gfind().
  • +
  • package.searchers.
  • +
  • module() returns the module table.
  • Note: this provides only partial compatibility with Lua 5.2 at the @@ -304,6 +369,21 @@ Lua 5.1, which prevents implementing features that would otherwise break the Lua/C API and ABI (e.g. _ENV).

    +

    Extensions from Lua 5.3

    +

    +LuaJIT supports some extensions from Lua 5.3: +

    +

    C++ Exception Interoperability

    LuaJIT has built-in support for interoperating with C++ exceptions. @@ -318,25 +398,30 @@ the toolchain used to compile LuaJIT: POSIX/x64, DWARF2 unwinding -GCC 4.3+ +GCC 4.3+, Clang Full -Other platforms, DWARF2 unwinding -GCC -Limited +ARM -DLUAJIT_UNWIND_EXTERNAL +GCC, Clang +Full +Other platforms, DWARF2 unwinding +GCC, Clang +Limited + + Windows/x64 MSVC or WinSDK Full - + Windows/x86 Any -No +Full - + Other platforms Other compilers No @@ -385,20 +470,12 @@ C++ destructors.

  • Lua errors cannot be caught on the C++ side.
  • Throwing Lua errors across C++ frames will not call C++ destructors.
  • -
  • Additionally, on Windows/x86 with SEH-based C++ exceptions: -it's not safe to throw a Lua error across any frames containing -a C++ function with any try/catch construct or using variables with -(implicit) destructors. This also applies to any functions which may be -inlined in such a function. It doesn't matter whether lua_error() -is called inside or outside of a try/catch or whether any object actually -needs to be destroyed: the SEH chain is corrupted and this will eventually -lead to the termination of the process.