From f138e9052e8a4a35590a3b6a8d76b6022c86feb8 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 25 Dec 2019 17:37:36 -0500 Subject: [PATCH] Update LuaJIT to the latest 2.1.0 source (0bee44c) --- CMakeLists.txt | 2 +- libs/LuaJIT/.gitignore | 11 + libs/LuaJIT/Makefile | 25 +- libs/LuaJIT/README | 4 +- libs/LuaJIT/doc/bluequad-print.css | 2 +- libs/LuaJIT/doc/bluequad.css | 2 +- libs/LuaJIT/doc/changes.html | 328 +- libs/LuaJIT/doc/contact.html | 9 +- libs/LuaJIT/doc/ext_c_api.html | 11 +- libs/LuaJIT/doc/ext_ffi.html | 7 +- libs/LuaJIT/doc/ext_ffi_api.html | 15 +- libs/LuaJIT/doc/ext_ffi_semantics.html | 36 +- libs/LuaJIT/doc/ext_ffi_tutorial.html | 7 +- libs/LuaJIT/doc/ext_jit.html | 9 +- libs/LuaJIT/doc/ext_profiler.html | 364 ++ libs/LuaJIT/doc/extensions.html | 115 +- libs/LuaJIT/doc/faq.html | 7 +- libs/LuaJIT/doc/install.html | 249 +- libs/LuaJIT/doc/luajit.html | 15 +- libs/LuaJIT/doc/running.html | 8 +- libs/LuaJIT/doc/status.html | 18 +- libs/LuaJIT/dynasm/dasm_arm.h | 2 + libs/LuaJIT/dynasm/dasm_arm.lua | 6 +- libs/LuaJIT/dynasm/dasm_arm64.h | 519 +++ libs/LuaJIT/dynasm/dasm_arm64.lua | 1166 ++++++ libs/LuaJIT/dynasm/dasm_mips.h | 12 +- libs/LuaJIT/dynasm/dasm_mips.lua | 85 +- libs/LuaJIT/dynasm/dasm_mips64.lua | 12 + libs/LuaJIT/dynasm/dasm_ppc.h | 14 +- libs/LuaJIT/dynasm/dasm_ppc.lua | 708 +++- libs/LuaJIT/dynasm/dasm_proto.h | 4 +- libs/LuaJIT/dynasm/dasm_x86.h | 55 +- libs/LuaJIT/dynasm/dasm_x86.lua | 606 ++- libs/LuaJIT/dynasm/dynasm.lua | 6 +- libs/LuaJIT/etc/luajit.pc | 6 +- libs/LuaJIT/src/.gitignore | 7 + libs/LuaJIT/src/Makefile | 105 +- libs/LuaJIT/src/Makefile.dep | 216 +- libs/LuaJIT/src/host/.gitignore | 3 + libs/LuaJIT/src/host/buildvm.c | 26 +- libs/LuaJIT/src/host/buildvm.h | 1 + libs/LuaJIT/src/host/buildvm_asm.c | 67 +- libs/LuaJIT/src/host/buildvm_lib.c | 61 +- libs/LuaJIT/src/host/buildvm_libbc.h | 56 + libs/LuaJIT/src/host/buildvm_peobj.c | 28 +- libs/LuaJIT/src/host/genlibbc.lua | 197 + libs/LuaJIT/src/jit/.gitignore | 1 + libs/LuaJIT/src/jit/bc.lua | 19 +- libs/LuaJIT/src/jit/bcsave.lua | 34 +- libs/LuaJIT/src/jit/dis_arm.lua | 18 +- libs/LuaJIT/src/jit/dis_arm64.lua | 1216 ++++++ libs/LuaJIT/src/jit/dis_arm64be.lua | 12 + libs/LuaJIT/src/jit/dis_mips.lua | 79 +- libs/LuaJIT/src/jit/dis_mips64.lua | 17 + libs/LuaJIT/src/jit/dis_mips64el.lua | 17 + libs/LuaJIT/src/jit/dis_mipsel.lua | 15 +- libs/LuaJIT/src/jit/dis_ppc.lua | 18 +- libs/LuaJIT/src/jit/dis_x64.lua | 15 +- libs/LuaJIT/src/jit/dis_x86.lua | 297 +- libs/LuaJIT/src/jit/dump.lua | 45 +- libs/LuaJIT/src/jit/p.lua | 311 ++ libs/LuaJIT/src/jit/v.lua | 17 +- libs/LuaJIT/src/jit/zone.lua | 45 + libs/LuaJIT/src/lauxlib.h | 34 +- libs/LuaJIT/src/lib_aux.c | 74 +- libs/LuaJIT/src/lib_base.c | 135 +- libs/LuaJIT/src/lib_bit.c | 136 +- libs/LuaJIT/src/lib_debug.c | 10 +- libs/LuaJIT/src/lib_ffi.c | 84 +- libs/LuaJIT/src/lib_io.c | 41 +- libs/LuaJIT/src/lib_jit.c | 169 +- libs/LuaJIT/src/lib_math.c | 15 +- libs/LuaJIT/src/lib_os.c | 37 +- libs/LuaJIT/src/lib_package.c | 71 +- libs/LuaJIT/src/lib_string.c | 450 +-- libs/LuaJIT/src/lib_table.c | 187 +- libs/LuaJIT/src/lj_alloc.c | 274 +- libs/LuaJIT/src/lj_api.c | 246 +- libs/LuaJIT/src/lj_arch.h | 259 +- libs/LuaJIT/src/lj_asm.c | 739 +++- libs/LuaJIT/src/lj_asm_arm.h | 458 +-- libs/LuaJIT/src/lj_asm_arm64.h | 2043 ++++++++++ libs/LuaJIT/src/lj_asm_mips.h | 1505 +++++-- libs/LuaJIT/src/lj_asm_ppc.h | 727 ++-- libs/LuaJIT/src/lj_asm_x86.h | 1123 +++--- libs/LuaJIT/src/lj_bc.h | 4 + libs/LuaJIT/src/lj_bcdump.h | 6 +- libs/LuaJIT/src/lj_bcread.c | 143 +- libs/LuaJIT/src/lj_bcwrite.c | 228 +- libs/LuaJIT/src/lj_buf.c | 232 ++ libs/LuaJIT/src/lj_buf.h | 103 + libs/LuaJIT/src/lj_carith.c | 84 + libs/LuaJIT/src/lj_carith.h | 11 + libs/LuaJIT/src/lj_ccall.c | 443 +- libs/LuaJIT/src/lj_ccall.h | 55 +- libs/LuaJIT/src/lj_ccallback.c | 239 +- libs/LuaJIT/src/lj_cconv.c | 4 +- libs/LuaJIT/src/lj_cdata.c | 40 +- libs/LuaJIT/src/lj_cdata.h | 7 +- libs/LuaJIT/src/lj_clib.c | 45 +- libs/LuaJIT/src/lj_cparse.c | 162 +- libs/LuaJIT/src/lj_cparse.h | 2 + libs/LuaJIT/src/lj_crecord.c | 324 +- libs/LuaJIT/src/lj_crecord.h | 7 + libs/LuaJIT/src/lj_ctype.c | 17 +- libs/LuaJIT/src/lj_ctype.h | 2 +- libs/LuaJIT/src/lj_debug.c | 188 +- libs/LuaJIT/src/lj_debug.h | 8 +- libs/LuaJIT/src/lj_def.h | 32 +- libs/LuaJIT/src/lj_dispatch.c | 85 +- libs/LuaJIT/src/lj_dispatch.h | 43 +- libs/LuaJIT/src/lj_emit_arm.h | 21 +- libs/LuaJIT/src/lj_emit_arm64.h | 419 ++ libs/LuaJIT/src/lj_emit_mips.h | 142 +- libs/LuaJIT/src/lj_emit_ppc.h | 22 +- libs/LuaJIT/src/lj_emit_x86.h | 185 +- libs/LuaJIT/src/lj_err.c | 211 +- libs/LuaJIT/src/lj_errmsg.h | 5 +- libs/LuaJIT/src/lj_ffrecord.c | 594 ++- libs/LuaJIT/src/lj_frame.h | 160 +- libs/LuaJIT/src/lj_gc.c | 72 +- libs/LuaJIT/src/lj_gc.h | 10 +- libs/LuaJIT/src/lj_gdbjit.c | 48 +- libs/LuaJIT/src/lj_ir.c | 153 +- libs/LuaJIT/src/lj_ir.h | 79 +- libs/LuaJIT/src/lj_ircall.h | 203 +- libs/LuaJIT/src/lj_iropt.h | 13 +- libs/LuaJIT/src/lj_jit.h | 138 +- libs/LuaJIT/src/lj_lex.c | 371 +- libs/LuaJIT/src/lj_lex.h | 17 +- libs/LuaJIT/src/lj_lib.c | 75 +- libs/LuaJIT/src/lj_lib.h | 29 +- libs/LuaJIT/src/lj_load.c | 4 +- libs/LuaJIT/src/lj_mcode.c | 18 +- libs/LuaJIT/src/lj_meta.c | 125 +- libs/LuaJIT/src/lj_meta.h | 1 + libs/LuaJIT/src/lj_obj.c | 17 +- libs/LuaJIT/src/lj_obj.h | 212 +- libs/LuaJIT/src/lj_opt_fold.c | 375 +- libs/LuaJIT/src/lj_opt_loop.c | 37 +- libs/LuaJIT/src/lj_opt_mem.c | 30 +- libs/LuaJIT/src/lj_opt_narrow.c | 2 +- libs/LuaJIT/src/lj_opt_sink.c | 13 +- libs/LuaJIT/src/lj_opt_split.c | 154 +- libs/LuaJIT/src/lj_parse.c | 192 +- libs/LuaJIT/src/lj_profile.c | 368 ++ libs/LuaJIT/src/lj_profile.h | 21 + libs/LuaJIT/src/lj_record.c | 662 ++- libs/LuaJIT/src/lj_record.h | 1 + libs/LuaJIT/src/lj_snap.c | 152 +- libs/LuaJIT/src/lj_state.c | 43 +- libs/LuaJIT/src/lj_state.h | 2 +- libs/LuaJIT/src/lj_str.c | 212 +- libs/LuaJIT/src/lj_str.h | 35 +- libs/LuaJIT/src/lj_strfmt.c | 472 +++ libs/LuaJIT/src/lj_strfmt.h | 125 + libs/LuaJIT/src/lj_strfmt_num.c | 592 +++ libs/LuaJIT/src/lj_strscan.c | 62 +- libs/LuaJIT/src/lj_tab.c | 80 +- libs/LuaJIT/src/lj_tab.h | 5 +- libs/LuaJIT/src/lj_target.h | 6 +- libs/LuaJIT/src/lj_target_arm.h | 4 - libs/LuaJIT/src/lj_target_arm64.h | 332 ++ libs/LuaJIT/src/lj_target_mips.h | 155 +- libs/LuaJIT/src/lj_target_ppc.h | 2 +- libs/LuaJIT/src/lj_target_x86.h | 30 +- libs/LuaJIT/src/lj_trace.c | 131 +- libs/LuaJIT/src/lj_trace.h | 2 + libs/LuaJIT/src/lj_traceerr.h | 4 +- libs/LuaJIT/src/lj_vm.h | 26 +- libs/LuaJIT/src/lj_vmevent.c | 1 + libs/LuaJIT/src/lj_vmmath.c | 56 +- libs/LuaJIT/src/ljamalg.c | 4 + libs/LuaJIT/src/lua.h | 11 +- libs/LuaJIT/src/luaconf.h | 8 +- libs/LuaJIT/src/luajit.c | 136 +- libs/LuaJIT/src/luajit.h | 15 +- libs/LuaJIT/src/msvcbuild.bat | 38 +- libs/LuaJIT/src/ps4build.bat | 32 +- libs/LuaJIT/src/vm_arm.dasc | 339 +- libs/LuaJIT/src/vm_arm64.dasc | 3988 ++++++++++++++++++ libs/LuaJIT/src/vm_mips.dasc | 2506 ++++++++---- libs/LuaJIT/src/vm_mips64.dasc | 5112 ++++++++++++++++++++++++ libs/LuaJIT/src/vm_ppc.dasc | 1621 ++++++-- libs/LuaJIT/src/vm_ppcspe.dasc | 3691 ----------------- libs/LuaJIT/src/vm_x64.dasc | 4909 +++++++++++++++++++++++ libs/LuaJIT/src/vm_x86.dasc | 1569 +++----- libs/LuaJIT/src/xb1build.bat | 101 + 188 files changed, 38754 insertions(+), 11773 deletions(-) create mode 100644 libs/LuaJIT/.gitignore create mode 100644 libs/LuaJIT/doc/ext_profiler.html create mode 100644 libs/LuaJIT/dynasm/dasm_arm64.h create mode 100644 libs/LuaJIT/dynasm/dasm_arm64.lua create mode 100644 libs/LuaJIT/dynasm/dasm_mips64.lua create mode 100644 libs/LuaJIT/src/.gitignore create mode 100644 libs/LuaJIT/src/host/.gitignore create mode 100644 libs/LuaJIT/src/host/buildvm_libbc.h create mode 100644 libs/LuaJIT/src/host/genlibbc.lua create mode 100644 libs/LuaJIT/src/jit/.gitignore create mode 100644 libs/LuaJIT/src/jit/dis_arm64.lua create mode 100644 libs/LuaJIT/src/jit/dis_arm64be.lua create mode 100644 libs/LuaJIT/src/jit/dis_mips64.lua create mode 100644 libs/LuaJIT/src/jit/dis_mips64el.lua create mode 100644 libs/LuaJIT/src/jit/p.lua create mode 100644 libs/LuaJIT/src/jit/zone.lua create mode 100644 libs/LuaJIT/src/lj_asm_arm64.h create mode 100644 libs/LuaJIT/src/lj_buf.c create mode 100644 libs/LuaJIT/src/lj_buf.h create mode 100644 libs/LuaJIT/src/lj_emit_arm64.h create mode 100644 libs/LuaJIT/src/lj_profile.c create mode 100644 libs/LuaJIT/src/lj_profile.h create mode 100644 libs/LuaJIT/src/lj_strfmt.c create mode 100644 libs/LuaJIT/src/lj_strfmt.h create mode 100644 libs/LuaJIT/src/lj_strfmt_num.c create mode 100644 libs/LuaJIT/src/lj_target_arm64.h create mode 100644 libs/LuaJIT/src/vm_arm64.dasc create mode 100644 libs/LuaJIT/src/vm_mips64.dasc delete mode 100644 libs/LuaJIT/src/vm_ppcspe.dasc create mode 100644 libs/LuaJIT/src/vm_x64.dasc create mode 100644 libs/LuaJIT/src/xb1build.bat 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

    +
      +
    • Rewrite memory block allocator.
    • +
    • Add various extension from Lua 5.2/5.3.
    • +
    • Remove old Lua 5.0 compatibility defines.
    • +
    • Set arg table before evaluating LUA_INIT and -e chunks.
    • +
    • Fix FOLD rules for math.abs() and FP negation.
    • +
    • Fix soft-float math.abs() and negation.
    • +
    • Fix formatting of some small denormals at low precision.
    • +
    • LJ_GC64: Add JIT compiler support.
    • +
    • x64/LJ_GC64: Add JIT compiler backend.
    • +
    • x86/x64: Generate BMI2 shifts and rotates, if available.
    • +
    • Windows/x86: Add full exception interoperability.
    • +
    • ARM64: Add big-endian support.
    • +
    • ARM64: Add JIT compiler backend.
    • +
    • MIPS: Fix TSETR barrier.
    • +
    • MIPS: Support MIPS16 interlinking.
    • +
    • MIPS soft-float: Fix code generation for HREF.
    • +
    • MIPS64: Add MIPS64 hard-float JIT compiler backend.
    • +
    • MIPS64: Add MIPS64 hard-float/soft-float support to interpreter.
    • +
    • FFI: Compile bitfield loads/stores.
    • +
    • Various fixes common with the 2.0 branch.
    • +
    + +

    LuaJIT 2.1.0-beta2 — 2016-03-03

    +
      +
    • Enable trace stitching.
    • +
    • Use internal implementation for converting FP numbers to strings.
    • +
    • Parse Unicode escape '\u{XX...}' in string literals.
    • +
    • Add MIPS soft-float support.
    • +
    • Switch MIPS port to dual-number mode.
    • +
    • x86/x64: Add support for AES-NI, AVX and AVX2 to DynASM.
    • +
    • FFI: Add ssize_t declaration.
    • +
    • FFI: Parse #line NN and #NN.
    • +
    • Various minor fixes.
    • +
    + +

    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. +

    +
      +
    • Changes to the VM core: +
        +
      • Add low-overhead profiler (-jp).
      • +
      • Add LJ_GC64 mode: 64 bit GC object references (really: 47 bit). Interpreter-only for now.
      • +
      • Add LJ_FR2 mode: Two-slot frame info. Required by LJ_GC64 mode.
      • +
      • Add table.new() and table.clear().
      • +
      • Parse binary number literals (0bxxx).
      • +
    • +
    • Improvements to the JIT compiler: +
        +
      • Add trace stitching (disabled for now).
      • +
      • Compile various builtins: string.char(), string.reverse(), string.lower(), string.upper(), string.rep(), string.format(), table.concat(), bit.tohex(), getfenv(0), debug.getmetatable().
      • +
      • Compile string.find() for fixed string searches (no patterns).
      • +
      • Compile BC_TSETM, e.g. {1,2,3,f()}.
      • +
      • Compile string concatenations (BC_CAT).
      • +
      • Compile __concat metamethod.
      • +
      • Various minor optimizations.
      • +
    • +
    • Internal Changes: +
        +
      • Add support for embedding LuaJIT bytecode for builtins.
      • +
      • Replace various builtins with embedded bytecode.
      • +
      • Refactor string buffers and string formatting.
      • +
      • Remove obsolete non-truncating number to integer conversions.
      • +
    • +
    • Ports: +
        +
      • Add Xbox One port (LJ_GC64 mode).
      • +
      • ARM64: Add port of the interpreter (LJ_GC64 mode).
      • +
      • x64: Add separate port of the interpreter to LJ_GC64 mode.
      • +
      • x86/x64: Drop internal x87 math functions. Use libm functions.
      • +
      • x86: Remove x87 support from interpreter. SSE2 is mandatory now.
      • +
      • PPC/e500: Drop support for this architecture.
      • +
    • +
    • FFI library: +
        +
      • FFI: Add 64 bit bitwise operations.
      • +
      • FFI: Compile VLA/VLS and large cdata allocations with default initialization.
      • +
      • FFI: Compile conversions from functions to function pointers.
      • +
      • FFI: Compile lightuserdata to void * conversion.
      • +
      • FFI: Compile ffi.gc(cdata, nil), too.
      • +
      • FFI: Add ffi.typeinfo().
      • +
    • +
    +
    + +

    LuaJIT 2.0.5 — 2017-05-01

    • Add workaround for MSVC 2015 stdio changes.
    • @@ -81,7 +172,7 @@ to see whether newer versions are available.
    • Remove internal __mode = "K" and replace with safe check.
    • Add "proto" field to jit.util.funcinfo().
    • Fix GC step size calculation.
    • -
    • Initialize uv->immutable for upvalues of loaded chunks.
    • +
    • Initialize uv->immutable for upvalues of loaded chunks.
    • Fix for cdata vs. non-cdata arithmetics/comparisons.
    • Drop leftover regs in 'for' iterator assignment, too.
    • Fix PHI remarking in SINK pass.
    • @@ -777,240 +868,11 @@ This matches the behavior of Lua 5.1, but not the specification. no point in listing differences over earlier versions.
    - -
    -

    LuaJIT 1.1.8 — 2012-04-16

    - - -

    LuaJIT 1.1.7 — 2011-05-05

    - - -

    LuaJIT 1.1.6 — 2010-03-28

    -
      -
    • Added fixes for the -» currently known bugs in Lua 5.1.4.
    • -
    • Removed wrong GC check in jit_createstate(). -Thanks to Tim Mensch.
    • -
    • Fixed bad assertions while compiling table.insert() and -table.remove().
    • -
    - -

    LuaJIT 1.1.5 — 2008-10-25

    - - -

    LuaJIT 1.1.4 — 2008-02-05

    -
      -
    • Merged with Lua 5.1.3. Fixes all -» known bugs in Lua 5.1.2.
    • -
    • Fixed possible (but unlikely) stack corruption while compiling -k^x expressions.
    • -
    • Fixed DynASM template for cmpss instruction.
    • -
    - -

    LuaJIT 1.1.3 — 2007-05-24

    -
      -
    • Merged with Lua 5.1.2. Fixes all -» known bugs in Lua 5.1.1.
    • -
    • Merged pending Lua 5.1.x fixes: "return -nil" bug, spurious count hook call.
    • -
    • Remove a (sometimes) wrong assertion in luaJIT_findpc().
    • -
    • DynASM now allows labels for displacements and .aword.
    • -
    • Fix some compiler warnings for DynASM glue (internal API change).
    • -
    • Correct naming for SSSE3 (temporarily known as SSE4) in DynASM and x86 disassembler.
    • -
    • The loadable debug modules now handle redirection to stdout -(e.g. -j trace=-).
    • -
    - -

    LuaJIT 1.1.2 — 2006-06-24

    -
      -
    • Fix MSVC inline assembly: use only local variables with -lua_number2int().
    • -
    • Fix "attempt to call a thread value" bug on Mac OS X: -make values of consts used as lightuserdata keys unique -to avoid joining by the compiler/linker.
    • -
    - -

    LuaJIT 1.1.1 — 2006-06-20

    -
      -
    • Merged with Lua 5.1.1. Fixes all -» known bugs in Lua 5.1.
    • -
    • Enforce (dynamic) linker error for EXE/DLL version mismatches.
    • -
    • Minor changes to DynASM: faster pre-processing, smaller encoding -for some immediates.
    • -
    -

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

    - -

    LuaJIT 1.1.0 — 2006-03-13

    -
      -
    • Merged with Lua 5.1 (final).
    • - -
    • New JIT call frame setup: -
        -
      • The C stack is kept 16 byte aligned (faster). -Mandatory for Mac OS X on Intel, too.
      • -
      • Faster calling conventions for internal C helper functions.
      • -
      • Better instruction scheduling for function prologue, OP_CALL and -OP_RETURN.
      • -
    • - -
    • Miscellaneous optimizations: -
        -
      • Faster loads of FP constants. Remove narrow-to-wide store-to-load -forwarding stalls.
      • -
      • Use (scalar) SSE2 ops (if the CPU supports it) to speed up slot moves -and FP to integer conversions.
      • -
      • Optimized the two-argument form of OP_CONCAT (a..b).
      • -
      • Inlined OP_MOD (a%b). -With better accuracy than the C variant, too.
      • -
      • Inlined OP_POW (a^b). Unroll x^k or -use k^x = 2^(log2(k)*x) or call pow().
      • -
    • - -
    • Changes in the optimizer: -
        -
      • Improved hinting for table keys derived from table values -(t1[t2[x]]).
      • -
      • Lookup hinting now works with arbitrary object types and -supports index chains, too.
      • -
      • Generate type hints for arithmetic and comparison operators, -OP_LEN, OP_CONCAT and OP_FORPREP.
      • -
      • Remove several hint definitions in favour of a generic COMBINE hint.
      • -
      • Complete rewrite of jit.opt_inline module -(ex jit.opt_lib).
      • -
    • - -
    • Use adaptive deoptimization: -
        -
      • If runtime verification of a contract fails, the affected -instruction is recompiled and patched on-the-fly. -Regular programs will trigger deoptimization only occasionally.
      • -
      • This avoids generating code for uncommon fallback cases -most of the time. Generated code is up to 30% smaller compared to -LuaJIT 1.0.3.
      • -
      • Deoptimization is used for many opcodes and contracts: -
          -
        • OP_CALL, OP_TAILCALL: type mismatch for callable.
        • -
        • Inlined calls: closure mismatch, parameter number and type mismatches.
        • -
        • OP_GETTABLE, OP_SETTABLE: table or key type and range mismatches.
        • -
        • All arithmetic and comparison operators, OP_LEN, OP_CONCAT, -OP_FORPREP: operand type and range mismatches.
        • -
      • -
      • Complete redesign of the debug and traceback info -(bytecode ↔ mcode) to support deoptimization. -Much more flexible and needs only 50% of the space.
      • -
      • The modules jit.trace, jit.dumphints and -jit.dump handle deoptimization.
      • -
    • - -
    • Inlined many popular library functions -(for commonly used arguments only): -
        -
      • Most math.* functions (the 18 most used ones) -[2x-10x faster].
      • -
      • string.len, string.sub and string.char -[2x-10x faster].
      • -
      • table.insert, table.remove and table.getn -[3x-5x faster].
      • -
      • coroutine.yield and coroutine.resume -[3x-5x faster].
      • -
      • pairs, ipairs and the corresponding iterators -[8x-15x faster].
      • -
    • - -
    • Changes in the core and loadable modules and the stand-alone executable: -
        -
      • Added jit.version, jit.version_num -and jit.arch.
      • -
      • Reorganized some internal API functions (jit.util.*mcode*).
      • -
      • The -j dump output now shows JSUB names, too.
      • -
      • New x86 disassembler module written in pure Lua. No dependency -on ndisasm anymore. Flexible API, very compact (500 lines) -and complete (x87, MMX, SSE, SSE2, SSE3, SSSE3, privileged instructions).
      • -
      • luajit -v prints the LuaJIT version and copyright -on a separate line.
      • -
    • - -
    • Added SSE, SSE2, SSE3 and SSSE3 support to DynASM.
    • -
    • Miscellaneous doc changes. Added a section about -embedding LuaJIT.
    • -
    -

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

    -
    - -
    -

    LuaJIT 1.0.3 — 2005-09-08

    -
      -
    • Even more docs.
    • -
    • Unified closure checks in jit.*.
    • -
    • Fixed some range checks in jit.util.*.
    • -
    • Fixed __newindex call originating from jit_settable_str().
    • -
    • Merged with Lua 5.1 alpha (including early bug fixes).
    • -
    -

    -This is the first public release of LuaJIT. -

    - -

    LuaJIT 1.0.2 — 2005-09-02

    -
      -
    • Add support for flushing the Valgrind translation cache
      -(MYCFLAGS= -DUSE_VALGRIND).
    • -
    • Add support for freeing executable mcode memory to the mmap()-based -variant for POSIX systems.
    • -
    • Reorganized the C function signature handling in -jit.opt_lib.
    • -
    • Changed to index-based hints for inlining C functions. -Still no support in the backend for inlining.
    • -
    • Hardcode HEAP_CREATE_ENABLE_EXECUTE value if undefined.
    • -
    • Misc. changes to the jit.* modules.
    • -
    • Misc. changes to the Makefiles.
    • -
    • Lots of new docs.
    • -
    • Complete doc reorg.
    • -
    -

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

    - -

    LuaJIT 1.0.1 — 2005-08-31

    -
      -
    • Missing GC step in OP_CONCAT.
    • -
    • Fix result handling for C –> JIT calls.
    • -
    • Detect CPU feature bits.
    • -
    • Encode conditional moves (fucomip) only when supported.
    • -
    • Add fallback instructions for FP compares.
    • -
    • Add support for LUA_COMPAT_VARARG. Still disabled by default.
    • -
    • MSVC needs a specific place for the CALLBACK attribute -(David Burgess).
    • -
    • Misc. doc updates.
    • -
    -

    -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.