Commit Graph

184 Commits

Author SHA1 Message Date
Mike Pall
e9cab5a763 x86/x64 backend: keep invariants on the right rather than fusing loads. 2010-12-09 16:08:55 +01:00
Mike Pall
3c78a7f468 Avoid fusing loads if there are multiple references. 2010-12-08 03:26:53 +01:00
Mike Pall
72744dabd9 Fix IRT_NUM support for XLOAD/XSTORE. 2010-12-08 03:24:35 +01:00
Mike Pall
3ef6a53cfa FFI: Turn cdata indexing into x86/x64 [base+idx*sz+ofs] addressing. 2010-12-08 02:36:09 +01:00
Mike Pall
d4d95ee2da Fix x64 code generation for A16+REX prefixed instructions. 2010-12-08 01:57:50 +01:00
Mike Pall
e6093b129a Fix register allocation for 8 bit stores in x86 backend. 2010-12-07 01:18:10 +01:00
Mike Pall
b3c4c0810a Add IRT_NUM support to XLOAD/XSTORE. 2010-12-06 19:28:51 +01:00
Mike Pall
159f51d811 Add IR_TOI64. 2010-12-06 18:21:51 +01:00
Mike Pall
a5bdae8f23 Fix 64 bit shifts in backend. Fix shift by 0. 2010-12-06 13:16:35 +01:00
Mike Pall
5270586a80 Fix XLOAD/XSTORE references. 2010-12-06 13:15:53 +01:00
Mike Pall
86fd2289f0 Add support for integer IR_MUL. 2010-12-06 12:54:00 +01:00
Mike Pall
b56b83487f Support all kinds of XLOAD/XSTORE references in backend.
Fuse pointer arithmetic, too.
2010-12-06 03:10:28 +01:00
Mike Pall
4755765e32 Avoid warning. 2010-12-06 01:59:07 +01:00
Mike Pall
db3d16bfd7 Add IR_XSTORE. 2010-12-06 01:48:19 +01:00
Mike Pall
588fa0481f Add support for 64 bit integer arithmetic to x64 backend. 2010-12-06 00:07:36 +01:00
Mike Pall
c5f4f607c9 Fix xmm spill/restore broken by b1fb71fb. 2010-12-05 22:39:36 +01:00
Mike Pall
5a13fa69d9 Add IR_KINT64. 2010-12-05 22:12:31 +01:00
Mike Pall
b1fb71fb98 Cleanup 64 bit IR type handling. 2010-12-05 21:01:08 +01:00
Mike Pall
26830d070d Make sure to use irt_toitype() macro everywhere. 2010-12-05 18:51:37 +01:00
Mike Pall
24baf77955 Cleanup architecture, ABI and OS definitions. 2010-11-16 15:03:40 +01:00
Mike Pall
fe21a42a92 Fix conflict between loop branch inversion and HREF+NE/EQ merging. 2010-11-05 23:12:43 +01:00
Mike Pall
b3cf2c70f4 Decouple SLOAD type and optional conversion. 2010-10-11 21:13:37 +02:00
Mike Pall
cc62edebfd x64: Fix type check for numbers in compiled code. 2010-10-11 19:24:12 +02:00
Mike Pall
52b922c1e9 Avoid fusing potentially negative indexes into AREF on x64. 2010-09-18 18:34:38 +02:00
Mike Pall
8dc76ee327 Add IR_VLOAD for vararg loads.
Also fixes the broken AA improvement in the last commit.
2010-09-14 19:58:27 +02:00
Mike Pall
847b9cf253 Record vararg expressions with varargs defined off-trace.
Add SLOAD variant to access the frame type/size.
2010-09-13 01:17:38 +02:00
Mike Pall
33ef1fa524 Untangle some target dependencies. 2010-08-03 22:09:12 +02:00
Mike Pall
d05873ee0a Abstract out pointer hash to hashrot(). Tune hash constants. 2010-07-21 22:06:38 +02:00
Mike Pall
0d3f190d94 Fix passing of constant args in FPRs on x64. 2010-07-14 13:04:29 +02:00
Mike Pall
5ff994fa37 Add weak guards. Emit TNEW/TDUP with a guard bit. 2010-05-08 18:59:59 +02:00
Mike Pall
2e24770ed3 Simplify management of current trace. Drop lazy save. 2010-04-25 13:53:33 +02:00
Mike Pall
721b73fecb Turn traces into true GC objects (GCtrace). 2010-04-25 03:32:29 +02:00
Mike Pall
d8cb69ed07 Simplify GC step calls from on-trace code. 2010-04-19 23:41:48 +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
fbe092c22d Fix setup of RD when dispatching to function headers after exit. 2010-04-09 14:26:18 +02:00
Mike Pall
1130ade4de Also merge EQ(HREF, niltv) in backend. 2010-03-28 06:47:04 +02:00
Mike Pall
44756ded7a Only fuse with spill slots for cross-section references. 2010-03-28 06:42:48 +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
097db7317b Move colocated array part after GCtab (now properly aligned). 2010-03-22 15:59:50 +01:00
Mike Pall
5c8f1f2594 Increase max. fusion distance. 2010-03-19 00:28:04 +01:00
Mike Pall
37a3ca330f Reorder various structs to reduce padding (thanks to /usr/bin/pahole). 2010-03-15 23:29:10 +01:00
Mike Pall
c4727220e8 Add array bounds check elimination (-Oabc, on by default). 2010-03-15 17:02:53 +01:00
Mike Pall
16f33422f1 Restore MULTRES for snapshots pointing to CALLM etc. bytecodes. 2010-03-13 17:45:09 +01:00
Mike Pall
2e614adb21 Do not fuse SLOAD across RETF. 2010-03-08 23:43:16 +01:00
Mike Pall
e807d46931 Generate indirect calls for out-of-range distances on x64. 2010-03-07 14:31:51 +01:00
Mike Pall
15c3bd7725 Improve performance of HREF/HREFK on x64. 2010-03-03 04:26:31 +01:00
Mike Pall
32309583e5 Improve register allocation on x64. 2010-03-02 23:34:13 +01:00
Mike Pall
e7b737aa12 Implement down-recursion. 2010-03-01 06:45:30 +01:00
Mike Pall
3c6cec0846 Add x64 call argument setup. More 32/64 bit cleanups in assembler. 2010-02-25 03:35:07 +01:00
Mike Pall
4e73488985 Fix 64 bit conversion warnings. 2010-02-24 20:02:20 +01:00
Mike Pall
4c9f71be5d Major 32/64 bit cleanups in assembler and exit handling.
Add 64 bit lightuserdata handling. Keep the tagged 64 bit value.
Allocate/save/restore 64 bit spill slots for 64 bit lightuserdata.
Fix code generation for 64 bit loads/stores/moves/compares.
Fix code generation for stack pointer adjustments.
Add fixed spill slot definitions for x64. Reduce reserved spill slots.
Disable STRREF + ADD fusion in 64 bit mode (avoid negative 32 bit ofs).
2010-02-24 07:09:34 +01:00
Mike Pall
2f3a917f2f Check relative jump distances for x64. 2010-02-24 01:29:11 +01:00
Mike Pall
d5c8fe4b90 Mark renamed registers as modified. 2010-02-23 17:22:12 +01:00
Mike Pall
c1362dcac9 Don't eliminate SLOAD restores across RETF.
Move restore-elimination logic into snapshot_slots().
2010-02-23 03:08:49 +01:00
Mike Pall
f751cd1d6f Do not patch parent exit for a stack check. 2010-02-22 21:21:52 +01:00
Mike Pall
e76bcd2914 Refactor Lua stack handling in lj_asm.c. 2010-02-21 17:26:21 +01:00
Mike Pall
c1658ddcf1 Eliminate redundant stack checks. Add checks for growing root traces. 2010-02-21 16:47:43 +01:00
Mike Pall
2b22b9e710 Drop obsolete shadow frame link stack. 2010-02-18 03:19:46 +01:00
Mike Pall
b6e4fde0dc Improve FOR loop const specialization and integerness checks. 2010-02-15 01:07:30 +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
565eb39574 Drop frame clearing in exit handling and JIT compiled code. 2010-02-11 01:50:32 +01:00
Mike Pall
7256690364 Add shadow frame link stack for trace recorder.
Simplifies snapshots. Prerequisite for pre-call snapshots.
Increases consistency for fast function calls, too.
2010-02-04 03:08:29 +01:00
Mike Pall
61c5a60dc3 Improve coalescing of BASE register in side traces. 2010-02-01 23:32:26 +01:00
Mike Pall
9a682f341d Revise hardcoded inlining in lj_asm.c. Saves 1-2K. 2010-01-30 14:33:08 +01:00
Mike Pall
02e58f5e56 Add support for weak IR references to register allocator.
Spilling a weak ref forces a spill slot, but omits the restore.
Spill slots for snapshot refs override the register, anyway.
Marking snapshot refs weak avoids pointless restores.
2010-01-30 06:50:39 +01:00
Mike Pall
8681b7330f Compile return to lower frame. Only for Lua frames right now. 2010-01-29 03:32:37 +01:00
Mike Pall
21d6709271 Avoid reuse of PHI registers, even for duplicate right PHIs. 2010-01-27 22:09:43 +01:00
Mike Pall
3aeb892262 Eliminate IR_FRAME. Replace with KGC and TRef/SnapEntry flags. 2010-01-27 03:50:29 +01:00
Mike Pall
d216cdb2b9 Add frame and continuation flags to TRef and SnapEntry. 2010-01-27 02:17:56 +01:00
Mike Pall
67ca399a30 Compress snapshots using a simple, extensible 1D-compression.
Typically reduces storage overhead for snapshot maps by 60%.
The extensible format is a prerequisite for the next redesign steps:
Eliminate IR_FRAME and implement return-to-lower-frame.
2010-01-26 21:49:04 +01:00
Mike Pall
e058714a2e Add missing eviction in asm_obar(). 2010-01-26 02:56:00 +01:00
Mike Pall
34d84f8836 Fill gaps in frames (caused by metamethod calls) with nil.
Simplifies storing snapshots to stack.
2010-01-26 00:45:30 +01:00
Mike Pall
47f1bc80d8 Use dedicated type for snapshot map entry.
Preparatory work for compressed snapshots.
2010-01-25 19:51:52 +01:00
Mike Pall
a61df8efbe Decouple guard vs. INT check vs. TYPECHECK semantics for SLOAD. 2010-01-19 16:58:26 +01:00
Mike Pall
36769c2f6b Fix broken intarith + testop optimization. 2010-01-19 01:45:39 +01:00
Mike Pall
99d153bef9 Improve alias analysis of upvalues using a disambiguation hash value.
All upvalue objects hold a disambiguation hash value now.
It's built from the parent prototype and the slot number.
Different hash values imply the upvalues cannot alias.
Same hash values don't imply anything (collision or different closures).
Upvalue disambiguation makes use of a reduced hash due to IR contraints.
2010-01-09 23:59:43 +01:00
Mike Pall
a33204ae5e Fix 32/64 bit portability issue with upval->v. 2010-01-09 21:11:35 +01:00
Mike Pall
4d9be5b8f8 Bump all copyright dates to 2010. 2010-01-09 14:28:11 +01:00
Mike Pall
690760aa38 Add SSE variant of pow/powi to interpreter.
Use SSE pow/powi helper functions from compiled code.
Cleanup use of helper functions.
Related cleanups of folding functions in x64 interpreter.
2009-12-25 23:12:30 +01:00
Mike Pall
44a9d7b00c Use SSE variants for IRFPM_FLOOR/CEIL/TRUNC unless SSE4.1 available. 2009-12-22 05:40:49 +01:00
Mike Pall
3f1f9e11f4 Fast forward to sync public repo.
Compile math.sinh(), math.cosh(), math.tanh() and math.random().
Compile various io.*() functions.
Drive the GC forward on string allocations in the parser.
Improve KNUM fuse vs. load heuristics.
Add abstract C call handling to IR.
2009-12-08 20:35:29 +01:00
Mike Pall
1d1fed48a0 RELEASE LuaJIT-2.0.0-beta2 2009-12-08 19:49:20 +01:00
Mike Pall
55b1695971 RELEASE LuaJIT-2.0.0-beta1 2009-12-08 19:46:35 +01:00