]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Move IR_CALL* definitions to lj_ircall.h.
authorMike Pall <mike>
Sun, 22 May 2011 14:19:53 +0000 (16:19 +0200)
committerMike Pall <mike>
Sun, 22 May 2011 14:28:43 +0000 (16:28 +0200)
12 files changed:
src/Makefile.dep
src/buildvm.c
src/lib_jit.c
src/lj_asm.c
src/lj_crecord.c
src/lj_ffrecord.c
src/lj_ir.c
src/lj_ir.h
src/lj_ircall.h [new file with mode: 0644]
src/lj_iropt.h
src/lj_opt_split.c
src/lj_record.c

index 5d1238f63a6a0141309efd460a36c660bcec61d2..89ac79e8c52cd4c83a91c6bd1adc7e9991625d45 100644 (file)
@@ -1,6 +1,6 @@
 buildvm.o: buildvm.c buildvm.h lj_def.h lua.h luaconf.h lj_arch.h \
- lj_obj.h lj_gc.h lj_bc.h lj_ir.h lj_frame.h lj_dispatch.h lj_jit.h \
- lj_ccall.h luajit.h \
+ lj_obj.h lj_gc.h lj_bc.h lj_ir.h lj_ircall.h lj_jit.h lj_frame.h \
+ lj_dispatch.h lj_ccall.h luajit.h \
  lj_traceerr.h
 buildvm_asm.o: buildvm_asm.c buildvm.h lj_def.h lua.h luaconf.h lj_arch.h \
  lj_bc.h
@@ -31,8 +31,8 @@ lib_io.o: lib_io.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \
  lj_libdef.h
 lib_jit.o: lib_jit.c lua.h luaconf.h lauxlib.h lualib.h lj_arch.h \
  lj_obj.h lj_def.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_bc.h lj_ir.h \
- lj_jit.h lj_iropt.h lj_target.h lj_target_*.h lj_dispatch.h lj_vm.h \
- lj_vmevent.h lj_lib.h luajit.h lj_libdef.h
+ lj_jit.h lj_ircall.h lj_iropt.h lj_target.h lj_target_*.h \
+ lj_dispatch.h lj_vm.h lj_vmevent.h lj_lib.h luajit.h lj_libdef.h
 lib_math.o: lib_math.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \
  lj_def.h lj_arch.h lj_lib.h lj_libdef.h
 lib_os.o: lib_os.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \
@@ -52,8 +52,9 @@ lj_api.o: lj_api.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \
  lj_traceerr.h lj_vm.h lj_lex.h lj_parse.h
 lj_asm.o: lj_asm.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \
  lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ctype.h lj_ir.h lj_jit.h \
- lj_iropt.h lj_mcode.h lj_trace.h lj_dispatch.h lj_traceerr.h lj_snap.h \
- lj_asm.h lj_vm.h lj_target.h lj_target_*.h lj_emit_*.h lj_asm_*.h
+ lj_ircall.h lj_iropt.h lj_mcode.h lj_trace.h lj_dispatch.h lj_traceerr.h \
+ lj_snap.h lj_asm.h lj_vm.h lj_target.h lj_target_*.h lj_emit_*.h \
+ lj_asm_*.h
 lj_bc.o: lj_bc.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_bc.h \
  lj_bcdef.h
 lj_carith.o: lj_carith.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
@@ -77,9 +78,9 @@ lj_cparse.o: lj_cparse.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
  lj_bc.h lj_vm.h lj_char.h
 lj_crecord.o: lj_crecord.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
  lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ctype.h \
- lj_gc.h lj_cparse.h lj_cconv.h lj_clib.h lj_ir.h lj_jit.h lj_iropt.h \
- lj_trace.h lj_dispatch.h lj_traceerr.h lj_record.h lj_ffrecord.h \
- lj_crecord.h
+ lj_gc.h lj_cparse.h lj_cconv.h lj_clib.h lj_ir.h lj_jit.h lj_ircall.h \
+ lj_iropt.h lj_trace.h lj_dispatch.h lj_traceerr.h lj_record.h \
+ lj_ffrecord.h lj_crecord.h
 lj_ctype.o: lj_ctype.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
  lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h
 lj_dispatch.o: lj_dispatch.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
@@ -91,8 +92,9 @@ lj_err.o: lj_err.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_err.h \
  lj_traceerr.h lj_vm.h
 lj_ffrecord.o: lj_ffrecord.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
  lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ff.h \
- lj_ffdef.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h lj_dispatch.h \
- lj_traceerr.h lj_record.h lj_ffrecord.h lj_crecord.h lj_vm.h lj_recdef.h
+ lj_ffdef.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \
+ lj_dispatch.h lj_traceerr.h lj_record.h lj_ffrecord.h lj_crecord.h \
+ lj_vm.h lj_recdef.h
 lj_func.o: lj_func.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \
  lj_func.h lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_bc.h \
  lj_traceerr.h lj_vm.h
@@ -104,8 +106,9 @@ lj_gdbjit.o: lj_gdbjit.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
  lj_gc.h lj_err.h lj_errmsg.h lj_frame.h lj_bc.h lj_jit.h lj_ir.h \
  lj_dispatch.h
 lj_ir.o: lj_ir.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \
- lj_str.h lj_tab.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h lj_dispatch.h \
- lj_bc.h lj_traceerr.h lj_ctype.h lj_cdata.h lj_carith.h lj_lib.h
+ lj_str.h lj_tab.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \
+ lj_dispatch.h lj_bc.h lj_traceerr.h lj_ctype.h lj_cdata.h lj_carith.h \
+ lj_lib.h
 lj_lex.o: lj_lex.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \
  lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_cdata.h lualib.h \
  lj_state.h lj_lex.h lj_parse.h lj_char.h
@@ -133,15 +136,15 @@ lj_opt_narrow.o: lj_opt_narrow.c lj_obj.h lua.h luaconf.h lj_def.h \
  lj_arch.h lj_str.h lj_bc.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h \
  lj_dispatch.h lj_traceerr.h lj_vm.h
 lj_opt_split.o: lj_opt_split.c lj_obj.h lua.h luaconf.h lj_def.h \
- lj_arch.h lj_err.h lj_errmsg.h lj_str.h lj_ir.h lj_jit.h lj_iropt.h \
- lj_vm.h
+ lj_arch.h lj_err.h lj_errmsg.h lj_str.h lj_ir.h lj_jit.h lj_ircall.h \
+ lj_iropt.h lj_vm.h
 lj_parse.o: lj_parse.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
  lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h lj_state.h \
  lj_bc.h lj_ctype.h lj_lex.h lj_parse.h lj_vm.h lj_vmevent.h
 lj_record.o: lj_record.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
  lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_meta.h lj_frame.h lj_bc.h \
- lj_ff.h lj_ffdef.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h lj_dispatch.h \
- lj_traceerr.h lj_record.h lj_ffrecord.h lj_snap.h lj_vm.h
+ lj_ff.h lj_ffdef.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \
+ lj_dispatch.h lj_traceerr.h lj_record.h lj_ffrecord.h lj_snap.h lj_vm.h
 lj_snap.o: lj_snap.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \
  lj_state.h lj_frame.h lj_bc.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h \
  lj_dispatch.h lj_traceerr.h lj_snap.h lj_target.h lj_target_*.h
@@ -172,13 +175,13 @@ ljamalg.o: ljamalg.c lua.h luaconf.h lauxlib.h lj_gc.c lj_obj.h lj_def.h \
  lj_alloc.h lj_dispatch.c luajit.h lj_vmevent.c lj_vmevent.h lj_api.c \
  lj_parse.h lj_lex.c lualib.h lj_parse.c lj_ctype.c lj_cdata.c lj_cconv.h \
  lj_cconv.c lj_ccall.c lj_ccall.h lj_carith.c lj_carith.h lj_clib.c \
- lj_clib.h lj_cparse.c lj_cparse.h lj_lib.c lj_lib.h lj_ir.c lj_iropt.h \
- lj_opt_mem.c lj_opt_fold.c lj_folddef.h lj_opt_narrow.c lj_opt_dce.c \
- lj_opt_loop.c lj_snap.h lj_opt_split.c lj_mcode.c lj_mcode.h lj_snap.c \
- lj_target.h lj_target_*.h lj_record.c lj_record.h lj_ffrecord.h \
- lj_crecord.c lj_crecord.h lj_ffrecord.c lj_recdef.h lj_asm.c lj_asm.h \
- lj_emit_*.h lj_asm_*.h lj_trace.c lj_gdbjit.h lj_gdbjit.c lj_alloc.c \
- lib_aux.c lib_base.c lj_libdef.h lib_math.c lib_string.c lib_table.c \
- lib_io.c lib_os.c lib_package.c lib_debug.c lib_bit.c lib_jit.c \
- lib_ffi.c lib_init.c
+ lj_clib.h lj_cparse.c lj_cparse.h lj_lib.c lj_lib.h lj_ir.c lj_ircall.h \
+ lj_iropt.h lj_opt_mem.c lj_opt_fold.c lj_folddef.h lj_opt_narrow.c \
+ lj_opt_dce.c lj_opt_loop.c lj_snap.h lj_opt_split.c lj_mcode.c \
+ lj_mcode.h lj_snap.c lj_target.h lj_target_*.h lj_record.c lj_record.h \
+ lj_ffrecord.h lj_crecord.c lj_crecord.h lj_ffrecord.c lj_recdef.h \
+ lj_asm.c lj_asm.h lj_emit_*.h lj_asm_*.h lj_trace.c lj_gdbjit.h \
+ lj_gdbjit.c lj_alloc.c lib_aux.c lib_base.c lj_libdef.h lib_math.c \
+ lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c \
+ lib_bit.c lib_jit.c lib_ffi.c lib_init.c
 luajit.o: luajit.c lua.h luaconf.h lauxlib.h lualib.h luajit.h lj_arch.h
index 3a99c834931608f804b16955e2125d1edd4c0d6d..33f87a4b37ee95910c44e797a5eb45983357bb6e 100644 (file)
@@ -19,6 +19,7 @@
 #include "lj_gc.h"
 #include "lj_bc.h"
 #include "lj_ir.h"
+#include "lj_ircall.h"
 #include "lj_frame.h"
 #include "lj_dispatch.h"
 #if LJ_HASFFI
index 57837e1f0eea5f45f64895ac204fb84e59601c0d..259a03e1d34ef4ef72ce3175b6db773b40b5b2b6 100644 (file)
@@ -19,6 +19,7 @@
 #if LJ_HASJIT
 #include "lj_ir.h"
 #include "lj_jit.h"
+#include "lj_ircall.h"
 #include "lj_iropt.h"
 #include "lj_target.h"
 #endif
index e2c14872b8d5835450ec1a6535f7e8454c5bec51..78f2484a0a9ceee2b75495b72d9008e79eea8935 100644 (file)
@@ -19,6 +19,7 @@
 #endif
 #include "lj_ir.h"
 #include "lj_jit.h"
+#include "lj_ircall.h"
 #include "lj_iropt.h"
 #include "lj_mcode.h"
 #include "lj_iropt.h"
index 0b73f440d3d9ff57bd5a78831ba94ed074169e1e..02e788aa70873f3b0c21fe083e0142ffb778d687 100644 (file)
@@ -20,6 +20,7 @@
 #include "lj_clib.h"
 #include "lj_ir.h"
 #include "lj_jit.h"
+#include "lj_ircall.h"
 #include "lj_iropt.h"
 #include "lj_trace.h"
 #include "lj_record.h"
index a3d18ff97fa90f2e7a669bc555053f0c0ef14634..91d31b291ebfc46bf67ffbc2edda1bf3a4bed91b 100644 (file)
@@ -18,6 +18,7 @@
 #include "lj_ff.h"
 #include "lj_ir.h"
 #include "lj_jit.h"
+#include "lj_ircall.h"
 #include "lj_iropt.h"
 #include "lj_trace.h"
 #include "lj_record.h"
index 94fe44b1402def765b90eb0d9434ad6745f78f42..b7d1e7a76cfcef40b1a124b99ec2db350a418c18 100644 (file)
@@ -19,6 +19,7 @@
 #include "lj_tab.h"
 #include "lj_ir.h"
 #include "lj_jit.h"
+#include "lj_ircall.h"
 #include "lj_iropt.h"
 #include "lj_trace.h"
 #if LJ_HASFFI
index 5659ba73208d1bb532e2a483349893e88f2fae70..1bc6c3320bae2fd8827b91149753d55e688f2015 100644 (file)
@@ -234,91 +234,6 @@ IRFLDEF(FLENUM)
 #define IRCONV_INDEX  (2<<IRCONV_CSH)  /* Check + special backprop rules. */
 #define IRCONV_CHECK  (3<<IRCONV_CSH)  /* Number checked for integerness. */
 
-/* C call info for CALL* instructions. */
-typedef struct CCallInfo {
-  ASMFunction func;            /* Function pointer. */
-  uint32_t flags;              /* Number of arguments and flags. */
-} CCallInfo;
-
-#define CCI_NARGS(ci)          ((ci)->flags & 0xff)    /* Extract # of args. */
-#define CCI_NARGS_MAX          32                      /* Max. # of args. */
-
-#define CCI_OTSHIFT            16
-#define CCI_OPTYPE(ci)         ((ci)->flags >> CCI_OTSHIFT)  /* Get op/type. */
-#define CCI_OPSHIFT            24
-#define CCI_OP(ci)             ((ci)->flags >> CCI_OPSHIFT)  /* Get op. */
-
-#define CCI_CALL_N             (IR_CALLN << CCI_OPSHIFT)
-#define CCI_CALL_L             (IR_CALLL << CCI_OPSHIFT)
-#define CCI_CALL_S             (IR_CALLS << CCI_OPSHIFT)
-#define CCI_CALL_FN            (CCI_CALL_N|CCI_FASTCALL)
-#define CCI_CALL_FL            (CCI_CALL_L|CCI_FASTCALL)
-#define CCI_CALL_FS            (CCI_CALL_S|CCI_FASTCALL)
-
-/* C call info flags. */
-#define CCI_L                  0x0100  /* Implicit L arg. */
-#define CCI_CASTU64            0x0200  /* Cast u64 result to number. */
-#define CCI_NOFPRCLOBBER       0x0400  /* Does not clobber any FPRs. */
-#define CCI_FASTCALL           0x0800  /* Fastcall convention. */
-
-/* Function definitions for CALL* instructions. */
-#if LJ_HASFFI
-#if LJ_32
-#define ARG2_64                4       /* Treat as 4 32 bit arguments. */
-#define IRCALLDEF_FFI32(_) \
-  _(lj_carith_mul64,   ARG2_64,   N, I64, CCI_NOFPRCLOBBER)
-#else
-#define ARG2_64                2
-#define IRCALLDEF_FFI32(_)
-#endif
-#define IRCALLDEF_FFI(_) \
-  IRCALLDEF_FFI32(_) \
-  _(lj_carith_divi64,  ARG2_64,   N, I64, CCI_NOFPRCLOBBER) \
-  _(lj_carith_divu64,  ARG2_64,   N, U64, CCI_NOFPRCLOBBER) \
-  _(lj_carith_modi64,  ARG2_64,   N, I64, CCI_NOFPRCLOBBER) \
-  _(lj_carith_modu64,  ARG2_64,   N, U64, CCI_NOFPRCLOBBER) \
-  _(lj_carith_powi64,  ARG2_64,   N, I64, CCI_NOFPRCLOBBER) \
-  _(lj_carith_powu64,  ARG2_64,   N, U64, CCI_NOFPRCLOBBER) \
-  _(lj_cdata_setfin,   2,        FN, P32, CCI_L) \
-  _(strlen,            1,         N, INTP, 0) \
-  _(memcpy,            3,         S, PTR, 0) \
-  _(memset,            3,         S, PTR, 0)
-#else
-#define IRCALLDEF_FFI(_)
-#endif
-#define IRCALLDEF(_) \
-  _(lj_str_cmp,                2,  FN, INT, CCI_NOFPRCLOBBER) \
-  _(lj_str_new,                3,   S, STR, CCI_L) \
-  _(lj_str_tonum,      2,  FN, INT, 0) \
-  _(lj_str_fromint,    2,  FN, STR, CCI_L) \
-  _(lj_str_fromnum,    2,  FN, STR, CCI_L) \
-  _(lj_tab_new1,       2,  FS, TAB, CCI_L) \
-  _(lj_tab_dup,                2,  FS, TAB, CCI_L) \
-  _(lj_tab_newkey,     3,   S, P32, CCI_L) \
-  _(lj_tab_len,                1,  FL, INT, 0) \
-  _(lj_gc_step_jit,    2,  FS, NIL, CCI_L) \
-  _(lj_gc_barrieruv,   2,  FS, NIL, 0) \
-  _(lj_mem_newgco,     2,  FS, P32, CCI_L) \
-  _(lj_math_random_step, 1, FS, NUM, CCI_CASTU64|CCI_NOFPRCLOBBER) \
-  IRCALLDEF_FFI(_) \
-  _(sinh,              1,  N, NUM, 0) \
-  _(cosh,              1,  N, NUM, 0) \
-  _(tanh,              1,  N, NUM, 0) \
-  _(fputc,             2,  S, INT, 0) \
-  _(fwrite,            4,  S, INT, 0) \
-  _(fflush,            1,  S, INT, 0) \
-  \
-  /* End of list. */
-
-typedef enum {
-#define IRCALLENUM(name, nargs, kind, type, flags)     IRCALL_##name,
-IRCALLDEF(IRCALLENUM)
-#undef IRCALLENUM
-  IRCALL__MAX
-} IRCallID;
-
-LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
-
 /* -- IR operands --------------------------------------------------------- */
 
 /* IR operand mode (2 bit). */
diff --git a/src/lj_ircall.h b/src/lj_ircall.h
new file mode 100644 (file)
index 0000000..3131b15
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+** IR CALL* instruction definitions.
+** Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h
+*/
+
+#ifndef _LJ_IRCALL_H
+#define _LJ_IRCALL_H
+
+#include "lj_obj.h"
+#include "lj_ir.h"
+#include "lj_jit.h"
+
+/* C call info for CALL* instructions. */
+typedef struct CCallInfo {
+  ASMFunction func;            /* Function pointer. */
+  uint32_t flags;              /* Number of arguments and flags. */
+} CCallInfo;
+
+#define CCI_NARGS(ci)          ((ci)->flags & 0xff)    /* Extract # of args. */
+#define CCI_NARGS_MAX          32                      /* Max. # of args. */
+
+#define CCI_OTSHIFT            16
+#define CCI_OPTYPE(ci)         ((ci)->flags >> CCI_OTSHIFT)  /* Get op/type. */
+#define CCI_OPSHIFT            24
+#define CCI_OP(ci)             ((ci)->flags >> CCI_OPSHIFT)  /* Get op. */
+
+#define CCI_CALL_N             (IR_CALLN << CCI_OPSHIFT)
+#define CCI_CALL_L             (IR_CALLL << CCI_OPSHIFT)
+#define CCI_CALL_S             (IR_CALLS << CCI_OPSHIFT)
+#define CCI_CALL_FN            (CCI_CALL_N|CCI_FASTCALL)
+#define CCI_CALL_FL            (CCI_CALL_L|CCI_FASTCALL)
+#define CCI_CALL_FS            (CCI_CALL_S|CCI_FASTCALL)
+
+/* C call info flags. */
+#define CCI_L                  0x0100  /* Implicit L arg. */
+#define CCI_CASTU64            0x0200  /* Cast u64 result to number. */
+#define CCI_NOFPRCLOBBER       0x0400  /* Does not clobber any FPRs. */
+#define CCI_FASTCALL           0x0800  /* Fastcall convention. */
+
+/* Function definitions for CALL* instructions. */
+#if LJ_HASFFI
+#if LJ_32
+#define ARG2_64                4       /* Treat as 4 32 bit arguments. */
+#define IRCALLDEF_FFI32(_) \
+  _(lj_carith_mul64,   ARG2_64,   N, I64, CCI_NOFPRCLOBBER)
+#else
+#define ARG2_64                2
+#define IRCALLDEF_FFI32(_)
+#endif
+#define IRCALLDEF_FFI(_) \
+  IRCALLDEF_FFI32(_) \
+  _(lj_carith_divi64,  ARG2_64,   N, I64, CCI_NOFPRCLOBBER) \
+  _(lj_carith_divu64,  ARG2_64,   N, U64, CCI_NOFPRCLOBBER) \
+  _(lj_carith_modi64,  ARG2_64,   N, I64, CCI_NOFPRCLOBBER) \
+  _(lj_carith_modu64,  ARG2_64,   N, U64, CCI_NOFPRCLOBBER) \
+  _(lj_carith_powi64,  ARG2_64,   N, I64, CCI_NOFPRCLOBBER) \
+  _(lj_carith_powu64,  ARG2_64,   N, U64, CCI_NOFPRCLOBBER) \
+  _(lj_cdata_setfin,   2,        FN, P32, CCI_L) \
+  _(strlen,            1,         N, INTP, 0) \
+  _(memcpy,            3,         S, PTR, 0) \
+  _(memset,            3,         S, PTR, 0)
+#else
+#define IRCALLDEF_FFI(_)
+#endif
+#define IRCALLDEF(_) \
+  _(lj_str_cmp,                2,  FN, INT, CCI_NOFPRCLOBBER) \
+  _(lj_str_new,                3,   S, STR, CCI_L) \
+  _(lj_str_tonum,      2,  FN, INT, 0) \
+  _(lj_str_fromint,    2,  FN, STR, CCI_L) \
+  _(lj_str_fromnum,    2,  FN, STR, CCI_L) \
+  _(lj_tab_new1,       2,  FS, TAB, CCI_L) \
+  _(lj_tab_dup,                2,  FS, TAB, CCI_L) \
+  _(lj_tab_newkey,     3,   S, P32, CCI_L) \
+  _(lj_tab_len,                1,  FL, INT, 0) \
+  _(lj_gc_step_jit,    2,  FS, NIL, CCI_L) \
+  _(lj_gc_barrieruv,   2,  FS, NIL, 0) \
+  _(lj_mem_newgco,     2,  FS, P32, CCI_L) \
+  _(lj_math_random_step, 1, FS, NUM, CCI_CASTU64|CCI_NOFPRCLOBBER) \
+  IRCALLDEF_FFI(_) \
+  _(sinh,              1,  N, NUM, 0) \
+  _(cosh,              1,  N, NUM, 0) \
+  _(tanh,              1,  N, NUM, 0) \
+  _(fputc,             2,  S, INT, 0) \
+  _(fwrite,            4,  S, INT, 0) \
+  _(fflush,            1,  S, INT, 0) \
+  \
+  /* End of list. */
+
+typedef enum {
+#define IRCALLENUM(name, nargs, kind, type, flags)     IRCALL_##name,
+IRCALLDEF(IRCALLENUM)
+#undef IRCALLENUM
+  IRCALL__MAX
+} IRCallID;
+
+LJ_FUNC TRef lj_ir_call(jit_State *J, IRCallID id, ...);
+
+LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
+
+#endif
index 82dc2e27c3ab4d7da7a398a7345895237112d9d0..daba5296ce5d0b11febd9c394f674fa8ca2f18ef 100644 (file)
@@ -15,7 +15,6 @@
 /* IR emitter. */
 LJ_FUNC void LJ_FASTCALL lj_ir_growtop(jit_State *J);
 LJ_FUNC TRef LJ_FASTCALL lj_ir_emit(jit_State *J);
-LJ_FUNC TRef lj_ir_call(jit_State *J, IRCallID id, ...);
 
 /* Save current IR in J->fold.ins, but do not emit it (yet). */
 static LJ_AINLINE void lj_ir_set_(jit_State *J, uint16_t ot, IRRef1 a, IRRef1 b)
index e52ddfd4ca0cb9c1b583d20bd076b5a1f289bada..2f8b1e9c9d8ec77e9294db4e0bb14df89ce678bd 100644 (file)
@@ -14,6 +14,7 @@
 #include "lj_str.h"
 #include "lj_ir.h"
 #include "lj_jit.h"
+#include "lj_ircall.h"
 #include "lj_iropt.h"
 #include "lj_vm.h"
 
index e51d0b5a5ad546c2f42ee0e4482f4526d759d23b..91555a3b0d0bec76c62005166a30cb2bc0c91bdd 100644 (file)
@@ -19,6 +19,7 @@
 #include "lj_ff.h"
 #include "lj_ir.h"
 #include "lj_jit.h"
+#include "lj_ircall.h"
 #include "lj_iropt.h"
 #include "lj_trace.h"
 #include "lj_record.h"