X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fmini.h;h=03ef9f89f199d3c3e606e3cf92af06d78fe8c600;hb=59ddb222e093ce41efe12432a8f0a4ea0785c219;hp=25c208c8389efa27d5e2cc5b6e4ff02b3ea8f691;hpb=a9035d9e74a5a8365a6de602b7f5a7a0b3f4fc90;p=mono.git diff --git a/mono/mini/mini.h b/mono/mini/mini.h index 25c208c8389..03ef9f89f19 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -125,7 +125,7 @@ #endif /* Version number of the AOT file format */ -#define MONO_AOT_FILE_VERSION 134 +#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)) @@ -179,7 +179,7 @@ enum { 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; @@ -254,7 +254,7 @@ typedef struct MonoAotFileInfo /* 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; @@ -315,6 +315,8 @@ typedef struct MonoAotFileInfo guint32 trampoline_size [MONO_AOT_TRAMP_NUM]; /* The offset where the trampolines begin on a trampoline page */ guint32 tramp_page_code_offsets [MONO_AOT_TRAMP_NUM]; + /* GUID of aot compilation */ + guint8 aotid[16]; } MonoAotFileInfo; /* Number of symbols in the MonoAotFileInfo structure */ @@ -488,6 +490,7 @@ enum { #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)) @@ -504,6 +507,8 @@ enum { /* 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))) @@ -726,7 +731,13 @@ struct MonoBasicBlock { 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; @@ -1475,7 +1486,7 @@ typedef struct { 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; @@ -1487,6 +1498,7 @@ typedef struct { 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; @@ -1731,7 +1743,7 @@ typedef struct { guint8 *thunks; /* Offset between the start of code and the thunks area */ int thunks_offset; - guint32 exception_type; /* MONO_EXCEPTION_* */ + MonoExceptionType exception_type; /* MONO_EXCEPTION_* */ guint32 exception_data; char* exception_message; gpointer exception_ptr; @@ -1909,6 +1921,7 @@ typedef struct { gint32 alias_removed; gint32 loads_eliminated; gint32 stores_eliminated; + gint32 optimized_divisions; int methods_with_llvm; int methods_without_llvm; char *max_ratio_method; @@ -2119,7 +2132,7 @@ typedef struct { * Next sequence points and flags are required by the debugger agent. */ gboolean gen_sdb_seq_points; - gboolean gen_seq_points_compact_data; + gboolean no_seq_points_compact_data; /* * Setting single_imm_size should guarantee that each time managed code is compiled * the same instructions and registers are used, regardless of the size of used values. @@ -2426,6 +2439,7 @@ void mono_global_regalloc (MonoCompile *cfg); 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); @@ -2490,7 +2504,7 @@ gpointer mono_aot_get_trampoline_full (const char *name, MonoTrampInfo **o 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); @@ -2638,6 +2652,7 @@ void mono_if_conversion (MonoCompile *cfg); /* 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 */ @@ -2778,7 +2793,7 @@ gpointer mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, M 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); @@ -2862,14 +2877,6 @@ MonoBoolean ves_icall_get_frame_info (gint32 skip, MonoBoolean need_f 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); @@ -3145,6 +3152,8 @@ gboolean mono_jit_map_is_enabled (void); * Per-OS implementation functions. */ void mono_runtime_install_handlers (void); +gboolean mono_runtime_install_custom_handlers (const char *handlers); +void mono_runtime_install_custom_handlers_usage (void); void mono_runtime_cleanup_handlers (void); void mono_runtime_setup_stat_profiler (void); void mono_runtime_shutdown_stat_profiler (void);