summaryrefslogtreecommitdiff
path: root/src/lj_asm.c
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_asm.c
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_asm.c')
-rw-r--r--src/lj_asm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index 2e204239..9fe53416 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -888,7 +888,16 @@ static uint32_t asm_callx_flags(ASMState *as, IRIns *ir)
888 nargs++; 888 nargs++;
889 while (ira->o == IR_CARG) { nargs++; ira = IR(ira->op1); } 889 while (ira->o == IR_CARG) { nargs++; ira = IR(ira->op1); }
890 } 890 }
891 /* NYI: fastcall etc. */ 891#if LJ_HASFFI
892 if (IR(ir->op2)->o == IR_CARG) { /* Copy calling convention info. */
893 CTypeID id = (CTypeID)IR(IR(ir->op2)->op2)->i;
894 CType *ct = ctype_get(ctype_ctsG(J2G(as->J)), id);
895 nargs |= ((ct->info & CTF_VARARG) ? CCI_VARARG : 0);
896#if LJ_TARGET_X86
897 nargs |= (ctype_cconv(ct->info) << CCI_CC_SHIFT);
898#endif
899 }
900#endif
892 return (nargs | (ir->t.irt << CCI_OTSHIFT)); 901 return (nargs | (ir->t.irt << CCI_OTSHIFT));
893} 902}
894 903