#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 135
+#define MONO_AOT_FILE_VERSION 137
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
typedef enum {
MONO_AOT_TRAMP_SPECIFIC = 0,
MONO_AOT_TRAMP_STATIC_RGCTX = 1,
- MONO_AOT_TRAMP_IMT_THUNK = 2,
+ MONO_AOT_TRAMP_IMT = 2,
MONO_AOT_TRAMP_GSHAREDVT_ARG = 3,
MONO_AOT_TRAMP_NUM = 4
} MonoAotTrampoline;
/* Blocks of various kinds of trampolines */
gpointer specific_trampolines;
gpointer static_rgctx_trampolines;
- gpointer imt_thunks;
+ gpointer imt_trampolines;
gpointer gsharedvt_arg_trampolines;
/* In static mode, points to a table of global symbols for trampolines etc */
gpointer globals;
#define MONO_IS_SETCC(ins) ((((ins)->opcode >= OP_CEQ) && ((ins)->opcode <= OP_CLT_UN)) || (((ins)->opcode >= OP_ICEQ) && ((ins)->opcode <= OP_ICLE_UN)) || (((ins)->opcode >= OP_LCEQ) && ((ins)->opcode <= OP_LCLT_UN)) || (((ins)->opcode >= OP_FCEQ) && ((ins)->opcode <= OP_FCLT_UN)))
+#define MONO_HAS_CUSTOM_EMULATION(ins) (((ins)->opcode >= OP_FBEQ && (ins)->opcode <= OP_FBLT_UN) || ((ins)->opcode >= OP_FCEQ && (ins)->opcode <= OP_FCLT_UN))
#define MONO_IS_LOAD_MEMBASE(ins) (((ins)->opcode >= OP_LOAD_MEMBASE && (ins)->opcode <= OP_LOADV_MEMBASE) || ((ins)->opcode >= OP_ATOMIC_LOAD_I1 && (ins)->opcode <= OP_ATOMIC_LOAD_R8))
#define MONO_IS_STORE_MEMBASE(ins) (((ins)->opcode >= OP_STORE_MEMBASE_REG && (ins)->opcode <= OP_STOREV_MEMBASE) || ((ins)->opcode >= OP_ATOMIC_STORE_I1 && (ins)->opcode <= OP_ATOMIC_STORE_R8))
/* INEG sets the condition codes, and the OP_LNEG decomposition depends on this on x86 */
#define MONO_INS_HAS_NO_SIDE_EFFECT(ins) (MONO_IS_MOVE (ins) || (ins->opcode == OP_ICONST) || (ins->opcode == OP_I8CONST) || MONO_IS_ZERO (ins) || (ins->opcode == OP_ADD_IMM) || (ins->opcode == OP_R8CONST) || (ins->opcode == OP_LADD_IMM) || (ins->opcode == OP_ISUB_IMM) || (ins->opcode == OP_IADD_IMM) || (ins->opcode == OP_LNEG) || (ins->opcode == OP_ISUB) || (ins->opcode == OP_CMOV_IGE) || (ins->opcode == OP_ISHL_IMM) || (ins->opcode == OP_ISHR_IMM) || (ins->opcode == OP_ISHR_UN_IMM) || (ins->opcode == OP_IAND_IMM) || (ins->opcode == OP_ICONV_TO_U1) || (ins->opcode == OP_ICONV_TO_I1) || (ins->opcode == OP_SEXT_I4) || (ins->opcode == OP_LCONV_TO_U1) || (ins->opcode == OP_ICONV_TO_U2) || (ins->opcode == OP_ICONV_TO_I2) || (ins->opcode == OP_LCONV_TO_I2) || (ins->opcode == OP_LDADDR) || (ins->opcode == OP_PHI) || (ins->opcode == OP_NOP) || (ins->opcode == OP_ZEXT_I4) || (ins->opcode == OP_NOT_NULL) || (ins->opcode == OP_IL_SEQ_POINT))
+#define MONO_INS_IS_PCONST_NULL(ins) ((ins)->opcode == OP_PCONST && (ins)->inst_p0 == 0)
+
#define MONO_METHOD_IS_FINAL(m) (((m)->flags & METHOD_ATTRIBUTE_FINAL) || ((m)->klass && ((m)->klass->flags & TYPE_ATTRIBUTE_SEALED)))
guint real_offset;
GSList *seq_points;
+
+ // The MonoInst of the last sequence point for the current basic block.
MonoInst *last_seq_point;
+
+ // This will hold a list of last sequence points of incoming basic blocks
+ MonoInst **pred_seq_points;
+ guint num_pred_seq_points;
GSList *spill_slot_defs;
guint emulate_div : 1;
guint emulate_long_shift_opts : 1;
guint have_objc_get_selector : 1;
- guint have_generalized_imt_thunk : 1;
+ guint have_generalized_imt_trampoline : 1;
guint have_tls_get : 1;
guint have_tls_get_reg : 1;
guint have_liverange_ops: 1;
guint need_got_var : 1;
guint need_div_check : 1;
guint no_unaligned_access : 1;
+ guint disable_div_with_mul : 1;
int monitor_enter_adjustment;
int dyn_call_param_area;
} MonoBackend;
gint32 alias_removed;
gint32 loads_eliminated;
gint32 stores_eliminated;
+ gint32 optimized_divisions;
int methods_with_llvm;
int methods_without_llvm;
char *max_ratio_method;
void mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks);
MonoCompile *mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFlags flags, int parts, int aot_method_index);
void mono_destroy_compile (MonoCompile *cfg);
+void mono_empty_compile (MonoCompile *cfg);
MonoJitICallInfo *mono_find_jit_opcode_emulation (int opcode);
void mono_print_ins_index (int i, MonoInst *ins);
void mono_print_ins (MonoInst *ins);
gpointer mono_aot_get_unbox_trampoline (MonoMethod *method);
gpointer mono_aot_get_lazy_fetch_trampoline (guint32 slot);
gpointer mono_aot_get_static_rgctx_trampoline (gpointer ctx, gpointer addr);
-gpointer mono_aot_get_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem **imt_entries, int count, gpointer fail_tramp);
+gpointer mono_aot_get_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem **imt_entries, int count, gpointer fail_tramp);
gpointer mono_aot_get_gsharedvt_arg_trampoline(gpointer arg, gpointer addr);
guint8* mono_aot_get_unwind_info (MonoJitInfo *ji, guint32 *unwind_info_len);
guint32 mono_aot_method_hash (MonoMethod *method);
/* Delegates */
gpointer mini_get_delegate_arg (MonoMethod *method, gpointer method_ptr);
void mini_init_delegate (MonoDelegate *del);
+char* mono_get_delegate_virtual_invoke_impl_name (gboolean load_imt_reg, int offset);
gpointer mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method);
/* methods that must be provided by the arch-specific port */
gpointer mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len);
MonoMethod* mono_arch_find_imt_method (mgreg_t *regs, guint8 *code);
MonoVTable* mono_arch_find_static_call_vtable (mgreg_t *regs, guint8 *code);
-gpointer mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem **imt_entries, int count, gpointer fail_tramp);
+gpointer mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem **imt_entries, int count, gpointer fail_tramp);
void mono_arch_notify_pending_exc (MonoThreadInfo *info);
guint8* mono_arch_get_call_target (guint8 *code);
guint32 mono_arch_get_plt_info_offset (guint8 *plt_entry, mgreg_t *regs, guint8 *code);
MonoString **file, gint32 *line, gint32 *column);
void mono_set_cast_details (MonoClass *from, MonoClass *to);
-/* Installs a function which is called when the runtime encounters an unhandled exception.
- * This hook isn't expected to return.
- * If no hook has been installed, the runtime will print a message before aborting.
- */
-typedef void (*MonoUnhandledExceptionFunc) (MonoObject *exc, gpointer user_data);
-MONO_API void mono_install_unhandled_exception_hook (MonoUnhandledExceptionFunc func, gpointer user_data);
-void mono_invoke_unhandled_exception_hook (MonoObject *exc);
-
void mono_decompose_typechecks (MonoCompile *cfg);
/* Dominator/SSA methods */
void mono_compile_dominator_info (MonoCompile *cfg, int dom_flags);