update readme (#21797)
[mono-project.git] / mono / mini / jit.h
blob02639c95122de060e16bebf8fa6a75d3547e1923
1 /**
2 * \file
3 * Author:
4 * Dietmar Maurer (dietmar@ximian.com)
6 * (C) 2001, 2002, 2003 Ximian, Inc.
7 */
9 #ifndef _MONO_JIT_JIT_H_
10 #define _MONO_JIT_JIT_H_
12 #include <mono/metadata/appdomain.h>
14 MONO_BEGIN_DECLS
16 MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
17 mono_jit_init (const char *file);
19 MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
20 mono_jit_init_version (const char *root_domain_name, const char *runtime_version);
22 MONO_API MonoDomain *
23 mono_jit_init_version_for_test_only (const char *root_domain_name, const char *runtime_version);
25 MONO_API int
26 mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly,
27 int argc, char *argv[]);
28 MONO_API void
29 mono_jit_cleanup (MonoDomain *domain);
31 MONO_API mono_bool
32 mono_jit_set_trace_options (const char* options);
34 MONO_API void
35 mono_set_signal_chaining (mono_bool chain_signals);
37 MONO_API void
38 mono_set_crash_chaining (mono_bool chain_signals);
40 /**
41 * This function is deprecated, use mono_jit_set_aot_mode instead.
43 MONO_API void
44 mono_jit_set_aot_only (mono_bool aot_only);
46 /**
47 * Allows control over our AOT (Ahead-of-time) compilation mode.
49 typedef enum {
50 /* Disables AOT mode */
51 MONO_AOT_MODE_NONE,
52 /* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */
53 MONO_AOT_MODE_NORMAL,
54 /* Enables hybrid AOT mode, JIT can still be used for wrappers */
55 MONO_AOT_MODE_HYBRID,
56 /* Enables full AOT mode, JIT is disabled and not allowed,
57 * equivalent to mono_jit_set_aot_only (true) */
58 MONO_AOT_MODE_FULL,
59 /* Same as full, but use only llvm compiled code */
60 MONO_AOT_MODE_LLVMONLY,
61 /* Uses Interpreter, JIT is disabled and not allowed,
62 * equivalent to "--full-aot --interpreter" */
63 MONO_AOT_MODE_INTERP,
64 /* Same as INTERP, but use only llvm compiled code */
65 MONO_AOT_MODE_INTERP_LLVMONLY,
66 /* Use only llvm compiled code, fall back to the interpeter */
67 MONO_AOT_MODE_LLVMONLY_INTERP,
68 /* Same as --interp */
69 MONO_AOT_MODE_INTERP_ONLY,
70 /* Sentinel value used internally by the runtime. We use a large number to avoid clashing with some internal values. */
71 MONO_AOT_MODE_LAST = 1000,
72 } MonoAotMode;
74 MONO_API void
75 mono_jit_set_aot_mode (MonoAotMode mode);
78 * Returns whether the runtime was invoked for the purpose of AOT-compiling an
79 * assembly, i.e. no managed code will run.
81 MONO_API mono_bool
82 mono_jit_aot_compiling (void);
84 /* Allow embedders to decide wherther to actually obey breakpoint instructions
85 * in specific methods (works for both break IL instructions and Debugger.Break ()
86 * method calls).
88 typedef enum {
89 /* the default is to always obey the breakpoint */
90 MONO_BREAK_POLICY_ALWAYS,
91 /* a nop is inserted instead of a breakpoint */
92 MONO_BREAK_POLICY_NEVER,
93 /* the breakpoint is executed only if the program has ben started under
94 * the debugger (that is if a debugger was attached at the time the method
95 * was compiled).
97 MONO_BREAK_POLICY_ON_DBG
98 } MonoBreakPolicy;
100 typedef MonoBreakPolicy (*MonoBreakPolicyFunc) (MonoMethod *method);
101 MONO_API void mono_set_break_policy (MonoBreakPolicyFunc policy_callback);
103 MONO_API void
104 mono_jit_parse_options (int argc, char * argv[]);
106 MONO_API char* mono_get_runtime_build_info (void);
108 MONO_API MONO_RT_EXTERNAL_ONLY void
109 mono_set_use_llvm (mono_bool use_llvm);
111 MONO_API MONO_RT_EXTERNAL_ONLY void
112 mono_aot_register_module (void **aot_info);
114 MONO_API MONO_RT_EXTERNAL_ONLY
115 MonoDomain* mono_jit_thread_attach (MonoDomain *domain);
117 MONO_END_DECLS
119 #endif