diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2014-09-25 10:35:06 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2014-09-25 10:35:06 +0000 |
| commit | 14e6eec5ecdd9ca68a891dbf7173a3620f6e76c1 (patch) | |
| tree | 6a4b0dd61a023a560f0c5a9b2e4d61f4a62e982e /src/runtime/c/pgf/lightning/i386 | |
| parent | 928217f9d91b45fe48f6e176d42ee5c80d427257 (diff) | |
now a complete JIT compiler and ByteCode compiler for the def rules in the abstract syntax. there might be some bugs yet to be found, meta variables and computation under lambda is only partially supported
Diffstat (limited to 'src/runtime/c/pgf/lightning/i386')
| -rw-r--r-- | src/runtime/c/pgf/lightning/i386/core-32.h | 12 | ||||
| -rw-r--r-- | src/runtime/c/pgf/lightning/i386/core-64.h | 9 |
2 files changed, 3 insertions, 18 deletions
diff --git a/src/runtime/c/pgf/lightning/i386/core-32.h b/src/runtime/c/pgf/lightning/i386/core-32.h index 561fab5fb..9de85b86e 100644 --- a/src/runtime/c/pgf/lightning/i386/core-32.h +++ b/src/runtime/c/pgf/lightning/i386/core-32.h @@ -101,6 +101,8 @@ struct jit_local_state { #define jit_ret() jit_base_ret (_jitl.alloca_offset) #endif +#define jit_bare_ret(IM) ((IM == 0) ? RET_() : RETi(IM)) + #define jit_calli(label) (CALLm( ((unsigned long) (label))), _jit.x.pc) #define jit_callr(reg) CALLsr(reg) @@ -108,16 +110,6 @@ struct jit_local_state { #define jit_finish(sub) (_jitl.finish_ref = jit_calli((sub)), ADDLir(sizeof(long) * _jitl.argssize, JIT_SP), _jitl.argssize = 0, _jitl.finish_ref) #define jit_finishr(reg) (jit_callr((reg)), ADDLir(sizeof(long) * _jitl.argssize, JIT_SP), _jitl.argssize = 0) -#ifdef __APPLE__ -#define jit_tail_finishr(reg) jit_base_tail_finishr(-12, reg) -#else -#define jit_tail_finishr(reg) jit_base_tail_finishr(_jitl.alloca_offset, reg) -#endif - -#define jit_base_tail_finishr(ofs, reg) \ - (((ofs) < 0 ? LEAVE_() : POPLr(_EBP)), \ - POPLr(_EDI), POPLr(_ESI), POPLr(_EBX), jit_jmpr(reg)) - #define jit_arg_c() ((_jitl.framesize += sizeof(int)) - sizeof(int)) #define jit_arg_uc() ((_jitl.framesize += sizeof(int)) - sizeof(int)) #define jit_arg_s() ((_jitl.framesize += sizeof(int)) - sizeof(int)) diff --git a/src/runtime/c/pgf/lightning/i386/core-64.h b/src/runtime/c/pgf/lightning/i386/core-64.h index 70b4d6069..bd53d9744 100644 --- a/src/runtime/c/pgf/lightning/i386/core-64.h +++ b/src/runtime/c/pgf/lightning/i386/core-64.h @@ -190,14 +190,6 @@ struct jit_local_state { ? (ADDQir(sizeof(long) * _jitl.argssize, JIT_SP), _jitl.argssize = 0) \ : 0)) -#ifdef __APPLE__ -#define jit_tail_finishr(reg) jit_base_tail_finishr(-12, reg) -#else -#define jit_tail_finishr(reg) jit_base_tail_finishr(_jitl.alloca_offset, reg) -#endif - -#define jit_base_tail_finishr(ofs, reg) - #define jit_retval_l(rd) ((void)jit_movr_l ((rd), _EAX)) #define jit_arg_i() (_jitl.nextarg_geti < JIT_ARG_MAX \ ? _jitl.nextarg_geti++ \ @@ -273,6 +265,7 @@ static int jit_arg_reg_order[] = { _EDI, _ESI, _EDX, _ECX, _R8D, _R9D }; #define jit_patch_at(jump_pc,v) (_jitl.long_jumps ? jit_patch_long_at((jump_pc)-3, v) : jit_patch_short_at(jump_pc, v)) #define jit_patch_calli(pa,pv) (*_PSL((pa) - sizeof(long)) = _jit_SL((pv))) #define jit_ret() (LEAVE_(), POPQr(_R14), POPQr(_R13), POPQr(_R12), POPQr(_EBX), RET_()) +#define jit_bare_ret(IM) ((IM == 0) ? RET_() : RETi(IM)) /* Memory */ |
