#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 140
+#define MONO_AOT_FILE_VERSION 141
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
/* Remap printf to g_print (we use a mix of these in the mini code) */
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
#define printf g_print
#endif
/* List of call sites in this bblock sorted by pc_offset */
GSList *gc_callsites;
+ /* If this is not null, the basic block is a try hole for this clause */
+ MonoExceptionClause *clause_hole;
+
/*
* The region encodes whether the basic block is inside
* a finally, catch, filter or none of these.
MonoContext ex_ctx;
ResumeState resume_state;
- /*Variabled use to implement handler blocks (finally/catch/etc) guards during interruption*/
- /* handler block return address */
- gpointer handler_block_return_address;
-
/* handler block been guarded. It's safe to store this even for dynamic methods since there
is an activation on stack making sure it will remain alive.*/
MonoJitExceptionInfo *handler_block;
MONO_TRAMPOLINE_RESTORE_STACK_PROT,
MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING,
MONO_TRAMPOLINE_VCALL,
- MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD,
MONO_TRAMPOLINE_NUM
} MonoTrampolineType;
/* These trampolines receive an argument directly in a register */
#define MONO_TRAMPOLINE_TYPE_HAS_ARG(t) \
- ((t) == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)
+ (FALSE)
/* optimization flags */
#define OPTFLAG(id,shift,name,descr) MONO_OPT_ ## id = 1 << shift,
/* A hashtable of region ID-> SP var mappings */
/* An SP var is a place to store the stack pointer (used by handlers)*/
+ /*
+ * FIXME We can potentially get rid of this, since it was mainly used
+ * for hijacking return address for handler.
+ */
GHashTable *spvars;
- /* A hashtable of region ID -> EX var mappings */
- /* An EX var stores the exception object passed to catch/filter blocks */
+ /*
+ * A hashtable of region ID -> EX var mappings
+ * An EX var stores the exception object passed to catch/filter blocks
+ * For finally blocks, it is set to TRUE if we should throw an abort
+ * once the execution of the finally block is over.
+ */
GHashTable *exvars;
GList *ldstr_list; /* used by AOT */
int stat_inlineable_methods;
int stat_inlined_methods;
int stat_code_reallocs;
+
+ MonoProfilerCallInstrumentationFlags prof_flags;
} MonoCompile;
+#define MONO_CFG_PROFILE(cfg, flag) \
+ G_UNLIKELY ((cfg)->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_ ## flag)
+
+#define MONO_CFG_PROFILE_CALL_CONTEXT(cfg) \
+ (MONO_CFG_PROFILE (cfg, ENTER_CONTEXT) || MONO_CFG_PROFILE (cfg, LEAVE_CONTEXT))
+
typedef enum {
MONO_CFG_HAS_ALLOCA = 1 << 0,
MONO_CFG_HAS_CALLS = 1 << 1,
void mini_cleanup (MonoDomain *domain);
MONO_API MonoDebugOptions *mini_get_debug_options (void);
MONO_API gboolean mini_parse_debug_option (const char *option);
+
+/* profiler support */
void mini_add_profiler_argument (const char *desc);
+void mini_profiler_emit_enter (MonoCompile *cfg);
+void mini_profiler_emit_leave (MonoCompile *cfg, MonoInst *ret);
+void mini_profiler_emit_tail_call (MonoCompile *cfg, MonoMethod *target);
+void mini_profiler_context_enable (void);
+gpointer mini_profiler_context_get_this (MonoProfilerCallContext *ctx);
+gpointer mini_profiler_context_get_argument (MonoProfilerCallContext *ctx, guint32 pos);
+gpointer mini_profiler_context_get_local (MonoProfilerCallContext *ctx, guint32 pos);
+gpointer mini_profiler_context_get_result (MonoProfilerCallContext *ctx);
+void mini_profiler_context_free_buffer (gpointer buffer);
/* graph dumping */
void mono_cfg_dump_create_context (MonoCompile *cfg);
void mono_arch_fill_argument_info (MonoCompile *cfg);
void mono_arch_allocate_vars (MonoCompile *m);
int mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info);
-gboolean mono_arch_print_tree (MonoInst *tree, int arity);
void mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call);
void mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src);
void mono_arch_emit_setret (MonoCompile *cfg, MonoMethod *method, MonoInst *val);
GSList *mono_arch_get_trampolines (gboolean aot);
gpointer mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info);
-/* Handle block guard */
-gpointer mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value);
-gpointer mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot);
-gpointer mono_create_handler_block_trampoline (void);
-gboolean mono_install_handler_block_guard (MonoThreadUnwindState *ctx);
-
/*New interruption machinery */
void
mono_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data);
MonoObject *mono_llvm_load_exception (void);
void mono_llvm_reset_exception (void);
void mono_llvm_raise_exception (MonoException *e);
+void mono_llvm_reraise_exception (MonoException *e);
gint32 mono_llvm_match_exception (MonoJitInfo *jinfo, guint32 region_start, guint32 region_end, gpointer rgctx, MonoObject *this_obj);
gboolean
guint32 mono_arch_cpu_enumerate_simd_versions (void);
void mono_simd_intrinsics_init (void);
+gboolean mono_class_is_magic_int (MonoClass *klass);
+gboolean mono_class_is_magic_float (MonoClass *klass);
MonoInst* mono_emit_native_types_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args);
MonoType* mini_native_type_replace_type (MonoType *type) MONO_LLVM_INTERNAL;