Commit Graph

116 Commits

Author SHA1 Message Date
Mike Pall
304da39cc5 FFI: Add missing coercion when recording 64-bit bit.*().
Thanks to Peter Cawley. #1252
2024-08-20 19:13:59 +02:00
Mike Pall
04dca7911e Call math.randomseed() without arguments to seed from system entropy.
Reminder: the math.random() PRNG is NOT SUITABLE FOR CRYPTOGRAPHIC USE.
2024-07-04 01:26:29 +02:00
Mike Pall
41fb94defa Add randomized register allocation for fuzz testing.
This must be explicitly enabled with: -DLUAJIT_RANDOM_RA
Thanks to Peter Cawley. #1062
2023-08-30 01:10:52 +02:00
Mike Pall
1c27912705 Print errors from __gc finalizers instead of rethrowing them.
Finalizers are not supposed to throw errors -- this is undefined behavior.
Lua 5.1 - 5.3 and (previously) LuaJIT rethrow the error. This randomly
breaks some unrelated code that just happens to do an allocation. Bad.
Lua 5.4 catches the error and emits a warning instead. But warnings are
not enabled by default, so it fails silently. Even worse.
LuaJIT (now) catches the error and emits a VM event. The default event
handler function prints "ERROR in finalizer: ...".
Set a custom handler function with: jit.attach(handler, "errfin")
2023-04-16 18:13:48 +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
7d267973e2 Fix dependencies. 2021-06-03 10:07:00 +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
4c6b669c41 String buffers, part 1: object serialization.
Sponsored by fmad.io.
2021-03-25 02:21:31 +01: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
8ae5170cdc Improve assertions. 2020-06-15 02:52:00 +02:00
Mike Pall
c198167690 Add some more extensions from Lua 5.2/5.3.
Contributed by François Perrad.
2017-01-17 11:37:28 +01:00
Mike Pall
384ce2f9ef MIPS: Fix build failures and warnings. 2016-05-29 18:12:58 +02:00
Mike Pall
786dbb2ebd Add IR_FLOAD with REF_NIL for field loads from GG_State.
Contributed by Peter Cawley.
2016-05-21 01:00:49 +02:00
Mike Pall
573daa9c97 Fix dependencies. 2016-05-19 15:09:08 +02:00
Mike Pall
18f6aa97fd Use internal implementation for converting FP numbers to strings.
Contributed by Peter Cawley.
2016-02-26 18:03:08 +01:00
Mike Pall
881f48f980 Cleanup of frame handling. No functional changes. 2014-12-15 02:27:27 +01:00
Mike Pall
89f61de517 Merge branch 'master' into v2.1 2014-06-12 11:02:44 +02:00
Mike Pall
5e7b9bb8ed FFI: Fix frame traversal for backtraces with FFI callbacks. 2014-06-12 10:58:22 +02:00
Mike Pall
4593fb5e29 Add table.clear(). 2013-11-25 15:19:17 +01:00
Mike Pall
d8f05356ca Merge branch 'master' into v2.1 2013-10-24 15:21:44 +02:00
Mike Pall
7e538b5f0a Check for failure to mark memory as executable (restricted kernels). 2013-10-24 15:19:03 +02:00
Mike Pall
c8cfca0557 Add table.new(). 2013-10-09 17:02:01 +02:00
Mike Pall
a51b8bf6b4 Fix build with profiler but without JIT compiler. 2013-09-18 15:17:39 +02:00
Mike Pall
b30a789ab8 Protect g->hookmask with lock when using profiler thread. 2013-09-16 11:23:10 +02:00
Mike Pall
803d4ddf0c Fix non-FFI build. 2013-09-10 00:47:28 +02:00
Mike Pall
d1194a82eb Low-overhead profiler, part 4: JIT compiler support. 2013-09-08 02:53:23 +02:00
Mike Pall
4dce22c40d Add low-overhead profiler. Part 1: interpreter, low-level C API. 2013-09-02 01:49:19 +02:00
Mike Pall
fd616caf26 Compile bit.tohex(). 2013-05-15 13:57:35 +02:00
Mike Pall
09ef8d1077 FFI: Load FFI library on-demand for -jdump. 2013-05-13 21:07:14 +02:00
Mike Pall
8f90a1279e Big renaming of string buffer/formatting/conversion functions. 2013-05-13 10:15:07 +02:00
Mike Pall
625ffca739 Refactor raw object to pointer or string conversions. 2013-05-13 01:23:33 +02:00
Mike Pall
19a9206caf Refactor internal string formatting. 2013-05-12 23:52:09 +02:00
Mike Pall
7d5acc2918 Refactor bit.tohex(). 2013-05-12 23:14:12 +02:00
Mike Pall
5bb1f0edac Refactor string.format(). 2013-05-12 23:13:27 +02:00
Mike Pall
64d2883ab4 Refactor table.concat(). 2013-04-27 15:51:50 +02:00
Mike Pall
b6adfff8f4 Compile string.reverse(), string.lower(), string.upper(). 2013-04-26 00:32:08 +02:00
Mike Pall
61cb25b0ca Refactor string.reverse(), string.lower(), string.upper(). 2013-04-26 00:31:10 +02:00
Mike Pall
5f1781a127 Compile string concatenations (BC_CAT). 2013-04-21 01:01:33 +02:00
Mike Pall
d38d10a3dd Use string buffer for os.date(). 2013-03-20 16:54:30 +01:00
Mike Pall
deb61e0be0 Use string buffer for table.concat(). 2013-03-20 16:51:36 +01:00
Mike Pall
a98aede377 FFI: Add 64 bit bitwise operations. 2013-03-14 06:03:18 +01:00
Mike Pall
116cdd7e9a String buffer refactoring, part 2.
Switch to pointers for start/pos/end of buffer.
Abstract out some buffer writers.
2013-02-27 21:28:28 +01:00
Mike Pall
28cfcf7744 String buffer refactoring, part 1.
Move string buffer handling to lj_buf.*.
Use common buffer resizing function.
2013-02-27 17:29:35 +01:00
Mike Pall
73ef845fca Add special bytecodes for builtins.
BC_ISTYPE, BC_ISNUM: fast type checks/coercions.
BC_TGETR, BC_TSETR: fast rawgeti/rawseti, no type checks for table/key.
2013-02-23 02:09:19 +01:00
Mike Pall
e20157c6e6 Add support for embedding LuaJIT bytecode for builtins. 2013-02-22 01:40:41 +01:00
Mike Pall
2c293a96de FFI: Load FFI library on-demand for bytecode with cdata literals. 2013-01-15 01:16:37 +01:00
Mike Pall
fff12979fe From Lua 5.2: Add format options to io.lines(). 2012-10-12 14:11:41 +02:00
Mike Pall
1c626112a0 FFI: Compile ffi.sizeof(), ffi.alignof() and ffi.offsetof(). 2012-10-10 18:16:18 +02:00
Mike Pall
faf05c3a13 From Lua 5.2: '%s' option to string.format() behaves like tostring(). 2012-10-02 11:59:32 +02:00