diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_trace.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/lj_trace.h b/src/lj_trace.h new file mode 100644 index 00000000..9d8eb790 --- /dev/null +++ b/src/lj_trace.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | ** Trace management. | ||
3 | ** Copyright (C) 2005-2009 Mike Pall. See Copyright Notice in luajit.h | ||
4 | */ | ||
5 | |||
6 | #ifndef _LJ_TRACE_H | ||
7 | #define _LJ_TRACE_H | ||
8 | |||
9 | #if LJ_HASJIT | ||
10 | |||
11 | #include "lj_obj.h" | ||
12 | #include "lj_jit.h" | ||
13 | #include "lj_dispatch.h" | ||
14 | |||
15 | /* Trace errors. */ | ||
16 | typedef enum { | ||
17 | #define TREDEF(name, msg) LJ_TRERR_##name, | ||
18 | #include "lj_traceerr.h" | ||
19 | LJ_TRERR__MAX | ||
20 | } TraceError; | ||
21 | |||
22 | LJ_FUNC_NORET void lj_trace_err(jit_State *J, TraceError e); | ||
23 | LJ_FUNC_NORET void lj_trace_err_info(jit_State *J, TraceError e); | ||
24 | |||
25 | /* Trace management. */ | ||
26 | LJ_FUNC void lj_trace_freeproto(global_State *g, GCproto *pt); | ||
27 | LJ_FUNC void lj_trace_reenableproto(GCproto *pt); | ||
28 | LJ_FUNC void lj_trace_flushproto(global_State *g, GCproto *pt); | ||
29 | LJ_FUNC void lj_trace_flush(jit_State *J, TraceNo traceno); | ||
30 | LJ_FUNC int lj_trace_flushall(lua_State *L); | ||
31 | LJ_FUNC void lj_trace_freestate(global_State *g); | ||
32 | |||
33 | /* Event handling. */ | ||
34 | LJ_FUNC void lj_trace_ins(jit_State *J); | ||
35 | LJ_FUNCA void lj_trace_hot(jit_State *J, const BCIns *pc); | ||
36 | LJ_FUNCA void *lj_trace_exit(jit_State *J, void *exptr); | ||
37 | |||
38 | /* Signal asynchronous abort of trace or end of trace. */ | ||
39 | #define lj_trace_abort(g) (G2J(g)->state &= ~LJ_TRACE_ACTIVE) | ||
40 | #define lj_trace_end(J) (J->state = LJ_TRACE_END) | ||
41 | |||
42 | #else | ||
43 | |||
44 | #define lj_trace_flushall(L) (UNUSED(L), 0) | ||
45 | #define lj_trace_freestate(g) UNUSED(g) | ||
46 | #define lj_trace_freeproto(g, pt) (UNUSED(g), UNUSED(pt), (void)0) | ||
47 | #define lj_trace_abort(g) UNUSED(g) | ||
48 | #define lj_trace_end(J) UNUSED(J) | ||
49 | |||
50 | #endif | ||
51 | |||
52 | #endif | ||