[runtime] Introduce MonoAotMode enum to the public API.
[mono.git] / mono / mini / jit.h
1 /*
2  * Author:
3  *   Dietmar Maurer (dietmar@ximian.com)
4  *
5  * (C) 2001, 2002, 2003 Ximian, Inc.
6  */
7
8 #ifndef _MONO_JIT_JIT_H_
9 #define _MONO_JIT_JIT_H_
10
11 #include <mono/metadata/appdomain.h>
12
13 MONO_BEGIN_DECLS
14
15 MONO_API MonoDomain * 
16 mono_jit_init              (const char *file);
17
18 MONO_API MonoDomain * 
19 mono_jit_init_version      (const char *root_domain_name, const char *runtime_version);
20
21 MONO_API int
22 mono_jit_exec              (MonoDomain *domain, MonoAssembly *assembly, 
23                             int argc, char *argv[]);
24 MONO_API void        
25 mono_jit_cleanup           (MonoDomain *domain);
26
27 MONO_API mono_bool
28 mono_jit_set_trace_options (const char* options);
29
30 MONO_API void
31 mono_set_signal_chaining   (mono_bool chain_signals);
32
33 MONO_API void
34 mono_set_crash_chaining   (mono_bool chain_signals);
35
36 MONO_API void
37 mono_jit_set_aot_only      (mono_bool aot_only);
38
39 /**
40  * Allows control over our AOT (Ahead-of-time) compilation mode.
41  */
42 typedef enum {
43         /* Disables AOT mode */
44         MONO_AOT_MODE_NONE,
45         /* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */
46         MONO_AOT_MODE_NORMAL,
47         /* Enables hyrbid AOT mode, JIT can still be used for wrappers */
48         MONO_AOT_MODE_HYBRID,
49         /* Enables full AOT mode, JIT is disabled and not allowed,
50          * equivalent to mono_jit_set_aot_only (true) */
51         MONO_AOT_MODE_FULL
52 } MonoAotMode;
53
54 /* Allow embedders to decide wherther to actually obey breakpoint instructions
55  * in specific methods (works for both break IL instructions and Debugger.Break ()
56  * method calls).
57  */
58 typedef enum {
59         /* the default is to always obey the breakpoint */
60         MONO_BREAK_POLICY_ALWAYS,
61         /* a nop is inserted instead of a breakpoint */
62         MONO_BREAK_POLICY_NEVER,
63         /* the breakpoint is executed only if the program has ben started under
64          * the debugger (that is if a debugger was attached at the time the method
65          * was compiled).
66          */
67         MONO_BREAK_POLICY_ON_DBG
68 } MonoBreakPolicy;
69
70 typedef MonoBreakPolicy (*MonoBreakPolicyFunc) (MonoMethod *method);
71 MONO_API void mono_set_break_policy (MonoBreakPolicyFunc policy_callback);
72
73 MONO_API void
74 mono_jit_parse_options     (int argc, char * argv[]);
75
76 MONO_API char*       mono_get_runtime_build_info    (void);
77
78 /* The following APIs are not stable. Avoid if possible. */
79
80 MONO_API MonoJitInfo *
81 mono_get_jit_info_from_method (MonoDomain *domain, MonoMethod *method);
82
83 MONO_API void *
84 mono_aot_get_method (MonoDomain *domain, MonoMethod *method);
85
86 MONO_END_DECLS
87
88 #endif
89