immunio 1.1.2 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immunio/version.rb +1 -1
- data/lua-hooks/Makefile +56 -109
- data/lua-hooks/ext/all.c +3 -14
- data/lua-hooks/ext/libinjection/module.mk +5 -0
- data/lua-hooks/ext/lpeg/module.mk +6 -0
- data/lua-hooks/ext/lua-cmsgpack/module.mk +2 -0
- data/lua-hooks/ext/lua-snapshot/module.mk +2 -0
- data/lua-hooks/ext/luajit/COPYRIGHT +1 -1
- data/lua-hooks/ext/luajit/Makefile +2 -2
- data/lua-hooks/ext/luajit/README +2 -2
- data/lua-hooks/ext/luajit/doc/bluequad-print.css +1 -1
- data/lua-hooks/ext/luajit/doc/bluequad.css +1 -1
- data/lua-hooks/ext/luajit/doc/changes.html +15 -2
- data/lua-hooks/ext/luajit/doc/contact.html +3 -3
- data/lua-hooks/ext/luajit/doc/ext_c_api.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_ffi.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +4 -2
- data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_jit.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_profiler.html +2 -2
- data/lua-hooks/ext/luajit/doc/extensions.html +9 -2
- data/lua-hooks/ext/luajit/doc/faq.html +2 -2
- data/lua-hooks/ext/luajit/doc/install.html +22 -18
- data/lua-hooks/ext/luajit/doc/luajit.html +3 -3
- data/lua-hooks/ext/luajit/doc/running.html +2 -2
- data/lua-hooks/ext/luajit/doc/status.html +2 -2
- data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +4 -4
- data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +4 -4
- data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +4 -4
- data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +4 -4
- data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +3 -3
- data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +34 -7
- data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +427 -102
- data/lua-hooks/ext/luajit/dynasm/dynasm.lua +5 -5
- data/lua-hooks/ext/luajit/etc/luajit.1 +1 -1
- data/lua-hooks/ext/luajit/etc/luajit.pc +1 -1
- data/lua-hooks/ext/luajit/src/Makefile +36 -21
- data/lua-hooks/ext/luajit/src/Makefile.dep +3 -1
- data/lua-hooks/ext/luajit/src/host/buildvm.c +1 -1
- data/lua-hooks/ext/luajit/src/host/buildvm.h +1 -1
- data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +10 -1
- data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +1 -1
- data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +1 -1
- data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +1 -1
- data/lua-hooks/ext/luajit/src/host/genlibbc.lua +1 -1
- data/lua-hooks/ext/luajit/src/host/genminilua.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/bc.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/bcsave.lua +2 -2
- data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +163 -73
- data/lua-hooks/ext/luajit/src/jit/dump.lua +2 -1
- data/lua-hooks/ext/luajit/src/jit/p.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/v.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/zone.lua +1 -1
- data/lua-hooks/ext/luajit/src/lib_aux.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_base.c +4 -5
- data/lua-hooks/ext/luajit/src/lib_bit.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_debug.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_ffi.c +2 -5
- data/lua-hooks/ext/luajit/src/lib_init.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_io.c +2 -3
- data/lua-hooks/ext/luajit/src/lib_jit.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_math.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_os.c +2 -2
- data/lua-hooks/ext/luajit/src/lib_package.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_string.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_table.c +1 -1
- data/lua-hooks/ext/luajit/src/lj.supp +15 -0
- data/lua-hooks/ext/luajit/src/lj_alloc.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_api.c +4 -1
- data/lua-hooks/ext/luajit/src/lj_arch.h +33 -7
- data/lua-hooks/ext/luajit/src/lj_asm.c +12 -5
- data/lua-hooks/ext/luajit/src/lj_asm.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_asm_arm.h +3 -13
- data/lua-hooks/ext/luajit/src/lj_asm_mips.h +337 -71
- data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +2 -2
- data/lua-hooks/ext/luajit/src/lj_asm_x86.h +2 -2
- data/lua-hooks/ext/luajit/src/lj_bc.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_bc.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_bcdump.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_bcread.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_bcwrite.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_buf.c +2 -4
- data/lua-hooks/ext/luajit/src/lj_buf.h +1 -3
- data/lua-hooks/ext/luajit/src/lj_carith.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_carith.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ccall.c +37 -14
- data/lua-hooks/ext/luajit/src/lj_ccall.h +3 -3
- data/lua-hooks/ext/luajit/src/lj_ccallback.c +16 -7
- data/lua-hooks/ext/luajit/src/lj_ccallback.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_cconv.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_cconv.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_cdata.c +10 -1
- data/lua-hooks/ext/luajit/src/lj_cdata.h +3 -1
- data/lua-hooks/ext/luajit/src/lj_clib.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_clib.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_cparse.c +27 -6
- data/lua-hooks/ext/luajit/src/lj_cparse.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_crecord.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_crecord.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ctype.c +10 -8
- data/lua-hooks/ext/luajit/src/lj_ctype.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_debug.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_debug.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_def.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_dispatch.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_dispatch.h +21 -4
- data/lua-hooks/ext/luajit/src/lj_emit_arm.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_emit_mips.h +7 -5
- data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_emit_x86.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_err.c +69 -31
- data/lua-hooks/ext/luajit/src/lj_err.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_errmsg.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ff.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ffrecord.c +10 -40
- data/lua-hooks/ext/luajit/src/lj_ffrecord.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_frame.h +12 -1
- data/lua-hooks/ext/luajit/src/lj_func.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_func.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_gc.c +2 -2
- data/lua-hooks/ext/luajit/src/lj_gc.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_gdbjit.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_gdbjit.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ir.c +31 -15
- data/lua-hooks/ext/luajit/src/lj_ir.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ircall.h +29 -1
- data/lua-hooks/ext/luajit/src/lj_iropt.h +2 -1
- data/lua-hooks/ext/luajit/src/lj_jit.h +2 -1
- data/lua-hooks/ext/luajit/src/lj_lex.c +28 -1
- data/lua-hooks/ext/luajit/src/lj_lex.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_lib.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_lib.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_load.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_mcode.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_mcode.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_meta.c +8 -8
- data/lua-hooks/ext/luajit/src/lj_meta.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_obj.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_obj.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_dce.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_fold.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_loop.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_mem.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_sink.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_split.c +10 -5
- data/lua-hooks/ext/luajit/src/lj_parse.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_parse.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_profile.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_profile.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_record.c +13 -5
- data/lua-hooks/ext/luajit/src/lj_record.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_snap.c +20 -23
- data/lua-hooks/ext/luajit/src/lj_snap.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_state.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_state.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_str.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_str.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_strfmt.c +12 -98
- data/lua-hooks/ext/luajit/src/lj_strfmt.h +4 -4
- data/lua-hooks/ext/luajit/src/lj_strfmt_num.c +591 -0
- data/lua-hooks/ext/luajit/src/lj_strscan.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_strscan.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_tab.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_tab.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target_arm.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target_arm64.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target_mips.h +30 -2
- data/lua-hooks/ext/luajit/src/lj_target_ppc.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target_x86.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_trace.c +7 -2
- data/lua-hooks/ext/luajit/src/lj_trace.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_traceerr.h +1 -3
- data/lua-hooks/ext/luajit/src/lj_udata.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_udata.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_vm.h +5 -3
- data/lua-hooks/ext/luajit/src/lj_vmevent.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_vmevent.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_vmmath.c +15 -15
- data/lua-hooks/ext/luajit/src/ljamalg.c +2 -1
- data/lua-hooks/ext/luajit/src/lua.h +1 -0
- data/lua-hooks/ext/luajit/src/luaconf.h +2 -2
- data/lua-hooks/ext/luajit/src/luajit.c +1 -1
- data/lua-hooks/ext/luajit/src/luajit.h +4 -4
- data/lua-hooks/ext/luajit/src/lualib.h +1 -1
- data/lua-hooks/ext/luajit/src/msvcbuild.bat +1 -1
- data/lua-hooks/ext/luajit/src/ps4build.bat +26 -6
- data/lua-hooks/ext/luajit/src/vm_arm.dasc +17 -9
- data/lua-hooks/ext/luajit/src/vm_arm64.dasc +1 -1
- data/lua-hooks/ext/luajit/src/vm_mips.dasc +1562 -656
- data/lua-hooks/ext/luajit/src/vm_ppc.dasc +3 -7
- data/lua-hooks/ext/luajit/src/vm_x64.dasc +10 -2
- data/lua-hooks/ext/luajit/src/vm_x86.dasc +5 -8
- data/lua-hooks/ext/luautf8/module.mk +2 -0
- data/lua-hooks/ext/module.mk +15 -0
- data/lua-hooks/ext/modules.h +17 -0
- data/lua-hooks/ext/perf/luacpu.c +1 -1
- data/lua-hooks/ext/perf/lualoadavg.c +1 -1
- data/lua-hooks/ext/perf/luameminfo.c +1 -1
- data/lua-hooks/ext/perf/luaoslib.c +124 -2
- data/lua-hooks/ext/perf/module.mk +5 -0
- data/lua-hooks/ext/sha1/luasha1.c +4 -2
- data/lua-hooks/ext/sha1/module.mk +5 -0
- data/lua-hooks/ext/sha2/luasha256.c +4 -2
- data/lua-hooks/ext/sha2/module.mk +5 -0
- data/lua-hooks/ext/sysutils/lua_utils.c +56 -0
- data/lua-hooks/ext/sysutils/module.mk +2 -0
- data/lua-hooks/lib/boot.lua +2 -1
- data/lua-hooks/lib/hooks/module.mk +31 -0
- data/lua-hooks/lib/hooks/xss/module.mk +4 -0
- data/lua-hooks/lib/lexers/module.mk +10 -0
- data/lua-hooks/lib/module.mk +38 -0
- data/lua-hooks/lib/schema/module.mk +3 -0
- data/lua-hooks/options.mk +59 -0
- metadata +21 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
----------------------------------------------------------------------------
|
2
2
|
-- LuaJIT compiler dump module.
|
3
3
|
--
|
4
|
-
-- Copyright (C) 2005-
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
6
6
|
----------------------------------------------------------------------------
|
7
7
|
--
|
@@ -571,6 +571,7 @@ local function dump_trace(what, tr, func, pc, otr, oex)
|
|
571
571
|
end
|
572
572
|
if dumpmode.H then out:write("</pre>\n\n") else out:write("\n") end
|
573
573
|
else
|
574
|
+
if what == "flush" then symtab, nexitsym = {}, 0 end
|
574
575
|
out:write("---- TRACE ", what, "\n\n")
|
575
576
|
end
|
576
577
|
out:flush()
|
@@ -1,7 +1,7 @@
|
|
1
1
|
----------------------------------------------------------------------------
|
2
2
|
-- LuaJIT profiler.
|
3
3
|
--
|
4
|
-
-- Copyright (C) 2005-
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
6
6
|
----------------------------------------------------------------------------
|
7
7
|
--
|
@@ -1,7 +1,7 @@
|
|
1
1
|
----------------------------------------------------------------------------
|
2
2
|
-- Verbose mode of the LuaJIT compiler.
|
3
3
|
--
|
4
|
-
-- Copyright (C) 2005-
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
6
6
|
----------------------------------------------------------------------------
|
7
7
|
--
|
@@ -1,7 +1,7 @@
|
|
1
1
|
----------------------------------------------------------------------------
|
2
2
|
-- LuaJIT profiler zones.
|
3
3
|
--
|
4
|
-
-- Copyright (C) 2005-
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
6
6
|
----------------------------------------------------------------------------
|
7
7
|
--
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** Auxiliary library for the Lua/C API.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major parts taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** Base and coroutine library.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major portions taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2011 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -435,13 +435,13 @@ LJLIB_CF(gcinfo)
|
|
435
435
|
LJLIB_CF(collectgarbage)
|
436
436
|
{
|
437
437
|
int opt = lj_lib_checkopt(L, 1, LUA_GCCOLLECT, /* ORDER LUA_GC* */
|
438
|
-
"\4stop\7restart\7collect\5count\1\377\4step\10setpause\12setstepmul");
|
438
|
+
"\4stop\7restart\7collect\5count\1\377\4step\10setpause\12setstepmul\1\377\11isrunning");
|
439
439
|
int32_t data = lj_lib_optint(L, 2, 0);
|
440
440
|
if (opt == LUA_GCCOUNT) {
|
441
441
|
setnumV(L->top, (lua_Number)G(L)->gc.total/1024.0);
|
442
442
|
} else {
|
443
443
|
int res = lua_gc(L, opt, data);
|
444
|
-
if (opt == LUA_GCSTEP)
|
444
|
+
if (opt == LUA_GCSTEP || opt == LUA_GCISRUNNING)
|
445
445
|
setboolV(L->top, res);
|
446
446
|
else
|
447
447
|
setintV(L->top, res);
|
@@ -495,11 +495,10 @@ LJLIB_CF(print)
|
|
495
495
|
shortcut = (tvisfunc(tv) && funcV(tv)->c.ffid == FF_tostring);
|
496
496
|
for (i = 0; i < nargs; i++) {
|
497
497
|
cTValue *o = &L->base[i];
|
498
|
-
char buf[STRFMT_MAXBUF_NUM];
|
499
498
|
const char *str;
|
500
499
|
size_t size;
|
501
500
|
MSize len;
|
502
|
-
if (shortcut && (str = lj_strfmt_wstrnum(
|
501
|
+
if (shortcut && (str = lj_strfmt_wstrnum(L, o, &len)) != NULL) {
|
503
502
|
size = len;
|
504
503
|
} else {
|
505
504
|
copyTV(L, L->top+1, o);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** Debug library.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major portions taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** FFI library.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
*/
|
5
5
|
|
6
6
|
#define lib_ffi_c
|
@@ -505,10 +505,7 @@ LJLIB_CF(ffi_new) LJLIB_REC(.)
|
|
505
505
|
}
|
506
506
|
if (sz == CTSIZE_INVALID)
|
507
507
|
lj_err_arg(L, 1, LJ_ERR_FFI_INVSIZE);
|
508
|
-
|
509
|
-
cd = lj_cdata_new(cts, id, sz);
|
510
|
-
else
|
511
|
-
cd = lj_cdata_newv(L, id, sz, ctype_align(info));
|
508
|
+
cd = lj_cdata_newx(cts, id, sz, info);
|
512
509
|
setcdataV(L, o-1, cd); /* Anchor the uninitialized cdata. */
|
513
510
|
lj_cconv_ct_init(cts, ct, sz, cdataptr(cd),
|
514
511
|
o, (MSize)(L->top - o)); /* Initialize cdata. */
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** Library initialization.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major parts taken verbatim from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** I/O library.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major portions taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2011 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -232,9 +232,8 @@ static int io_file_write(lua_State *L, FILE *fp, int start)
|
|
232
232
|
cTValue *tv;
|
233
233
|
int status = 1;
|
234
234
|
for (tv = L->base+start; tv < L->top; tv++) {
|
235
|
-
char buf[STRFMT_MAXBUF_NUM];
|
236
235
|
MSize len;
|
237
|
-
const char *p = lj_strfmt_wstrnum(
|
236
|
+
const char *p = lj_strfmt_wstrnum(L, tv, &len);
|
238
237
|
if (!p)
|
239
238
|
lj_err_argt(L, (int)(tv - L->base) + 1, LUA_TSTRING);
|
240
239
|
status = status && (fwrite(p, 1, len, fp) == len);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** OS library.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major portions taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -39,7 +39,7 @@
|
|
39
39
|
|
40
40
|
LJLIB_CF(os_execute)
|
41
41
|
{
|
42
|
-
#if
|
42
|
+
#if LJ_NO_SYSTEM
|
43
43
|
#if LJ_52
|
44
44
|
errno = ENOSYS;
|
45
45
|
return luaL_fileresult(L, 0, NULL);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** Package library.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major portions taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2012 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** String library.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major portions taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** Table library.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major portions taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -24,3 +24,18 @@
|
|
24
24
|
Memcheck:Cond
|
25
25
|
fun:lj_str_new
|
26
26
|
}
|
27
|
+
{
|
28
|
+
Optimized string compare
|
29
|
+
Memcheck:Addr4
|
30
|
+
fun:lj_str_fastcmp
|
31
|
+
}
|
32
|
+
{
|
33
|
+
Optimized string compare
|
34
|
+
Memcheck:Addr1
|
35
|
+
fun:lj_str_fastcmp
|
36
|
+
}
|
37
|
+
{
|
38
|
+
Optimized string compare
|
39
|
+
Memcheck:Cond
|
40
|
+
fun:lj_str_fastcmp
|
41
|
+
}
|
@@ -196,7 +196,7 @@ static LJ_AINLINE void *CALL_MMAP(size_t size)
|
|
196
196
|
return ptr;
|
197
197
|
}
|
198
198
|
|
199
|
-
#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__)
|
199
|
+
#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__) || defined(__CYGWIN__)
|
200
200
|
|
201
201
|
/* OSX and FreeBSD mmap() use a naive first-fit linear search.
|
202
202
|
** That's perfect for us. Except that -pagezero_size must be set for OSX,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** Public Lua/C API.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
**
|
5
5
|
** Major portions taken verbatim or adapted from the Lua interpreter.
|
6
6
|
** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
|
@@ -1188,6 +1188,9 @@ LUA_API int lua_gc(lua_State *L, int what, int data)
|
|
1188
1188
|
res = (int)(g->gc.stepmul);
|
1189
1189
|
g->gc.stepmul = (MSize)data;
|
1190
1190
|
break;
|
1191
|
+
case LUA_GCISRUNNING:
|
1192
|
+
res = (g->gc.threshold != LJ_MAX_MEM);
|
1193
|
+
break;
|
1191
1194
|
default:
|
1192
1195
|
res = -1; /* Invalid option. */
|
1193
1196
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** Target architecture selection.
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
*/
|
5
5
|
|
6
6
|
#ifndef _LJ_ARCH_H
|
@@ -155,7 +155,11 @@
|
|
155
155
|
#define LJ_ARCH_NAME "x64"
|
156
156
|
#define LJ_ARCH_BITS 64
|
157
157
|
#define LJ_ARCH_ENDIAN LUAJIT_LE
|
158
|
-
#
|
158
|
+
#if LJ_TARGET_WINDOWS || __CYGWIN__
|
159
|
+
#define LJ_ABI_WIN 1
|
160
|
+
#else
|
161
|
+
#define LJ_ABI_WIN 0
|
162
|
+
#endif
|
159
163
|
#define LJ_TARGET_X64 1
|
160
164
|
#define LJ_TARGET_X86ORX64 1
|
161
165
|
#define LJ_TARGET_EHRETREG 0
|
@@ -291,6 +295,28 @@
|
|
291
295
|
#define LJ_ARCH_NAME "mips"
|
292
296
|
#define LJ_ARCH_ENDIAN LUAJIT_BE
|
293
297
|
#endif
|
298
|
+
|
299
|
+
#if !defined(LJ_ARCH_HASFPU)
|
300
|
+
#ifdef __mips_soft_float
|
301
|
+
#define LJ_ARCH_HASFPU 0
|
302
|
+
#else
|
303
|
+
#define LJ_ARCH_HASFPU 1
|
304
|
+
#endif
|
305
|
+
#endif
|
306
|
+
|
307
|
+
/* Temporarily disable features until the code has been merged. */
|
308
|
+
#if !defined(LUAJIT_NO_UNWIND) && __GNU_COMPACT_EH__
|
309
|
+
#define LUAJIT_NO_UNWIND 1
|
310
|
+
#endif
|
311
|
+
|
312
|
+
#if !defined(LJ_ABI_SOFTFP)
|
313
|
+
#ifdef __mips_soft_float
|
314
|
+
#define LJ_ABI_SOFTFP 1
|
315
|
+
#else
|
316
|
+
#define LJ_ABI_SOFTFP 0
|
317
|
+
#endif
|
318
|
+
#endif
|
319
|
+
|
294
320
|
#define LJ_ARCH_BITS 32
|
295
321
|
#define LJ_TARGET_MIPS 1
|
296
322
|
#define LJ_TARGET_EHRETREG 4
|
@@ -298,7 +324,7 @@
|
|
298
324
|
#define LJ_TARGET_MASKSHIFT 1
|
299
325
|
#define LJ_TARGET_MASKROT 1
|
300
326
|
#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
|
301
|
-
#define LJ_ARCH_NUMMODE
|
327
|
+
#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL
|
302
328
|
|
303
329
|
#if _MIPS_ARCH_MIPS32R2
|
304
330
|
#define LJ_ARCH_VERSION 20
|
@@ -382,9 +408,6 @@
|
|
382
408
|
#error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
|
383
409
|
#endif
|
384
410
|
#elif LJ_TARGET_MIPS
|
385
|
-
#if defined(__mips_soft_float)
|
386
|
-
#error "No support for MIPS CPUs without FPU"
|
387
|
-
#endif
|
388
411
|
#if defined(_LP64)
|
389
412
|
#error "No support for MIPS64"
|
390
413
|
#endif
|
@@ -488,12 +511,15 @@
|
|
488
511
|
#endif
|
489
512
|
|
490
513
|
/* Various workarounds for embedded operating systems or weak C runtimes. */
|
491
|
-
#if
|
514
|
+
#if defined(__ANDROID__) || defined(__symbian__) || LJ_TARGET_XBOX360 || LJ_TARGET_WINDOWS
|
492
515
|
#define LUAJIT_NO_LOG2
|
493
516
|
#endif
|
494
517
|
#if defined(__symbian__) || LJ_TARGET_WINDOWS
|
495
518
|
#define LUAJIT_NO_EXP2
|
496
519
|
#endif
|
520
|
+
#if LJ_TARGET_CONSOLE || (LJ_TARGET_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
|
521
|
+
#define LJ_NO_SYSTEM 1
|
522
|
+
#endif
|
497
523
|
|
498
524
|
#if defined(LUAJIT_NO_UNWIND) || defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3 || LJ_TARGET_PS4
|
499
525
|
#define LJ_NO_UNWIND 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** IR assembler (SSA IR -> machine code).
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
*/
|
5
5
|
|
6
6
|
#define lj_asm_c
|
@@ -1609,16 +1609,24 @@ static void asm_ir(ASMState *as, IRIns *ir)
|
|
1609
1609
|
case IR_ADD: asm_add(as, ir); break;
|
1610
1610
|
case IR_SUB: asm_sub(as, ir); break;
|
1611
1611
|
case IR_MUL: asm_mul(as, ir); break;
|
1612
|
-
case IR_DIV: asm_div(as, ir); break;
|
1613
1612
|
case IR_MOD: asm_mod(as, ir); break;
|
1614
|
-
case IR_POW: asm_pow(as, ir); break;
|
1615
1613
|
case IR_NEG: asm_neg(as, ir); break;
|
1614
|
+
#if LJ_SOFTFP
|
1615
|
+
case IR_DIV: case IR_POW: case IR_ABS:
|
1616
|
+
case IR_ATAN2: case IR_LDEXP: case IR_FPMATH: case IR_TOBIT:
|
1617
|
+
lua_assert(0); /* Unused for LJ_SOFTFP. */
|
1618
|
+
break;
|
1619
|
+
#else
|
1620
|
+
case IR_DIV: asm_div(as, ir); break;
|
1621
|
+
case IR_POW: asm_pow(as, ir); break;
|
1616
1622
|
case IR_ABS: asm_abs(as, ir); break;
|
1617
1623
|
case IR_ATAN2: asm_atan2(as, ir); break;
|
1618
1624
|
case IR_LDEXP: asm_ldexp(as, ir); break;
|
1625
|
+
case IR_FPMATH: asm_fpmath(as, ir); break;
|
1626
|
+
case IR_TOBIT: asm_tobit(as, ir); break;
|
1627
|
+
#endif
|
1619
1628
|
case IR_MIN: asm_min(as, ir); break;
|
1620
1629
|
case IR_MAX: asm_max(as, ir); break;
|
1621
|
-
case IR_FPMATH: asm_fpmath(as, ir); break;
|
1622
1630
|
|
1623
1631
|
/* Overflow-checking arithmetic ops. */
|
1624
1632
|
case IR_ADDOV: asm_addov(as, ir); break;
|
@@ -1663,7 +1671,6 @@ static void asm_ir(ASMState *as, IRIns *ir)
|
|
1663
1671
|
case IR_OBAR: asm_obar(as, ir); break;
|
1664
1672
|
|
1665
1673
|
/* Type conversions. */
|
1666
|
-
case IR_TOBIT: asm_tobit(as, ir); break;
|
1667
1674
|
case IR_CONV: asm_conv(as, ir); break;
|
1668
1675
|
case IR_TOSTR: asm_tostr(as, ir); break;
|
1669
1676
|
case IR_STRTO: asm_strto(as, ir); break;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
** ARM IR assembler (SSA IR -> machine code).
|
3
|
-
** Copyright (C) 2005-
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
4
4
|
*/
|
5
5
|
|
6
6
|
/* -- Register allocator extensions --------------------------------------- */
|
@@ -426,7 +426,7 @@ static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)
|
|
426
426
|
static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)
|
427
427
|
{
|
428
428
|
RegSet drop = RSET_SCRATCH;
|
429
|
-
int hiop = ((ir+1)->o == IR_HIOP);
|
429
|
+
int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t));
|
430
430
|
if (ra_hasreg(ir->r))
|
431
431
|
rset_clear(drop, ir->r); /* Dest reg handled below. */
|
432
432
|
if (hiop && ra_hasreg((ir+1)->r))
|
@@ -520,8 +520,6 @@ static void asm_tobit(ASMState *as, IRIns *ir)
|
|
520
520
|
emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15));
|
521
521
|
emit_dnm(as, ARMI_VADD_D, (tmp & 15), (left & 15), (right & 15));
|
522
522
|
}
|
523
|
-
#else
|
524
|
-
#define asm_tobit(as, ir) lua_assert(0)
|
525
523
|
#endif
|
526
524
|
|
527
525
|
static void asm_conv(ASMState *as, IRIns *ir)
|
@@ -1372,8 +1370,6 @@ static void asm_fpmath(ASMState *as, IRIns *ir)
|
|
1372
1370
|
else
|
1373
1371
|
asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
|
1374
1372
|
}
|
1375
|
-
#else
|
1376
|
-
#define asm_fpmath(as, ir) lua_assert(0)
|
1377
1373
|
#endif
|
1378
1374
|
|
1379
1375
|
static int asm_swapops(ASMState *as, IRRef lref, IRRef rref)
|
@@ -1492,13 +1488,7 @@ static void asm_mul(ASMState *as, IRIns *ir)
|
|
1492
1488
|
#define asm_subov(as, ir) asm_sub(as, ir)
|
1493
1489
|
#define asm_mulov(as, ir) asm_mul(as, ir)
|
1494
1490
|
|
1495
|
-
#if LJ_SOFTFP
|
1496
|
-
#define asm_div(as, ir) lua_assert(0)
|
1497
|
-
#define asm_pow(as, ir) lua_assert(0)
|
1498
|
-
#define asm_abs(as, ir) lua_assert(0)
|
1499
|
-
#define asm_atan2(as, ir) lua_assert(0)
|
1500
|
-
#define asm_ldexp(as, ir) lua_assert(0)
|
1501
|
-
#else
|
1491
|
+
#if !LJ_SOFTFP
|
1502
1492
|
#define asm_div(as, ir) asm_fparith(as, ir, ARMI_VDIV_D)
|
1503
1493
|
#define asm_pow(as, ir) asm_callid(as, ir, IRCALL_lj_vm_powi)
|
1504
1494
|
#define asm_abs(as, ir) asm_fpunary(as, ir, ARMI_VABS_D)
|