Merge branch 'main' into 12.x

This commit is contained in:
Alex Szpakowski
2022-01-09 14:48:44 -04:00
3 changed files with 26 additions and 3 deletions
+1 -1
View File
@@ -201,7 +201,7 @@ endif()
set(MEGA_ZLIB_VER "1.2.11")
set(MEGA_LUA51_VER "5.1.5")
set(MEGA_LUAJIT_VER "2.1.0-f3c8569")
set(MEGA_LUAJIT_VER "2.1.0-a91d0d9")
set(MEGA_LIBOGG_VER "1.3.2")
set(MEGA_LIBVORBIS_VER "1.3.5")
set(MEGA_LIBTHEORA_VER "1.1.1")
+13
View File
@@ -60,6 +60,11 @@ local function savefile(name, mode)
return check(io.open(name, mode))
end
local function set_stdout_binary(ffi)
ffi.cdef[[int _setmode(int fd, int mode);]]
ffi.C._setmode(1, 0x8000)
end
------------------------------------------------------------------------------
local map_type = {
@@ -125,6 +130,11 @@ local function bcsave_tail(fp, output, s)
end
local function bcsave_raw(output, s)
if output == "-" and jit.os == "Windows" then
local ok, ffi = pcall(require, "ffi")
check(ok, "FFI library required to write binary file to stdout")
set_stdout_binary(ffi)
end
local fp = savefile(output, "wb")
bcsave_tail(fp, output, s)
end
@@ -568,6 +578,9 @@ end
local function bcsave_obj(ctx, output, s)
local ok, ffi = pcall(require, "ffi")
check(ok, "FFI library required to write this file type")
if output == "-" and jit.os == "Windows" then
set_stdout_binary(ffi)
end
if ctx.os == "windows" then
return bcsave_peobj(ctx, output, s, ffi)
elseif ctx.os == "osx" then
+12 -2
View File
@@ -1037,8 +1037,7 @@ LJFOLDF(simplify_numadd_xneg)
LJFOLD(SUB any KNUM)
LJFOLDF(simplify_numsub_k)
{
lua_Number n = knumright;
if (n == 0.0) /* x - (+-0) ==> x */
if (ir_knum(fright)->u64 == 0) /* x - (+0) ==> x */
return LEFTFOLD;
return NEXTFOLD;
}
@@ -2412,6 +2411,17 @@ LJFOLDF(xload_kptr)
LJFOLD(XLOAD any any)
LJFOLDX(lj_opt_fwd_xload)
/* -- Frame handling ------------------------------------------------------ */
/* Prevent CSE of a REF_BASE operand across IR_RETF. */
LJFOLD(SUB any BASE)
LJFOLD(SUB BASE any)
LJFOLD(EQ any BASE)
LJFOLDF(fold_base)
{
return lj_opt_cselim(J, J->chain[IR_RETF]);
}
/* -- Write barriers ------------------------------------------------------ */
/* Write barriers are amenable to CSE, but not across any incremental