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