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_vmevent.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_vmevent.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/libraries/luajit-2.0/src/lj_vmevent.h b/libraries/luajit-2.0/src/lj_vmevent.h new file mode 100644 index 0000000..8a0822f --- /dev/null +++ b/libraries/luajit-2.0/src/lj_vmevent.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | ** VM event handling. | ||
3 | ** Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h | ||
4 | */ | ||
5 | |||
6 | #ifndef _LJ_VMEVENT_H | ||
7 | #define _LJ_VMEVENT_H | ||
8 | |||
9 | #include "lj_obj.h" | ||
10 | |||
11 | /* Registry key for VM event handler table. */ | ||
12 | #define LJ_VMEVENTS_REGKEY "_VMEVENTS" | ||
13 | #define LJ_VMEVENTS_HSIZE 4 | ||
14 | |||
15 | #define VMEVENT_MASK(ev) ((uint8_t)1 << ((int)(ev) & 7)) | ||
16 | #define VMEVENT_HASH(ev) ((int)(ev) & ~7) | ||
17 | #define VMEVENT_HASHIDX(h) ((int)(h) << 3) | ||
18 | #define VMEVENT_NOCACHE 255 | ||
19 | |||
20 | #define VMEVENT_DEF(name, hash) \ | ||
21 | LJ_VMEVENT_##name##_, \ | ||
22 | LJ_VMEVENT_##name = ((LJ_VMEVENT_##name##_) & 7)|((hash) << 3) | ||
23 | |||
24 | /* VM event IDs. */ | ||
25 | typedef enum { | ||
26 | VMEVENT_DEF(BC, 0x00003883), | ||
27 | VMEVENT_DEF(TRACE, 0xb2d91467), | ||
28 | VMEVENT_DEF(RECORD, 0x9284bf4f), | ||
29 | VMEVENT_DEF(TEXIT, 0xb29df2b0), | ||
30 | LJ_VMEVENT__MAX | ||
31 | } VMEvent; | ||
32 | |||
33 | #ifdef LUAJIT_DISABLE_VMEVENT | ||
34 | #define lj_vmevent_send(L, ev, args) UNUSED(L) | ||
35 | #define lj_vmevent_send_(L, ev, args, post) UNUSED(L) | ||
36 | #else | ||
37 | #define lj_vmevent_send(L, ev, args) \ | ||
38 | if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ | ||
39 | ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ | ||
40 | if (argbase) { \ | ||
41 | args \ | ||
42 | lj_vmevent_call(L, argbase); \ | ||
43 | } \ | ||
44 | } | ||
45 | #define lj_vmevent_send_(L, ev, args, post) \ | ||
46 | if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ | ||
47 | ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ | ||
48 | if (argbase) { \ | ||
49 | args \ | ||
50 | lj_vmevent_call(L, argbase); \ | ||
51 | post \ | ||
52 | } \ | ||
53 | } | ||
54 | |||
55 | LJ_FUNC ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev); | ||
56 | LJ_FUNC void lj_vmevent_call(lua_State *L, ptrdiff_t argbase); | ||
57 | #endif | ||
58 | |||
59 | #endif | ||