diff options
author | David Walter Seikel | 2012-01-23 23:36:30 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:36:30 +1000 |
commit | 6523585c66c04cea54df50013df8886b589847d8 (patch) | |
tree | 0b22aee7064166d88595eda260ca2d17c0773da5 /libraries/luajit-2.0/src/lj_vm.h | |
parent | Update the EFL to what I'm actually using, coz I'm using some stuff not yet r... (diff) | |
download | SledjHamr-6523585c66c04cea54df50013df8886b589847d8.zip SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.gz SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.bz2 SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.xz |
Add luaproc and LuaJIT libraries.
Two versions of LuaJIT, the stable release, and the dev version. Try the dev version first, until ih fails badly.
Diffstat (limited to '')
-rw-r--r-- | libraries/luajit-2.0/src/lj_vm.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/libraries/luajit-2.0/src/lj_vm.h b/libraries/luajit-2.0/src/lj_vm.h new file mode 100644 index 0000000..da940b9 --- /dev/null +++ b/libraries/luajit-2.0/src/lj_vm.h | |||
@@ -0,0 +1,102 @@ | |||
1 | /* | ||
2 | ** Assembler VM interface definitions. | ||
3 | ** Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h | ||
4 | */ | ||
5 | |||
6 | #ifndef _LJ_VM_H | ||
7 | #define _LJ_VM_H | ||
8 | |||
9 | #include "lj_obj.h" | ||
10 | |||
11 | /* Entry points for ASM parts of VM. */ | ||
12 | LJ_ASMF void lj_vm_call(lua_State *L, TValue *base, int nres1); | ||
13 | LJ_ASMF int lj_vm_pcall(lua_State *L, TValue *base, int nres1, ptrdiff_t ef); | ||
14 | typedef TValue *(*lua_CPFunction)(lua_State *L, lua_CFunction func, void *ud); | ||
15 | LJ_ASMF int lj_vm_cpcall(lua_State *L, lua_CFunction func, void *ud, | ||
16 | lua_CPFunction cp); | ||
17 | LJ_ASMF int lj_vm_resume(lua_State *L, TValue *base, int nres1, ptrdiff_t ef); | ||
18 | LJ_ASMF_NORET void LJ_FASTCALL lj_vm_unwind_c(void *cframe, int errcode); | ||
19 | LJ_ASMF_NORET void LJ_FASTCALL lj_vm_unwind_ff(void *cframe); | ||
20 | LJ_ASMF void lj_vm_unwind_c_eh(void); | ||
21 | LJ_ASMF void lj_vm_unwind_ff_eh(void); | ||
22 | #if LJ_TARGET_X86ORX64 | ||
23 | LJ_ASMF void lj_vm_unwind_rethrow(void); | ||
24 | #endif | ||
25 | |||
26 | /* Miscellaneous functions. */ | ||
27 | #if LJ_TARGET_X86ORX64 | ||
28 | LJ_ASMF int lj_vm_cpuid(uint32_t f, uint32_t res[4]); | ||
29 | #endif | ||
30 | LJ_ASMF double lj_vm_foldarith(double x, double y, int op); | ||
31 | #if LJ_HASJIT | ||
32 | LJ_ASMF double lj_vm_foldfpm(double x, int op); | ||
33 | #endif | ||
34 | #if !LJ_ARCH_HASFPU | ||
35 | /* Declared in lj_obj.h: LJ_ASMF int32_t lj_vm_tobit(double x); */ | ||
36 | #endif | ||
37 | |||
38 | /* Dispatch targets for recording and hooks. */ | ||
39 | LJ_ASMF void lj_vm_record(void); | ||
40 | LJ_ASMF void lj_vm_inshook(void); | ||
41 | LJ_ASMF void lj_vm_rethook(void); | ||
42 | LJ_ASMF void lj_vm_callhook(void); | ||
43 | |||
44 | /* Trace exit handling. */ | ||
45 | LJ_ASMF void lj_vm_exit_handler(void); | ||
46 | LJ_ASMF void lj_vm_exit_interp(void); | ||
47 | |||
48 | /* Internal math helper functions. */ | ||
49 | #if LJ_TARGET_X86ORX64 | ||
50 | #define lj_vm_floor(x) floor(x) | ||
51 | #define lj_vm_ceil(x) ceil(x) | ||
52 | #else | ||
53 | LJ_ASMF double lj_vm_floor(double); | ||
54 | LJ_ASMF double lj_vm_ceil(double); | ||
55 | #endif | ||
56 | |||
57 | #if LJ_HASJIT | ||
58 | #if LJ_TARGET_X86ORX64 | ||
59 | LJ_ASMF void lj_vm_floor_sse(void); | ||
60 | LJ_ASMF void lj_vm_ceil_sse(void); | ||
61 | LJ_ASMF void lj_vm_trunc_sse(void); | ||
62 | LJ_ASMF void lj_vm_exp_x87(void); | ||
63 | LJ_ASMF void lj_vm_exp2_x87(void); | ||
64 | LJ_ASMF void lj_vm_pow_sse(void); | ||
65 | LJ_ASMF void lj_vm_powi_sse(void); | ||
66 | #else | ||
67 | LJ_ASMF double lj_vm_trunc(double); | ||
68 | LJ_ASMF double lj_vm_powi(double, int32_t); | ||
69 | #ifdef LUAJIT_NO_LOG2 | ||
70 | LJ_ASMF double lj_vm_log2(double); | ||
71 | #else | ||
72 | #define lj_vm_log2 log2 | ||
73 | #endif | ||
74 | #ifdef LUAJIT_NO_EXP2 | ||
75 | LJ_ASMF double lj_vm_exp2(double); | ||
76 | #else | ||
77 | #define lj_vm_exp2 exp2 | ||
78 | #endif | ||
79 | #endif | ||
80 | LJ_ASMF int32_t LJ_FASTCALL lj_vm_modi(int32_t, int32_t); | ||
81 | #if LJ_HASFFI | ||
82 | LJ_ASMF int lj_vm_errno(void); | ||
83 | #endif | ||
84 | #endif | ||
85 | |||
86 | /* Continuations for metamethods. */ | ||
87 | LJ_ASMF void lj_cont_cat(void); /* Continue with concatenation. */ | ||
88 | LJ_ASMF void lj_cont_ra(void); /* Store result in RA from instruction. */ | ||
89 | LJ_ASMF void lj_cont_nop(void); /* Do nothing, just continue execution. */ | ||
90 | LJ_ASMF void lj_cont_condt(void); /* Branch if result is true. */ | ||
91 | LJ_ASMF void lj_cont_condf(void); /* Branch if result is false. */ | ||
92 | LJ_ASMF void lj_cont_hook(void); /* Continue from hook yield. */ | ||
93 | |||
94 | enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CALLBACK }; /* Special continuations. */ | ||
95 | |||
96 | /* Start of the ASM code. */ | ||
97 | LJ_ASMF char lj_vm_asm_begin[]; | ||
98 | |||
99 | /* Bytecode offsets are relative to lj_vm_asm_begin. */ | ||
100 | #define makeasmfunc(ofs) ((ASMFunction)(lj_vm_asm_begin + (ofs))) | ||
101 | |||
102 | #endif | ||