#define MONO_USE_AOT_COMPILER
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION "4"
+#define MONO_AOT_FILE_VERSION "6"
#if 1
#define mono_bitset_test_fast(set,n) (((guint32*)set)[2+(n)/32] & (1 << ((n) % 32)))
typedef struct MonoBasicBlock MonoBasicBlock;
typedef struct MonoLMF MonoLMF;
typedef struct MonoSpillInfo MonoSpillInfo;
+typedef struct MonoTraceSpec MonoTraceSpec;
extern guint32 mono_jit_tls_id;
-extern gboolean mono_jit_trace_calls;
+extern MonoTraceSpec *mono_jit_trace_calls;
extern gboolean mono_break_on_exc;
extern int mono_exc_esp_offset;
extern gboolean mono_compile_aot;
-extern gboolean mono_no_aot;
struct MonoEdge {
MonoEdge *next;
MONO_PATCH_INFO_IMAGE,
MONO_PATCH_INFO_FIELD,
MONO_PATCH_INFO_VTABLE,
+ MONO_PATCH_INFO_CLASS_INIT,
MONO_PATCH_INFO_SFLDA,
MONO_PATCH_INFO_LDSTR,
MONO_PATCH_INFO_LDTOKEN,
MONO_PATCH_INFO_R4,
MONO_PATCH_INFO_R8,
MONO_PATCH_INFO_IP,
- MONO_PATCH_INFO_IID
+ MONO_PATCH_INFO_IID,
+ MONO_PATCH_INFO_WRAPPER
} MonoJumpInfoType;
+/*
+ * We need to store the image which the token refers to along with the token,
+ * since the image might not be the same as the image of the method which
+ * contains the relocation, because of inlining.
+ */
+typedef struct MonoJumpInfoToken {
+ MonoImage *image;
+ guint32 token;
+} MonoJumpInfoToken;
+
typedef struct MonoJumpInfo MonoJumpInfo;
struct MonoJumpInfo {
MonoJumpInfo *next;
MonoImage *image;
MonoVTable *vtable;
const char *name;
- guint32 token;
+ MonoJumpInfoToken *token;
} data;
int table_size; /* use by switch */
};
-/* optimization flags: keep up to date with the name array in mini.c */
+/* optimization flags: keep up to date with the name array in driver.c */
enum {
MONO_OPT_PEEPHOLE = 1 << 0,
MONO_OPT_BRANCH = 1 << 1,
MONO_OPT_TAILC = 1 << 12,
MONO_OPT_LOOP = 1 << 13,
MONO_OPT_FCMOV = 1 << 14,
- MONO_OPT_LEAF = 1 << 15
+ MONO_OPT_LEAF = 1 << 15,
+ MONO_OPT_AOT = 1 << 16,
+ MONO_OPT_PRECOMP = 1 << 17
};
#define MONO_REGION_FINALLY 16
MonoInst *exvar; /* the exception object passed to catch/filter blocks */
MonoInst *domainvar; /* a cache for the current domain */
- MonoInst *spvar; /* a place to store the stack pointer (used by handlers) */
+ /* A hashtable of region ID-> SP var mappings */
+ /* An SP var is a place to store the stack pointer (used by handlers) */
+ GHashTable *spvars;
GList *ldstr_list; /* used by AOT */
void mini_cleanup (MonoDomain *domain);
/* helper methods */
+MonoJumpInfoToken * mono_jump_info_token_new (MonoMemPool *mp, MonoImage *image, guint32 token);
+MonoInst* mono_find_spvar_for_region (MonoCompile *cfg, int region);
+void mono_precompile_assemblies (void);
int mono_parse_default_optimizations (const char* p);
void mono_bblock_add_inst (MonoBasicBlock *bb, MonoInst *inst);
void mono_constant_fold (MonoCompile *cfg);
MonoJitInfo* mono_aot_get_method (MonoDomain *domain,
MonoMethod *method);
gboolean mono_method_blittable (MonoMethod *method);
+gboolean mono_method_same_domain (MonoJitInfo *caller, MonoJitInfo *callee);
void mono_register_opcode_emulation (int opcode, const char* name, MonoMethodSignature *sig, gpointer func, gboolean no_throw);
void mono_arch_register_lowlevel_calls (void);
void mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options);
MonoJitICallInfo *mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save);
gconstpointer mono_icall_get_wrapper (MonoJitICallInfo* callinfo);
+gpointer mono_create_class_init_trampoline (MonoVTable *vtable);
+MonoVTable* mono_find_class_init_trampoline_by_addr (gconstpointer addr);
+
/* methods that must be provided by the arch-specific port */
void mono_arch_cpu_init (void);
guint32 mono_arch_cpu_optimizazions (guint32 *exclude_mask);
gpointer mono_arch_get_throw_exception_by_name (void);
gpointer mono_arch_create_jit_trampoline (MonoMethod *method);
gpointer mono_arch_create_jump_trampoline (MonoMethod *method);
+gpointer mono_arch_create_class_init_trampoline(MonoVTable *vtable);
GList *mono_arch_get_allocatable_int_vars (MonoCompile *cfg);
GList *mono_arch_get_global_int_regs (MonoCompile *cfg);
void mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji);
void mono_debug_open_block (MonoCompile *cfg, MonoBasicBlock *bb, guint32 address);
void mono_debug_record_line_number (MonoCompile *cfg, MonoInst *ins, guint32 address);
+
+/* Tracing */
+MonoTraceSpec *mono_trace_parse_options (MonoAssembly *assembly, char *options);
+gboolean mono_trace_eval (MonoMethod *method);
+
#endif /* __MONO_MINI_H__ */