aboutsummaryrefslogtreecommitdiff
path: root/src/lj_ircall.h
diff options
context:
space:
mode:
authorMike Pall <mike>2011-10-27 01:52:37 +0200
committerMike Pall <mike>2011-10-27 01:57:30 +0200
commit2dc574d06bc6e828109a3bffa975592f9417434c (patch)
tree1239baece908e2390eb378e6d7d8063825926f9b /src/lj_ircall.h
parent1d190c99a2547b44deb8f5e483452d9f51925fb2 (diff)
downloadluajit-2dc574d06bc6e828109a3bffa975592f9417434c.tar.gz
luajit-2dc574d06bc6e828109a3bffa975592f9417434c.tar.bz2
luajit-2dc574d06bc6e828109a3bffa975592f9417434c.zip
FFI: Compile calls to stdcall, fastcall and vararg functions.
Diffstat (limited to 'src/lj_ircall.h')
-rw-r--r--src/lj_ircall.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lj_ircall.h b/src/lj_ircall.h
index b1e0e446..8ccc852e 100644
--- a/src/lj_ircall.h
+++ b/src/lj_ircall.h
@@ -27,15 +27,23 @@ typedef struct CCallInfo {
27#define CCI_CALL_N (IR_CALLN << CCI_OPSHIFT) 27#define CCI_CALL_N (IR_CALLN << CCI_OPSHIFT)
28#define CCI_CALL_L (IR_CALLL << CCI_OPSHIFT) 28#define CCI_CALL_L (IR_CALLL << CCI_OPSHIFT)
29#define CCI_CALL_S (IR_CALLS << CCI_OPSHIFT) 29#define CCI_CALL_S (IR_CALLS << CCI_OPSHIFT)
30#define CCI_CALL_FN (CCI_CALL_N|CCI_FASTCALL) 30#define CCI_CALL_FN (CCI_CALL_N|CCI_CC_FASTCALL)
31#define CCI_CALL_FL (CCI_CALL_L|CCI_FASTCALL) 31#define CCI_CALL_FL (CCI_CALL_L|CCI_CC_FASTCALL)
32#define CCI_CALL_FS (CCI_CALL_S|CCI_FASTCALL) 32#define CCI_CALL_FS (CCI_CALL_S|CCI_CC_FASTCALL)
33 33
34/* C call info flags. */ 34/* C call info flags. */
35#define CCI_L 0x0100 /* Implicit L arg. */ 35#define CCI_L 0x0100 /* Implicit L arg. */
36#define CCI_CASTU64 0x0200 /* Cast u64 result to number. */ 36#define CCI_CASTU64 0x0200 /* Cast u64 result to number. */
37#define CCI_NOFPRCLOBBER 0x0400 /* Does not clobber any FPRs. */ 37#define CCI_NOFPRCLOBBER 0x0400 /* Does not clobber any FPRs. */
38#define CCI_FASTCALL 0x0800 /* Fastcall convention. */ 38#define CCI_VARARG 0x0800 /* Vararg function. */
39
40#define CCI_CC_MASK 0x3000 /* Calling convention mask. */
41#define CCI_CC_SHIFT 12
42/* ORDER CC */
43#define CCI_CC_CDECL 0x0000 /* Default cdecl calling convention. */
44#define CCI_CC_THISCALL 0x1000 /* Thiscall calling convention. */
45#define CCI_CC_FASTCALL 0x2000 /* Fastcall calling convention. */
46#define CCI_CC_STDCALL 0x3000 /* Stdcall calling convention. */
39 47
40/* Helpers for conditional function definitions. */ 48/* Helpers for conditional function definitions. */
41#define IRCALLCOND_ANY(x) x 49#define IRCALLCOND_ANY(x) x