Commit Graph

49 Commits

Author SHA1 Message Date
Mike Pall
a30f58b54b DUALNUM: Fix x87 code for BC_ISEQN/BC_ISNEN. 2011-03-07 20:12:39 +01:00
Mike Pall
cead25f928 DUALNUM: Handle integer type in x86/x64 interpreter and libraries. 2011-02-27 01:36:59 +01:00
Mike Pall
d437086c5a x64: Improve accuracy of x^-k. 2011-02-25 11:47:34 +01:00
Mike Pall
1505d6ffde Fix OSX build to work with newer ld64 versions. 2011-02-02 02:31:59 +01:00
Mike Pall
0ec7f5ed92 FFI: Add 64 bit integer comparisons and pointer comparisons. 2011-01-13 02:35:29 +01:00
Mike Pall
87a6c8a980 FFI: Auto-detect __stdcall and fix up C function declarations. 2011-01-10 20:50:34 +01:00
Mike Pall
06f99fc3df Bump copyright date to 2011. 2011-01-09 17:12:53 +01:00
Mike Pall
aca1e5b3e6 Fix Windows/x86 build and update pregenerated files. 2011-01-06 23:37:04 +01:00
Mike Pall
461bf77331 FFI: Parse complex and 64 bit integer literals. 2010-12-24 01:31:39 +01:00
Mike Pall
57cd5026eb Disable Lua 5.2 features by default. See -DLUAJIT_ENABLE_LUA52COMPAT. 2010-11-19 17:00:11 +01:00
Mike Pall
ba602c9578 Add support for __pairs and __ipairs metamethods (from Lua 5.2). 2010-11-18 00:23:24 +01:00
Mike Pall
ac76493df1 Specialize bytecode for pairs()/next() iterator. Speedup: 3.5x.
Parser predict pairs/next and emits specialized bytecode.
Bytecode is descpecialized at runtime if the prediction was wrong.
Store slot index in hidden control var to avoid key lookups.
2010-09-30 21:55:32 +02:00
Mike Pall
fce05fd6e1 x64: Use 64 bit slot copies in the interpreter. 2010-09-30 17:47:32 +02:00
Mike Pall
d351c2ae36 x86/x64: Fix stack overflow handling for coroutine results. 2010-09-22 22:59:41 +02:00
Mike Pall
bc146ddbe7 Consistently round int args of string functions on x64. 2010-09-21 18:04:59 +02:00
Mike Pall
3d17f71968 x86/x64: Avoid unnecessary resize in BC_TSETM. 2010-09-13 22:30:23 +02:00
Mike Pall
6fd315581c Optimize BC_VARG: use RC for numparams. 2010-09-10 11:34:29 +02:00
Mike Pall
96957a4551 Turn some lua_State fields into 32 bit pointers.
lua_State now fits into one cache line on x64.
2010-09-09 12:28:17 +02:00
Mike Pall
f708d31bcc Explicitly indicate tailcall from fast function fallback. 2010-09-02 17:16:56 +02:00
Mike Pall
e1efd0d871 Minor tweaks to integration of assembler part.
Remove unneeded PC restore in vm_growstack_*.
Don't declare symbols that are unused in interpreter-only builds.
Don't embed lj_vm_foldfpm in interpreter-only builds.
Add 2nd temporary TValue in lua_State.
2010-08-29 20:04:40 +02:00
Mike Pall
be19218a6c Fix return from pcall within active hook. 2010-08-07 20:26:00 +02:00
Mike Pall
3d81368331 Fix lua_cpcall(). Duplicate save corrupted C frame chain. 2010-08-06 14:34:54 +02:00
Mike Pall
33ef1fa524 Untangle some target dependencies. 2010-08-03 22:09:12 +02:00
Mike Pall
2ca58aa67d Fix arg check for two-arg SSE math functions in interpreter. 2010-07-14 14:11:48 +02:00
Mike Pall
9f6707ddbb Fix frame setup for error handling in next(). 2010-06-28 18:07:34 +02:00
Mike Pall
fa673eb179 Fix string.char() range check on x64. 2010-05-30 12:29:55 +02:00
Mike Pall
2ccb24f894 Fix TNEW in x64 interpreter. Do not force a full GC (ouch). 2010-04-25 19:33:39 +02:00
Mike Pall
ef0904e80b Make metamethod names proper GC roots. 2010-04-25 18:35:47 +02:00
Mike Pall
721b73fecb Turn traces into true GC objects (GCtrace). 2010-04-25 03:32:29 +02:00
Mike Pall
932cda0fe3 Replace on-trace GC frame syncing with interpreter exit.
Need to sync GC objects to stack only during atomic GC phase.
Need to setup a proper frame structure only for calling finalizers.
Force an exit to the interpreter and let it handle the uncommon cases.
Finally solves the "NYI: gcstep sync with frames" issue.
2010-04-19 00:43:35 +02:00
Mike Pall
ff82df797a Refactor buildvm symbol generation.
Fixes Windows and OSX builds with LUAJIT_DISABLE_JIT.
2010-04-14 17:13:13 +02:00
Mike Pall
fbe092c22d Fix setup of RD when dispatching to function headers after exit. 2010-04-09 14:26:18 +02:00
Mike Pall
6038866f7d Pass MULTRES or negated error code in RD to lj_vm_exit_interp.
Fixes overwrite of saved r12 after trace exit.
2010-03-23 18:31:17 +01:00
Mike Pall
1fea5cb822 Fix TSETM on x64/SSE builds when table is resized. 2010-03-15 19:00:16 +01:00
Mike Pall
b4299256cd Fix unwind info for assembler part for OSX. 2010-03-07 14:29:04 +01:00
Mike Pall
5594a0c653 Fix generated 64 bit Mach-O assembler output. 2010-03-05 03:21:52 +01:00
Mike Pall
5d0b65519c Enable tracing of recursion.
Now compiles tail-recursion, up-recursion and down-recursion.
Benchmarks vs. Lua: fib 20x, ack 23x, binary-trees 4.7x.
2010-03-01 06:54:35 +01:00
Mike Pall
2144d55eb8 Save/restore remaining callee-save regs on trace<->interp transitions. 2010-02-27 21:40:40 +01:00
Mike Pall
13a9d7e135 Add trace exit helper for x64. Fix trace entry for x64. 2010-02-24 01:32:44 +01:00
Mike Pall
c52da1f2da Rethrow errors from trace exit handling from the right C frame. 2010-02-19 03:13:48 +01:00
Mike Pall
e1905f498a Use a different marker for hot calls. 2010-02-15 18:04:06 +01:00
Mike Pall
2a2f8ed6a1 Implement return hooks for Lua functions (zero-cost if disabled). 2010-02-14 20:48:33 +01:00
Mike Pall
8e38231f9e Implement call hooks (zero-cost if disabled). 2010-02-14 17:47:03 +01:00
Mike Pall
c93138b59e Major redesign of function call handling.
Drop call gates. Use function headers, dispatched like bytecodes.
Emit BC_FUNCF/BC_FUNCV bytecode at PC 0 for all Lua functions.
C functions and ASM fast functions get extra bytecodes.
Modify internal calling convention: new base in BASE (formerly in RA).
Can now use better C function wrapper semantics (dynamic on/off).
Prerequisite for call hooks with zero-overhead if disabled.
Prerequisite for compiling recursive calls.
Prerequisite for efficient 32/64 bit prototype guards.
2010-02-13 04:51:56 +01:00
Mike Pall
b2067236c5 Move dispatch tables out of GG_State struct. 2010-02-11 16:21:18 +01:00
Mike Pall
ab90b8fc2b Switch to pre-initialized stacks. Drop frame clearing in interpreter. 2010-02-11 01:21:40 +01:00
Mike Pall
d5a46621f9 Drop bc field in GCproto since the bytecode is colocated. 2010-02-08 20:17:34 +01:00
Mike Pall
43f1e13470 Integrate MinGW build with DWARF2 exception handling.
Only works with DWARF2-enabled GCC 4.x (not the default MinGW GCC).
Fix fastcall symbol names for COFF assembler output.
Add DWARF2 unwind info to COFF assembler output.
Use COFF assembler mode for MinGW builds.
Always enable the DWARF2 handler if compiled with GCC.
2010-01-22 01:56:49 +01:00
Mike Pall
82417ee889 Add build infrastructure for x64 interpreter.
Must be explicitly enabled with: make clean && make "CC=gcc -m64"
Only works on Linux/x64. Does not work on WIN64 or OSX/x64 (yet).
2010-01-14 12:28:16 +01:00