Commit Graph

2570 Commits

Author SHA1 Message Date
Mike Pall
7a0cf5fd4c Merge branch 'master' into v2.1 2022-11-09 11:06:11 +01:00
Mike Pall
ca8d3257bb Ensure correct stack top for OOM error message.
Reported by Sergey Kaplun.
2022-11-09 11:01:41 +01:00
Mike Pall
6c4826f12c ARM64: Fix IR_SLOAD assembly.
Reported by Gate88.
2022-10-04 12:04:17 +02:00
Mike Pall
dad04f1754 Fix trace join to BC_JLOOP originating from BC_ITERN.
Reported by OpenResty Inc.
2022-09-14 12:26:53 +02:00
Mike Pall
fffd3eafc4 Fix compiler warnings.
Reported by gan74.
2022-09-13 13:43:03 +02:00
Mike Pall
e19db60512 Fix QNX build.
Note: this is not an officially supported target.
Contributed by Wen Yang.
2022-09-12 11:16:20 +02:00
Mike Pall
03080b795a Add -F option to override filename in jit.bcsave (luajit -b).
Suggested by Mathias Westerdahl.
2022-08-15 14:16:58 +02:00
Mike Pall
633f265f67 LJ_GC64: Fix lua_concat().
Reported by Mathias Westerdahl.
2022-08-10 19:27:53 +02:00
Mike Pall
e61a1f961a Merge branch 'master' into v2.1 2022-08-07 20:04:52 +02:00
Mike Pall
a93f4bb39f Prevent use of RTLD_DEFAULT when NO_RTLD_DEFAULT is defined.
Workaround for Android 4.4 bug.
Thanks to gudzpoz.
2022-08-07 20:02:40 +02:00
Mike Pall
a7d0265480 Improve GC estimation for userdata with attached managed memory.
This works well for string.buffers, but not for userdata or
cdata with attached unmanaged memory (malloc/free, mmap/munmap).
2022-07-28 15:40:28 +02:00
Mike Pall
9c3df68a1e Add missing GC steps to string buffer methods.
Reported by Cosmin Apreutesei.
2022-07-28 15:38:54 +02:00
Mike Pall
e1339aed3d x86/x64: Limit VLOAD fusion to simple cases.
Reported by ccagml.
2022-07-27 11:32:33 +02:00
Mike Pall
3065c910ad OSX/iOS/ARM64: Fix generation of Mach-O object files.
Thanks to Carlo Cabrera.
2022-07-22 12:14:40 +02:00
Mike Pall
32984282dd Prevent trace start at BC_ITERL after compiled BC_ITERN.
Reported by ccagml.
2022-07-21 17:30:56 +02:00
Mike Pall
5677985dc1 ARM64: Allow building with unwinding disabled. 2022-07-19 12:53:34 +02:00
Mike Pall
50936d7844 Merge branch 'master' into v2.1 2022-07-13 00:37:14 +02:00
Mike Pall
899093a9e0 FFI: Fix sizeof expression in C parser for reference types. 2022-07-13 00:32:31 +02:00
Mike Pall
36b2962d40 FFI: Fix ffi.alignof() for reference types.
Reported by Eric Gouyer.
2022-07-13 00:32:04 +02:00
Mike Pall
27a6fee82e FFI: Allow ffi.metatype() for typedefs with attributes.
Reported by Eric Gouyer.
2022-07-13 00:30:23 +02:00
Mike Pall
b98b37231b OSX/iOS/ARM64: Fix bytecode embedding in Mach-O object file.
Thanks to Carlo Cabrera.
2022-07-12 22:25:33 +02:00
Mike Pall
6bda30d8c7 LJ_GC64: Fix IR_VARG offset for fixed number of results.
Reported by George Vaintrub. Fixed by Sergey Kaplun.
2022-07-12 22:21:26 +02:00
Mike Pall
e3bae12fc0 Merge branch 'master' into v2.1 2022-07-08 15:12:43 +02:00
Mike Pall
674afcd4e2 x86/x64: Fix math.ceil(-0.9) result sign.
Reported by minoki.
2022-07-08 14:57:01 +02:00
Mike Pall
0065cff7e0 Make embedded bytecode readable and forward-compatible. 2022-06-13 21:23:16 +02:00
Mike Pall
02da2218ed Merge branch 'master' into v2.1 2022-06-08 15:36:47 +02:00
Mike Pall
7dc3850e78 Fix warnings in minilua.c. 2022-06-08 15:35:12 +02:00
Mike Pall
7beb3375e3 Add Nintendo Switch port.
Contributed by Swyter and vdweller84.
2022-06-08 14:24:57 +02:00
Mike Pall
96157d360d Avoid zero-sized arrays in jit_State. 2022-06-08 11:26:50 +02:00
Mike Pall
b32e94856b Don't use jit_State during build with JIT disabled. 2022-06-08 11:20:28 +02:00
Mike Pall
d4b6bb80ea Fix ITERN loop detection when hook checks are enabled.
Reported by Myria.
2022-06-02 13:18:10 +02:00
Mike Pall
1b8d8cabdc Merge branch 'master' into v2.1 2022-05-21 12:02:32 +02:00
Mike Pall
bb7a30727e Prevent C compiler undefined-behavior optimization. 2022-05-21 12:00:10 +02:00
Mike Pall
4ef96cff88 Fix alias analysis for table length forwarding.
Contributed by Maxim Sokolov.
2022-05-20 12:16:25 +02:00
Mike Pall
80bb1428aa Fix loop initialization in table.foreach().
Reported by Daniel Steinberg.
2022-05-20 11:54:20 +02:00
Mike Pall
91bc6b8ad1 LJ_GC64: Fix HREFK optimization.
Contributed by XmiliaH.
2022-05-03 20:51:29 +02:00
Mike Pall
3ee3c9cfa9 Fix recording of __concat metamethod.
Reported by Elias Oelschner. Analyzed by XmiliaH.
2022-05-02 22:33:35 +02:00
Mike Pall
34a62c7f73 Add PS5 port. 2022-04-17 23:41:39 +02:00
Mike Pall
1a401622fe Fix assertions.
Reported by ssdr.
2022-04-17 10:56:11 +02:00
Mike Pall
5e3c45c43b x64: Fix RETHI/RETLO swap after call.
Reported by savilli.
2022-04-05 09:55:15 +02:00
Mike Pall
20aea93915 Fix assertion for LJ_KEYINDEX.
Thanks to XmiliaH.
2022-04-03 10:35:42 +02:00
Mike Pall
1cdff194cf Add missing check for LJ_KEYINDEX in ITERN recording.
Reported by dragonorloong. Analyzed by vfprintf. #827
2022-04-02 21:27:43 +02:00
Mike Pall
43ebb949a2 Fix soft-float IR_POW splitting.
Reported by lison0322.
2022-03-20 11:29:17 +01:00
Mike Pall
c4fe76d50c Merge branch 'master' into v2.1 2022-03-13 18:34:59 +01:00
Mike Pall
93a65d3cc2 Fix BC_UCLO insertion for returns.
Contributed by XmiliaH.
2022-03-13 18:32:32 +01:00
Mike Pall
8b8304f16e Fix compiler warning. 2022-03-08 20:05:33 +01:00
Mike Pall
96d6d50320 Revert to trival pow() optimizations to prevent inaccuracies. 2022-03-08 19:44:10 +01:00
Mike Pall
aa0550e3f0 Fix string buffer COW handling, part 2.
Reported by XmiliaH.
2022-03-07 15:46:51 +01:00
Mike Pall
c93890ed8b *BSD: Fix getentropy() declaration.
Thanks to dundargoc.
2022-03-07 09:45:04 +01:00
Mike Pall
c4adf49204 Fix string buffer COW handling.
Reported by XmiliaH.
2022-03-07 09:42:59 +01:00
Mike Pall
1d7b5029c5 Merge branch 'master' into v2.1 2022-01-27 22:26:14 +01:00
Mike Pall
9ebebc9b58 Fix command-line argv handling. 2022-01-27 22:18:39 +01:00
Mike Pall
b96d74621b Merge branch 'master' into v2.1 2022-01-25 22:18:20 +01:00
Mike Pall
c2237247cc Don't export internal symbol. 2022-01-25 22:17:56 +01:00
Mike Pall
9512d5c1ac Fix pow() optimization inconsistencies. 2022-01-24 14:37:50 +01:00
Mike Pall
c18acfe756 Merge branch 'master' into v2.1 2022-01-23 19:19:26 +01:00
Mike Pall
c50232eb32 Always exit after machine code page protection change fails.
Reported by Sergey Kaplun.
2022-01-23 19:16:53 +01:00
Mike Pall
5935564c3b Fix FOLD rule for BUFHDR append with intervening buffer use.
Reported by XmiliaH.
2022-01-23 19:13:53 +01:00
Mike Pall
c929efc039 Fix compiled error handling for buffer methods.
Contributed by XmiliaH.
2022-01-23 19:10:47 +01:00
Mike Pall
4077f0c3d6 Prevent unroll across BC_ITERN.
Reported by Marukyu.
2022-01-16 21:01:52 +01:00
Mike Pall
1dddc55ca3 Prevent replay of buffer operation for PHI operands.
Contributed by XmiliaH.
2022-01-16 21:00:24 +01:00
Mike Pall
2c218bf756 Merge branch 'master' into v2.1 2022-01-16 20:59:10 +01:00
Mike Pall
b5b20191f3 Save trace recorder state around VM event call.
Reported by Sergey Kaplun.
2022-01-16 20:58:42 +01:00
Mike Pall
7306ba78d6 Merge branch 'master' into v2.1 2022-01-15 19:42:30 +01:00
Mike Pall
c4dfb625ba Bump copyright date. 2022-01-15 19:30:54 +01:00
Mike Pall
c21c6cb417 FFI: Ensure library is loaded before de-serializing FFI types.
Reported by ImagicTheCat.
2022-01-15 18:32:34 +01:00
Mike Pall
d5a237eae0 Fix HREFK forwarding vs. table.clear().
Reported by XmiliaH.
2022-01-15 17:52:21 +01:00
Mike Pall
bc1bdbf620 Fix FOLD rule for BUFHDR append.
Reported by XmiliaH.
2022-01-13 18:33:04 +01:00
Mike Pall
be251d9149 OSX: Disable unreliable assertion for external frame unwinding. 2022-01-13 17:57:03 +01:00
Mike Pall
4ccaf348fb Merge branch 'master' into v2.1 2022-01-13 17:51:09 +01:00
Mike Pall
e560487536 Limit exponent range in number parsing.
Reported by XmiliaH.
2022-01-13 17:48:43 +01:00
Mike Pall
103c29e634 Fix tonumber("-0") in dual-number mode.
Reported by Sergey Kaplun.
2022-01-13 15:38:56 +01:00
Mike Pall
a01602a826 Limit work done in SINK pass.
Reported by XmiliaH.
2022-01-13 15:13:59 +01:00
Mike Pall
c8bcf1e5fb Fix ABC FOLD rule with constants.
Reported by XmiliaH.
2022-01-13 14:40:11 +01:00
Mike Pall
a91d0d9d3b Merge branch 'master' into v2.1 2021-12-19 18:37:06 +01:00
Mike Pall
e73916d811 Prevent CSE of a REF_BASE operand across IR_RETF.
Reported by XmiliaH.
2021-12-19 18:35:27 +01:00
Mike Pall
1d20f33d29 Windows: Fix binary output of jit.bcsave to stdout.
Thanks to erw7.
2021-12-17 14:30:44 +01:00
Mike Pall
8b7ea5c1af Merge branch 'master' into v2.1 2021-12-17 14:17:16 +01:00
Mike Pall
7b994e0ee0 Fix FOLD rule for x-0.
Reported by XmiliaH.
2021-12-17 14:15:40 +01:00
Mike Pall
b4b2dce9fc ARM64: Fix pcall() error case.
Reported by Alex Orlenko.
2021-10-27 21:56:07 +02:00
Mike Pall
bfcb74ed36 OSX/ARM64: Fix external unwinding.
Contributed by Edmund Kapusniak. #698 #757
2021-10-17 13:14:41 +02:00
Mike Pall
bfd076532c Fix string buffer method recording.
Reported and analyzed by vfprintf. #755
2021-10-12 23:49:47 +02:00
Mike Pall
05f1984e1a Fix interaction of profiler and ITERN recording.
Reported and analyzed by vfprintf. #754
2021-10-08 16:50:35 +02:00
Mike Pall
442eff63ab Fix compilation of multi-result call to next().
Thanks to Vyacheslav Egorov.
2021-10-06 17:31:46 +02:00
Mike Pall
e4b4d94514 ARM64: Fix IR_HREF code generation. 2021-10-02 17:49:50 +02:00
Mike Pall
4a70bd71ac MIPS64: Fix soft-float IR_TOSTR. 2021-10-02 17:48:19 +02:00
Mike Pall
10c9d9a214 Merge branch 'master' into v2.1 2021-10-02 17:23:51 +02:00
Mike Pall
d3294fa63b MIPS: Fix register allocation in assembly of HREF.
Reported by Jakub Piotr Cłapa.
2021-10-02 16:52:57 +02:00
Mike Pall
a2047d3f18 Fix compiler warning.
Suggested by Fezile Manana.
2021-09-29 11:59:27 +02:00
Mike Pall
94a40bb238 FFI: Ensure returned string is alive in ffi.typeinfo().
Reported by zhuizhuhaomeng.
2021-09-23 19:07:30 +02:00
Mike Pall
78350a2565 OSX/ARM64: Disable unwind info.
See #698.
2021-09-21 17:49:06 +02:00
Mike Pall
e2b9797ba1 Merge branch 'master' into v2.1 2021-09-21 16:44:06 +02:00
Mike Pall
204cee2c91 Fix stack allocation after on-trace stack check. 2021-09-21 16:42:35 +02:00
Mike Pall
191d87f531 Fix ITERN blacklisting.
Reported by ExtReMLapin. #744
2021-09-21 14:30:28 +02:00
Mike Pall
1aa4af0b83 Ensure ITERN forward progress on interpreter bailout.
Reported by Yichun Zhang and ExtReMLapin. #744
2021-09-21 13:15:06 +02:00
Mike Pall
421c4c7987 ARM64: Reorder interpreter stack frame and fix unwinding.
Reported by Yichun Zhang. Fixes #722.
May help towards fixing #698, too.
2021-09-20 22:37:07 +02:00
Mike Pall
28440544ba Don't bail out to interpreter to JLOOP originating from ITERN.
Otherwise forward progress is not guaranteed.
Reported by Yichun Zhang.
2021-09-20 14:40:23 +02:00
Mike Pall
003f68565d FFI: Don't load PC from non-function object in FFI continuation.
Reported by Yichun Zhang. #743
2021-09-20 14:39:26 +02:00
Mike Pall
98b7d9a3b2 Merge branch 'master' into v2.1 2021-09-20 14:39:50 +02:00
Mike Pall
68ffbd318b FFI: Don't load PC from non-function object in FFI continuation.
Reported by Yichun Zhang. #743
2021-09-20 14:36:52 +02:00
Mike Pall
a622e2eb55 FFI: Fix missing cts->L initialization in argv2ctype(). 2021-09-20 14:34:47 +02:00
Mike Pall
27ee3bcd79 OSX/ARM64: Disable external unwinding for now.
This reduces functionality, e.g. no handling of on-trace errors.
Someone with very deep knowledge about macOS and MACH-O/DWARF stack
unwinding internals is needed to fix this. See issue #698.
2021-09-19 17:58:24 +02:00
Mike Pall
bb0f241015 Compile table traversals: next(), pairs(), BC_ISNEXT/BC_ITERN.
Sponsored by OpenResty Inc.
2021-09-19 17:49:25 +02:00
Mike Pall
986bb406ad Use IR_HIOP for generalized two-register returns.
Sponsored by OpenResty Inc.
2021-09-19 17:47:11 +02:00
Mike Pall
c6f5ef649b Refactor table traversal.
Sponsored by OpenResty Inc.
2021-09-19 17:38:49 +02:00
Mike Pall
4e0ea654a8 ARM: Fix symbol display in trace disassembly. 2021-09-19 17:27:18 +02:00
Mike Pall
5ee78fd8e3 Refactor IR_TMPREF generation. 2021-09-19 17:25:27 +02:00
Mike Pall
9211f0b03b Refactor IR_VLOAD to take an offset. 2021-09-19 17:18:16 +02:00
Mike Pall
f2d333c1ac MIPS: Fix trace linking. 2021-09-19 16:09:48 +02:00
Mike Pall
8ff09d9f5a String buffers, part 4b: Improve de-serialization checks.
Sponsored by fmad.io.
2021-08-12 21:28:17 +02:00
Mike Pall
15ed84bd49 String buffers, part 4a: Add metatable serialization dictionary.
Sponsored by fmad.io.
2021-08-12 21:27:58 +02:00
Mike Pall
983d66b8c5 Merge branch 'master' into v2.1 2021-07-27 14:50:40 +02:00
Mike Pall
3a654999c6 Consider slots used by upvalues in use-def analysis.
Reported by XmiliaH.
2021-07-27 14:47:41 +02:00
Mike Pall
89a6740ffd Merge branch 'master' into v2.1 2021-07-23 21:36:17 +02:00
Mike Pall
0e66fc9637 Prevent loop in snap_usedef().
Reported by XmiliaH.
2021-07-23 21:33:59 +02:00
Mike Pall
dbb6c39f7c Merge branch 'master' into v2.1 2021-07-22 16:22:53 +02:00
Mike Pall
d87da3d5fe Fix io.close() error message.
Reported by François Perrad.
2021-07-22 16:21:45 +02:00
Mike Pall
bff9298090 Merge branch 'master' into v2.1 2021-07-22 02:35:00 +02:00
Mike Pall
8430f774e6 Fix io.close().
Reported by farmboy0.
2021-07-22 02:33:04 +02:00
Mike Pall
c2dd3b4d34 Merge branch 'master' into v2.1 2021-07-21 12:32:19 +02:00
Mike Pall
81a797373f Fix minilua vararg stack handling.
Note: this is not exploitable! minilua is only used during the LuaJIT
build process. It only runs controlled and static Lua code (DynASM),
which is entirely contained within this repo. LuaJIT itself has
completely different stack handling code and is not affected either.

This change is solely for the benefit of others, who might possibly use
minilua for purposes other than running DynASM.
2021-07-21 12:14:09 +02:00
Mike Pall
bc98a3ade5 PS4: Fix compile.
Thanks to Eric Lavesson.
2021-07-19 18:15:18 +02:00
Mike Pall
4deb5a1588 Merge branch 'master' into v2.1 2021-07-19 17:05:48 +02:00
Mike Pall
6ca580155b Avoid out-of-range number of results when compiling select(k, ...).
The interpreter will throw and abort the trace, anyway.
2021-07-19 17:03:16 +02:00
Mike Pall
29bc1f04ac String buffers, part 3d: Compile string buffer methods and functions.
Sponsored by fmad.io.
2021-07-19 16:53:30 +02:00
Mike Pall
2182630903 Minor improvements of optimizations. 2021-07-19 16:50:05 +02:00
Mike Pall
09547f9f6e Fix error message in lj_lib_checkintrange(). 2021-07-19 16:47:46 +02:00
Mike Pall
a689e9dc43 String buffers, part 2f: Prevent self-put of buffer.
Sponsored by fmad.io.
2021-07-19 16:45:26 +02:00
Mike Pall
02bcbea8b0 String buffers, part 3c: Add IRBUFHDR_WRITE mode.
Sponsored by fmad.io.
2021-07-19 16:46:27 +02:00
Mike Pall
1d5ef35fed Fix IRXLOAD_* mode bits description. 2021-07-19 16:36:00 +02:00
Mike Pall
3a0cf69730 String buffers, part 3b: Change IR_BUFHDR op2 mode bits to mode.
Sponsored by fmad.io.
2021-07-19 16:33:13 +02:00
Mike Pall
6df650fe3f String buffers, part 3a: Add IR_TMPREF for passing TValues to helpers.
Sponsored by fmad.io.
2021-07-19 16:23:12 +02:00
Mike Pall
71db0cf043 Add IRCONV_NONE for pass-through INT to I64/U64 type change. 2021-07-19 16:11:39 +02:00
Mike Pall
76fbf0397c Merge branch 'master' into v2.1 2021-07-19 16:07:23 +02:00
Mike Pall
44bd7437a2 Fix jit.dump() output for IR_CONV. 2021-07-19 16:05:05 +02:00
Mike Pall
e957737650 Disable unreliable assertion for external frame unwinding.
Broken on Fedora/ARM64. Reported by Yichun Zhang.
2021-06-25 12:53:23 +02:00
Mike Pall
95140c5001 Flush and close output file after profiling run.
Thanks to Sergey Ostanevich.
2021-06-25 12:48:42 +02:00
Mike Pall
16d38a4b21 Avoid conflict between 64 bit lightuserdata and ITERN key.
Reported by XmiliaH.
2021-06-25 12:45:51 +02:00
Mike Pall
3f9389edc6 Throw any errors before stack changes in trace stitching.
Thanks to doujiang24.
2021-06-14 14:56:54 +02:00
Mike Pall
ac02a120ef String buffers, part 2e: add serialization string dictionary.
Sponsored by fmad.io.
2021-06-07 12:03:22 +02:00
Mike Pall
52449e2a1e Fix MinGW static build.
Reported by Sundaram Ramaswamy.
2021-06-03 20:28:48 +02:00
Mike Pall
7d267973e2 Fix dependencies. 2021-06-03 10:07:00 +02:00
Mike Pall
65ff33a4af Fix IR_BUFHDR assembly. 2021-06-03 10:05:20 +02:00
Mike Pall
1b7171c339 FFI: Support FFI numbers in string.format() and buf:putf(). 2021-06-03 03:22:58 +02:00
Mike Pall
69138082a3 ARM64: More improvements to the generation of immediates. 2021-06-03 03:21:56 +02:00
Mike Pall
a119497bec String buffers, part 2d: basic string buffer methods.
Sponsored by fmad.io.
2021-06-01 05:16:32 +02:00
Mike Pall
edd5cbadc5 String buffers, part 2c: abstract out string.format.
Sponsored by fmad.io.
2021-06-01 05:14:18 +02:00
Mike Pall
50d6883e60 Abstract out on-demand loading of FFI library. 2021-06-01 01:01:15 +02:00
Mike Pall
61990cef05 String buffers, part 2b: Add extended string buffers. Use in serializer.
Sponsored by fmad.io.
2021-06-01 00:55:51 +02:00
Mike Pall
394fb6267a String buffers, part 2a: internal SBuf reorg. Use full pointers.
Sponsored by fmad.io.
2021-06-01 00:45:06 +02:00
Mike Pall
b5dafe5891 Merge branch 'master' into v2.1 2021-06-01 00:28:00 +02:00
Mike Pall
ae533e3a6c FFI: Fix dangling reference to CType. 2021-06-01 00:26:45 +02:00
Mike Pall
839fb5bd72 Merge branch 'master' into v2.1 2021-05-29 15:38:37 +02:00
Mike Pall
c2cfa04231 PPC/PS3: Fix BC_ADD*/BC_SUB*.
Thanks to MaryWan1982.
2021-05-29 15:33:08 +02:00
Mike Pall
e0cd3a8671 Merge branch 'master' into v2.1 2021-05-29 15:32:04 +02:00
Mike Pall
0e53a314d7 Fix use-def analysis for vararg functions.
Reported by Shmuel Zeigerman.
2021-05-29 15:31:13 +02:00
Mike Pall
fca488c715 Merge branch 'master' into v2.1 2021-05-24 22:28:58 +02:00
Mike Pall
2801500a26 Fix use-def analysis for BC_VARG.
Reported by Ryan Lucia.
2021-05-24 22:25:26 +02:00
Mike Pall
aa7ac66068 Merge branch 'master' into v2.1 2021-05-17 19:42:59 +02:00
Mike Pall
44684fa71d Fix compiler warnings. 2021-05-17 19:42:06 +02:00
Mike Pall
521b367567 FFI/ARM64/OSX: Fix vararg call handling.
Thanks to Igor Munkin.
2021-05-02 22:11:05 +02:00
Mike Pall
75ee3a6159 Prevent compile of __concat with tailcall to fast function.
E.g. __concat = function() return setmetatable(...) end
Reported by Fezile Manana.
2021-04-21 15:23:15 +02:00
Mike Pall
de77205490 Fix IR_RENAME snapshot number. Follow-up fix for a32aeadc.
Reported by Victor Bombi, analyzed by XmiliaH. Thanks!
2021-04-20 17:59:47 +02:00
Mike Pall
5374a0a3cf Fix compiler warning. 2021-04-19 13:54:41 +02:00
Mike Pall
66563bdab0 Fix build with busybox grep.
Reported by ymph.
2021-03-31 17:06:27 +02:00
Mike Pall
3217240b47 NetBSD: Use PROT_MPROTECT() and disable getentropy().
Note: this is not an officially supported target.
Contributed by David Carlier.
2021-03-29 10:41:52 +02:00
Mike Pall
9442226825 Allow disabling the serializer. 2021-03-26 19:43:02 +01:00
Mike Pall
b9d523965b BSD: Fix build with BSD grep.
Thanks to carlocab.
2021-03-26 18:31:42 +01:00
Mike Pall
668b1896b3 Fix .bat file builds. 2021-03-26 18:14:59 +01:00
Mike Pall
d4a554d6ee OSX: Fix build by hardcoding external frame unwinding.
Apparently they can't even get 'grep' right, let alone a keyboard.
2021-03-25 19:16:56 +01:00
Mike Pall
4c6b669c41 String buffers, part 1: object serialization.
Sponsored by fmad.io.
2021-03-25 02:21:31 +01:00
Mike Pall
836fb5bbd3 Reorganize lightuserdata interning code. 2021-03-25 02:15:26 +01:00
Mike Pall
ad65934fa0 FFI: Handle zero-fill of struct-of-NYI. 2021-03-23 02:35:07 +01:00
Mike Pall
ebc4919aff ARM64: Improve generation of immediates. 2021-03-23 02:08:44 +01:00
Mike Pall
a4c9fc3d6c Merge branch 'master' into v2.1 2021-03-23 00:48:27 +01:00
Mike Pall
33e3f4badf Detect inconsistent renames even in the presence of sunk values.
Reported by Igor Munkin.
2021-03-23 00:43:07 +01:00
Mike Pall
a32aeadc68 Handle on-trace OOM errors from helper functions. 2021-03-23 00:39:50 +01:00
Mike Pall
ddd0fd8f37 Use weak guards for on-trace allocations. 2021-03-23 00:33:34 +01:00
Mike Pall
de89c602c2 PPC: Fix GG_State loads. 2021-03-23 00:28:03 +01:00
Mike Pall
dbb7863016 MIPS: Fix handling of long-range spare jumps. 2021-03-23 00:26:08 +01:00
Mike Pall
e131936133 Cleanup and enable external unwinding for more platforms. 2021-03-23 00:22:34 +01:00
Mike Pall
787736990a iOS: Don't use getentropy() since it's disallowed in the App Store.
Reported by MoNTE48.
2021-03-10 20:19:04 +01:00
Mike Pall
67dbec82f4 Linux/ARM64: Make mremap() non-moving due to VA space woes.
This reduces overall performance on ARM64, but we have no choice.
Linux kernel default userspace VA is 48 bit, but we'd need 47 bit.
mremap() ignores address hints due to a kernel API issue. The mapping
may move to an undesired address which will cause an assert or crash.

Reported by Raymond W. Ko.
2021-03-10 19:58:31 +01:00
Mike Pall
1e66d0f9e6 Merge branch 'master' into v2.1 2021-01-02 21:56:07 +01:00
Mike Pall
f47c864b01 Bump copyright date. 2021-01-02 21:49:41 +01:00
Mike Pall
3134359734 Fix trace exit register dump for some archs. 2021-01-02 21:37:51 +01:00
Mike Pall
65378759f3 Merge branch 'master' into v2.1 2020-12-28 12:40:20 +01:00
Mike Pall
56c04accf9 FFI: Fix recording of union initialization.
Thanks to Alex Shpilkin.
2020-12-28 12:37:36 +01:00
Mike Pall
351bb43a07 Merge branch 'master' into v2.1 2020-12-04 11:17:45 +01:00
Mike Pall
d67ff15a5c x64: Fix __call metamethod return dispatch.
Reported by Igor Munkin.
2020-12-04 11:16:55 +01:00
Mike Pall
377a8488b6 Fix binary number literal parsing.
Reported by Egor Skriptunoff.
2020-11-30 15:48:34 +01:00
Mike Pall
a50262c490 Fix warning. 2020-11-30 15:47:14 +01:00
Mike Pall
652f71bb1d Merge branch 'master' into v2.1 2020-11-30 15:46:56 +01:00
Mike Pall
7aa3e313a3 Fix warning. 2020-11-30 15:46:07 +01:00
Mike Pall
1d8b747c16 Merge branch 'master' into v2.1 2020-10-12 16:18:02 +02:00
Mike Pall
050466552b Minor changes and https-ify links. 2020-10-12 16:11:32 +02:00
Mike Pall
675e08cf06 Merge branch 'master' into v2.1 2020-10-12 15:51:31 +02:00
Mike Pall
5c46f47736 Fix snapshot PC when linking to BC_JLOOP that was a BC_RET*.
Reported by Arseny Vakhrushev.
Fix contributed by Peter Cawley.
2020-10-12 15:45:05 +02:00
Mike Pall
4bb2e4a547 Merge branch 'master' into v2.1 2020-10-12 15:43:18 +02:00
Mike Pall
de6b1a11dd Ensure full init of IR_NOP instructions. 2020-10-12 15:40:28 +02:00
Mike Pall
e9af1abec5 Add support for full-range 64 bit lightuserdata. 2020-09-30 01:34:49 +02:00
Mike Pall
e67e2040be ARM64: Followup fix for exit branch patching. 2020-09-28 18:17:58 +02:00
Mike Pall
2e55a42c07 Merge branch 'master' into v2.1 2020-09-27 17:20:37 +02:00
Mike Pall
e8ec6fe996 Prevent patching of the GC exit check branch.
Reported by Arseny Vakhrushev.
2020-09-27 16:44:13 +02:00
Mike Pall
03a7ebca4f x64: Fix 64 bit shift code generation.
Reported by Philipp Kutin.
Fix contributed by Peter Cawley.
2020-09-25 22:49:23 +02:00
Mike Pall
dd0f09f95f Another fix for lua_yield() from C hook.
Reported by Jason Carr.
2020-09-22 23:37:43 +02:00
Mike Pall
518e8cbeb4 Merge branch 'master' into v2.1 2020-09-22 12:01:09 +02:00
Mike Pall
881d02d311 Mark CONV as non-weak, to prevent elimination of its side-effect.
An unused guarded CONV int.num cannot be omitted in general.
2020-09-22 11:56:06 +02:00
Mike Pall
dd5032ed84 Fix lua_yield() from C hook.
Reported by Jason Carr.
2020-09-15 01:02:24 +02:00
Mike Pall
7e94e1c4f1 Merge branch 'master' into v2.1 2020-09-05 20:05:44 +02:00
Mike Pall
90e65514dd Limit path length passed to C library loader. 2020-09-05 20:02:54 +02:00
Mike Pall
ff1e72acea LJ_GC64: Always snapshot functions for non-base frames.
Reported by Arseny Vakhrushev.
Analysis and fix contributed by Peter Cawley.
2020-08-27 18:05:32 +02:00
Mike Pall
94d4abcca9 Merge branch 'master' into v2.1 2020-08-09 23:12:48 +02:00
Mike Pall
e296f56b82 Call error function on rethrow after trace exit. 2020-08-09 22:50:31 +02:00
Mike Pall
46a6d06dc5 Merge branch 'master' into v2.1 2020-08-09 18:19:19 +02:00
Mike Pall
12ab596997 Fix handling of errors during snapshot restore. 2020-08-09 18:08:38 +02:00
Mike Pall
10ddae75af Merge branch 'master' into v2.1 2020-08-05 15:26:59 +02:00
Mike Pall
2211f6f960 ARM: Ensure relative GG_State element alignment differently.
Thanks to jojo59516 and dwing4g.
2020-08-05 15:21:00 +02:00
Mike Pall
98682accbb Merge branch 'master' into v2.1 2020-08-05 14:17:41 +02:00
Mike Pall
c4b1e0feae Fix Makefile dependencies.
Thanks to Stefanos Chaliasos.
2020-08-05 14:14:58 +02:00
Mike Pall
570e758ca7 Handle old OSX/iOS without getentropy(). 2020-07-13 11:54:08 +02:00
Mike Pall
6097795367 Merge branch 'master' into v2.1 2020-07-12 14:33:01 +02:00
Mike Pall
53f82e6e2e Fix frame traversal for __gc handler frames.
Reported by Changochen.
2020-07-12 14:30:34 +02:00
Mike Pall
384d6d56f4 Fix Clang build. 2020-07-02 01:24:39 +02:00
Mike Pall
18eef08fb8 Android/ARM: Fix build with recent NDK. 2020-07-02 01:23:41 +02:00
Mike Pall
e1e3034cf6 Fix compiler warning. 2020-06-25 15:19:48 +02:00
Mike Pall
5ef9e45238 Fix OSX build.
Reported by jnozsc.
2020-06-23 19:17:13 +02:00
Mike Pall
67654be56d Follow-up fix for iOS build. 2020-06-23 11:28:46 +02:00
Mike Pall
2e2fb8f6b5 OSX/iOS: Handle iOS simulator and ARM64 Macs. 2020-06-23 03:24:40 +02:00
Mike Pall
471f8936cb Fix pointer check for non-GC64 mode.
Thanks to Stefan Hett.
2020-06-23 03:14:35 +02:00
Mike Pall
17fb96d904 Windows: Fix NtAllocateVirtualMemory prototype. 2020-06-23 03:13:54 +02:00
Mike Pall
2e68e1fc18 Add jit.security(). 2020-06-23 03:12:32 +02:00
Mike Pall
ff34b48ddd Redesign and harden string interning.
Up to 40% faster on hash-intensive benchmarks.
With some ideas from Sokolov Yura.
2020-06-23 03:06:45 +02:00
Mike Pall
a44f53acf5 Use a securely seeded global PRNG for the VM.
It's not 2005 anymore.
2020-06-15 12:21:05 +02:00
Mike Pall
34e53736c6 Cleanup some arch defines and fix builds. 2020-06-15 11:23:04 +02:00
Mike Pall
d333b1a6fe ARM: Implement FLOAD from GG_State. 2020-06-13 01:12:14 +02:00
Mike Pall
8ae5170cdc Improve assertions. 2020-06-15 02:52:00 +02:00
Mike Pall
8b55054473 Merge branch 'master' into v2.1 2020-06-07 14:35:18 +02:00
Mike Pall
f5b0fff5a9 Fix debug.debug() for non-string errors. 2020-06-07 14:34:09 +02:00
Mike Pall
1a4ff13117 Optimize table length computation with hinting.
10x faster on loop with t[#t+1] = x idiom. Also used by table.insert.
2020-05-27 19:20:44 +02:00
Mike Pall
b2307c8ad8 Remove pow() splitting and cleanup backends. 2020-05-23 21:33:01 +02:00
Mike Pall
5655be4546 Cleanup math function compilation and fix inconsistencies. 2020-05-22 04:53:35 +02:00
Mike Pall
c5b8e9168b Merge branch 'master' into v2.1 2020-05-22 03:30:55 +02:00
Mike Pall
2f3f07882f Fix bytecode register allocation for comparisons. 2020-05-22 03:28:52 +02:00
Mike Pall
d75e26275b Don't compile math.modf() anymore.
It's rarely used and properly compiling it would be difficult.
2020-05-22 03:13:57 +02:00
Mike Pall
03208c8162 Fix math.min()/math.max() inconsistencies. 2020-05-22 03:10:30 +02:00
Mike Pall
1e6e8aaa20 Fix narrowing of unary minus. 2020-05-22 02:45:03 +02:00
Mike Pall
0eddcbead2 Cleanup CPU detection and tuning for old CPUs. 2020-05-20 20:42:04 +02:00
Mike Pall
5bf0da3d7c ARM64: Fix {AHUV}LOAD specialized to nil/false/true.
Reported by caohongqing.
2020-05-18 22:24:53 +02:00
Mike Pall
ae20998ff5 ARM, ARM64, PPC: Fix TSETR fallback.
Thanks to Javier Guerra Giraldez.
2020-05-18 22:06:50 +02:00
Mike Pall
322db02081 Remove unused file. 2020-05-08 14:00:19 +02:00
Mike Pall
d5e12d5174 Merge branch 'master' into v2.1 2020-05-08 14:00:07 +02:00
Mike Pall
cc4bbec483 FFI: Always fall back to metamethods for cdata length/concat.
Thanks to Egor Skriptunoff.
2020-05-08 13:50:41 +02:00
Mike Pall
92c011b511 Windows: Make actual use of internal allocator optimization.
Thanks to Nicholas Ham.
2020-05-05 12:32:55 +02:00
Mike Pall
99d1268823 Merge branch 'master' into v2.1 2020-04-28 17:54:03 +02:00
Mike Pall
179cf2eb84 Fix overflow check in unpack().
Thanks to HybridDog.
2020-04-28 17:52:28 +02:00
Mike Pall
f133649ced Merge branch 'master' into v2.1 2020-04-28 16:53:32 +02:00
Mike Pall
db0b7ec194 Fix Windows make clean. 2020-04-28 16:52:28 +02:00
Mike Pall
9143e86498 FFI/ARM64: Fix pass-by-value struct calling conventions. 2020-03-20 14:10:18 +01:00
Mike Pall
fc1c4da3cc Merge branch 'master' into v2.1 2020-03-20 13:38:05 +01:00
Mike Pall
e613105ca9 Fix write barrier for lua_setupvalue() and debug.setupvalue(). 2020-03-20 13:35:49 +01:00
Mike Pall
0ad60ccbc3 Make string to number conversions fail on NUL char.
Contributed by Igor Munkin.
2020-02-13 17:39:51 +01:00
Mike Pall
d85d6b3c1b Merge branch 'master' into v2.1 2020-02-02 18:20:35 +01:00
Mike Pall
522d2073da x86/x64: Fix loop realignment. 2020-02-02 18:19:44 +01:00
Mike Pall
694d69aed9 Merge branch 'master' into v2.1 2020-01-22 02:39:26 +01:00
Mike Pall
62903bacf4 Fix C file generation in jit.bcsave.
Thanks to codicodi.
2020-01-22 02:37:21 +01:00
Mike Pall
87b111f0fe Merge branch 'master' into v2.1 2020-01-20 23:34:21 +01:00
Mike Pall
38a5ed4b43 Bump copyright date. 2020-01-20 23:26:51 +01:00
Mike Pall
981ec8d2aa Remove support for de-facto dead archs. 2020-01-20 22:56:47 +01:00
Mike Pall
54484e257f Minor fixes. 2020-01-20 22:20:55 +01:00
Mike Pall
94d0b53004 MIPS: Add MIPS64 R6 port.
Contributed by Hua Zhang, YunQiang Su from Wave Computing,
and Radovan Birdic from RT-RK.
Sponsored by Wave Computing.
2020-01-20 22:15:45 +01:00
Mike Pall
dfa692b746 Fix string.char() recording with no arguments. 2020-01-14 11:08:42 +01:00
Mike Pall
e49863eda1 Followup fix for embedded bytecode loader. 2020-01-14 11:07:07 +01:00
Mike Pall
1357a25f81 Merge branch 'master' into v2.1 2020-01-13 14:50:30 +01:00
Mike Pall
8203399601 Fix embedded bytecode loader. 2020-01-13 14:28:43 +01:00
Mike Pall
0bee44c9dc Properly fix pointer diff in string.find().
Thanks to Vyacheslav Egorov.
2019-12-21 13:52:47 +01:00
Mike Pall
bd00094c3b x64: Enable LJ_GC64 mode by default. 2019-12-08 21:21:30 +01:00
Mike Pall
70f4b15ee4 FFI: Eliminate hardcoded string hashes. 2019-12-08 20:53:31 +01:00
Mike Pall
92fa45f9eb Fix interaction between profiler hooks and finalizers.
Thanks to Julien Desgats.
2019-12-08 19:56:56 +01:00
Mike Pall
9600e4318e Don't use STRREF for pointer diff in string.find().
Thanks to Sergey Ostanevich and Vyacheslav Egorov.
2019-12-08 19:54:21 +01:00
Mike Pall
2a7c200dc2 Merge branch 'master' into v2.1 2019-12-08 19:52:56 +01:00
Mike Pall
45a7e5073c Fix tonumber("-0").
Reported by bluecheetah001.
2019-12-08 19:51:33 +01:00
Mike Pall
1d9a337de6 Merge branch 'master' into v2.1 2019-12-08 19:50:36 +01:00
Mike Pall
de48d00094 Fix hash table chaining (again).
Thanks to Peter Cawley.
2019-12-08 19:47:00 +01:00
Mike Pall
324aef08d9 Typo. 2019-12-08 19:45:07 +01:00
Mike Pall
41a25efc80 Fix declarations of _BitScanForward/_BitScanReverse.
Reported by Mumin Guler.
2019-12-08 19:42:49 +01:00
Mike Pall
46a1b268eb Add stricter check for print() vs. tostring() shortcut. 2019-12-08 19:40:24 +01:00
Mike Pall
16e5605eec Prevent integer overflow while parsing long strings. 2019-12-08 19:35:25 +01:00
Mike Pall
e0388e6c00 Fix stack check when recording BC_VARG.
Contributed by Yichun Zhang.
2019-12-08 19:32:27 +01:00
Mike Pall
1d1bac5a65 FFI: Add missing write barrier on C library index update.
Contributed by Yichun Zhang.
2019-12-08 19:32:16 +01:00
Mike Pall
478bcfe52a FFI: Workaround for platform dlerror() returning NULL.
Contributed by mcclure.
2019-12-08 19:25:45 +01:00
Mike Pall
05898a8824 Merge branch 'master' into v2.1 2019-12-08 19:24:47 +01:00
Mike Pall
44382e833a OSX: Use __thread attribute. 2019-12-08 19:22:37 +01:00
Mike Pall
8961a92dd1 OSX: Don't set a default MACOSX_DEPLOYMENT_TARGET. 2019-12-08 19:22:00 +01:00
Mike Pall
eba586854b Build MinGW import library, too.
Thanks to Tarnyko.
2019-12-08 19:19:12 +01:00
Mike Pall
c43b6a9137 Fix MinGW make clean.
Reported by Shmuel Zeigerman.
2019-12-08 19:16:34 +01:00
Mike Pall
6e228a9cb6 Merge branch 'master' into v2.1 2019-12-08 18:58:50 +01:00
Mike Pall
c6c6e3b416 Update MSVC build script and docs. 2019-12-08 18:52:41 +01:00
Mike Pall
3ece3a3e3a More recent MSVC is partially C99 compliant. 2019-12-08 18:43:12 +01:00
Mike Pall
e45b04f499 Merge branch 'master' into v2.1 2019-11-10 22:39:40 +01:00