x64: Enable LJ_GC64 mode by default.

This commit is contained in:
Mike Pall 2019-12-08 21:21:30 +01:00
parent 70f4b15ee4
commit bd00094c3b
5 changed files with 17 additions and 17 deletions

View File

@ -208,9 +208,8 @@ bytecode (e.g. from Lua 5.1) is incompatible and cannot be loaded.
</p> </p>
<p> <p>
Note: <tt>LJ_GC64</tt> mode requires a different frame layout, which implies Note: <tt>LJ_GC64</tt> mode requires a different frame layout, which implies
a different, incompatible bytecode format for ports that use this mode (e.g. a different, incompatible bytecode format for all 64 bit ports. This may be
ARM64 or MIPS64) or when explicitly enabled for x64. This may be rectified rectified in the future.
in the future.
</p> </p>
<h3 id="table_new"><tt>table.new(narray, nhash)</tt> allocates a pre-sized table</h3> <h3 id="table_new"><tt>table.new(narray, nhash)</tt> allocates a pre-sized table</h3>

View File

@ -175,12 +175,11 @@ Please read the instructions given in these files, before changing
any settings. any settings.
</p> </p>
<p> <p>
LuaJIT on x64 currently uses 32 bit GC objects by default. All LuaJIT 64 bit ports use 64 bit GC objects by default (<tt>LJ_GC64</tt>).
<tt>LJ_GC64</tt> mode may be explicitly enabled: For x64, you can select the old 32-on-64 bit mode by adding
add <tt>XCFLAGS=-DLUAJIT_ENABLE_GC64</tt> to the make command or run <tt>XCFLAGS=-DLUAJIT_DISABLE_GC64</tt> to the make command.
<tt>msvcbuild gc64</tt> for MSVC/WinSDK. Please check the note Please check the note about the
about the <a href="extensions.html#string_dump">bytecode format</a> <a href="extensions.html#string_dump">bytecode format</a> differences, too.
differences, too.
</p> </p>
<h2 id="posix">POSIX Systems (Linux, OSX, *BSD etc.)</h2> <h2 id="posix">POSIX Systems (Linux, OSX, *BSD etc.)</h2>

View File

@ -110,8 +110,8 @@ XCFLAGS=
#XCFLAGS+= -DLUAJIT_NUMMODE=1 #XCFLAGS+= -DLUAJIT_NUMMODE=1
#XCFLAGS+= -DLUAJIT_NUMMODE=2 #XCFLAGS+= -DLUAJIT_NUMMODE=2
# #
# Enable GC64 mode for x64. # Disable LJ_GC64 mode for x64.
#XCFLAGS+= -DLUAJIT_ENABLE_GC64 #XCFLAGS+= -DLUAJIT_DISABLE_GC64
# #
############################################################################## ##############################################################################

View File

@ -184,7 +184,7 @@
#define LJ_TARGET_MASKROT 1 #define LJ_TARGET_MASKROT 1
#define LJ_TARGET_UNALIGNED 1 #define LJ_TARGET_UNALIGNED 1
#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL #define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL
#ifdef LUAJIT_ENABLE_GC64 #ifndef LUAJIT_DISABLE_GC64
#define LJ_TARGET_GC64 1 #define LJ_TARGET_GC64 1
#endif #endif

View File

@ -5,6 +5,7 @@
@rem Then cd to this directory and run this script. Use the following @rem Then cd to this directory and run this script. Use the following
@rem options (in order), if needed. The default is a dynamic release build. @rem options (in order), if needed. The default is a dynamic release build.
@rem @rem
@rem nogc64 disable LJ_GC64 mode for x64
@rem debug emit debug symbols @rem debug emit debug symbols
@rem amalg amalgamated build @rem amalg amalgamated build
@rem static static linkage @rem static static linkage
@ -20,7 +21,7 @@
@set LJLIB=lib /nologo /nodefaultlib @set LJLIB=lib /nologo /nodefaultlib
@set DASMDIR=..\dynasm @set DASMDIR=..\dynasm
@set DASM=%DASMDIR%\dynasm.lua @set DASM=%DASMDIR%\dynasm.lua
@set DASC=vm_x86.dasc @set DASC=vm_x64.dasc
@set LJDLLNAME=lua51.dll @set LJDLLNAME=lua51.dll
@set LJLIBNAME=lua51.lib @set LJLIBNAME=lua51.lib
@set BUILDTYPE=release @set BUILDTYPE=release
@ -37,15 +38,16 @@ if exist minilua.exe.manifest^
@set LJARCH=x64 @set LJARCH=x64
@minilua @minilua
@if errorlevel 8 goto :X64 @if errorlevel 8 goto :X64
@set DASC=vm_x86.dasc
@set DASMFLAGS=-D WIN -D JIT -D FFI @set DASMFLAGS=-D WIN -D JIT -D FFI
@set LJARCH=x86 @set LJARCH=x86
@set LJCOMPILE=%LJCOMPILE% /arch:SSE2 @set LJCOMPILE=%LJCOMPILE% /arch:SSE2
:X64 :X64
@if "%1" neq "gc64" goto :NOGC64 @if "%1" neq "nogc64" goto :GC64
@shift @shift
@set DASC=vm_x64.dasc @set DASC=vm_x86.dasc
@set LJCOMPILE=%LJCOMPILE% /DLUAJIT_ENABLE_GC64 @set LJCOMPILE=%LJCOMPILE% /DLUAJIT_DISABLE_GC64
:NOGC64 :GC64
minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC% minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC%
@if errorlevel 1 goto :BAD @if errorlevel 1 goto :BAD