#define LLVM_CHECK_VERSION(major,minor) 0
#endif
-/*
- * Whenever we are using mono's LLVM branch.
- * This can be used in if statements, code which references new definitions from the branch
- * still needs an #ifdef LLVM_MONO_BRANCH.
- */
-#ifdef LLVM_MONO_BRANCH
-#define IS_LLVM_MONO_BRANCH 1
-#else
-#define IS_LLVM_MONO_BRANCH 0
-#endif
-
#define NOT_IMPLEMENTED do { g_assert_not_reached (); } while (0)
/* for 32 bit systems */
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 95
+#define MONO_AOT_FILE_VERSION 96
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
/* These are used for sanity checking object layout problems when cross-compiling */
guint32 double_align, long_align, generic_tramp_num;
+ /* The page size used by trampoline pages */
+ guint32 tramp_page_size;
+ /* The offset where the trampolines begin on a trampoline page */
+ guint32 tramp_page_code_offsets [MONO_AOT_TRAMP_NUM];
} MonoAotFileInfo;
/* Per-domain information maintained by the JIT */
/* FIXME: Add more instructions */
/* 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))
+#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))
#define MONO_METHOD_IS_FINAL(m) (((m)->flags & METHOD_ATTRIBUTE_FINAL) || ((m)->klass && ((m)->klass->flags & TYPE_ATTRIBUTE_SEALED)))
extern const char *mono_build_date;
extern gboolean mono_do_signal_chaining;
extern gboolean mono_use_llvm;
+extern gboolean mono_do_single_method_regression;
+extern guint32 mono_single_method_regression_opt;
+extern MonoMethod *mono_current_single_method;
+extern GSList *mono_single_method_list;
+extern GHashTable *mono_single_method_hash;
#define INS_INFO(opcode) (&ins_info [((opcode) - OP_START - 1) * 4])
*/
MONO_INST_LMF = 32,
/* On loads, the source address points to a constant value */
- MONO_INST_CONSTANT_LOAD = 64,
+ MONO_INST_INVARIANT_LOAD = 64,
/* On variables, the variable needs GC tracking */
MONO_INST_GC_TRACK = 128,
/*
(t) == MONO_TRAMPOLINE_MONITOR_ENTER || \
(t) == MONO_TRAMPOLINE_MONITOR_EXIT)
+/* These trampolines receive an argument directly in a register */
+#define MONO_TRAMPOLINE_TYPE_HAS_ARG(t) \
+ ((t) == MONO_TRAMPOLINE_GENERIC_CLASS_INIT || \
+ (t) == MONO_TRAMPOLINE_MONITOR_ENTER || \
+ (t) == MONO_TRAMPOLINE_MONITOR_EXIT || \
+ (t) == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)
+
/* optimization flags */
#define OPTFLAG(id,shift,name,descr) MONO_OPT_ ## id = 1 << shift,
enum {
/* For native-to-managed wrappers, the saved old domain */
MonoInst *orig_domain_var;
+ MonoInst *lmf_var;
+ MonoInst *lmf_addr_var;
+
unsigned char *cil_start;
#ifdef __native_client_codegen__
/* this alloc is not aligned, native_code */
guint disable_vreg_to_lvreg : 1;
guint disable_deadce_vars : 1;
guint disable_out_of_line_bblocks : 1;
+ guint create_lmf_var : 1;
+ /*
+ * When this is set, the code to push/pop the LMF from the LMF stack is generated as IR
+ * instead of being generated in emit_prolog ()/emit_epilog ().
+ */
+ guint lmf_ir : 1;
+ /*
+ * Whenever to use the mono_lmf TLS variable instead of indirection through the
+ * mono_lmf_addr TLS variable.
+ */
+ guint lmf_ir_mono_lmf : 1;
guint gen_write_barriers : 1;
guint init_ref_vars : 1;
guint extend_live_ranges : 1;
guint compute_gc_maps : 1;
guint soft_breakpoints : 1;
guint arch_eh_jit_info : 1;
+ guint has_indirection : 1;
gpointer debug_info;
guint32 lmf_offset;
guint16 *intvars;
gint32 cas_linkdemand;
gint32 cas_demand_generation;
gint32 generic_virtual_invocations;
+ gint32 alias_found;
+ gint32 alias_removed;
+ gint32 loads_eliminated;
+ gint32 stores_eliminated;
int methods_with_llvm;
int methods_without_llvm;
char *max_ratio_method;
MonoInst* mono_get_domain_intrinsic (MonoCompile* cfg) MONO_INTERNAL;
MonoInst* mono_get_thread_intrinsic (MonoCompile* cfg) MONO_INTERNAL;
MonoInst* mono_get_lmf_intrinsic (MonoCompile* cfg) MONO_INTERNAL;
+MonoInst* mono_get_lmf_addr_intrinsic (MonoCompile* cfg) MONO_INTERNAL;
GList *mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, int sort_type) MONO_INTERNAL;
GList *mono_varlist_sort (MonoCompile *cfg, GList *list, int sort_type) MONO_INTERNAL;
void mono_analyze_liveness (MonoCompile *cfg) MONO_INTERNAL;
gpointer mini_get_vtable_trampoline (int slot_index) MONO_INTERNAL;
char* mono_get_generic_trampoline_name (MonoTrampolineType tramp_type) MONO_INTERNAL;
char* mono_get_rgctx_fetch_trampoline_name (int slot) MONO_INTERNAL;
+gpointer mini_get_nullified_class_init_trampoline (void) MONO_INTERNAL;
gpointer mini_add_method_trampoline (MonoMethod *orig_method, MonoMethod *m, gpointer compiled_method, gboolean add_static_rgctx_tramp, gboolean add_unbox_tramp) MONO_INTERNAL;
gboolean mini_jit_info_is_gsharedvt (MonoJitInfo *ji) MONO_INTERNAL;
MonoTrampInfo* mono_tramp_info_create (const char *name, guint8 *code, guint32 code_size, MonoJumpInfo *ji, GSList *unwind_ops) MONO_INTERNAL;
void mono_tramp_info_free (MonoTrampInfo *info) MONO_INTERNAL;
void mono_tramp_info_register (MonoTrampInfo *info) MONO_INTERNAL;
+int mini_exception_id_by_name (const char *name) MONO_INTERNAL;
int mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock,
MonoInst *return_var, GList *dont_inline, MonoInst **inline_args,
MonoInst *mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins) MONO_INTERNAL;
void mono_decompose_long_opts (MonoCompile *cfg) MONO_INTERNAL;
void mono_decompose_vtype_opts (MonoCompile *cfg) MONO_INTERNAL;
+void mono_decompose_vtype_opts_llvm (MonoCompile *cfg) MONO_INTERNAL;
void mono_decompose_array_access_opts (MonoCompile *cfg) MONO_INTERNAL;
void mono_decompose_soft_float (MonoCompile *cfg) MONO_INTERNAL;
void mono_handle_global_vregs (MonoCompile *cfg) MONO_INTERNAL;
gpointer mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot) MONO_INTERNAL;
gpointer mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_sig, MonoMethodSignature *gsharedvt_sig, MonoGenericSharingContext *gsctx, gboolean gsharedvt_in, gint32 vcall_offset, gboolean calli) MONO_INTERNAL;
gboolean mono_arch_opcode_needs_emulation (MonoCompile *cfg, int opcode) MONO_INTERNAL;
+gboolean mono_arch_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig) MONO_INTERNAL;
#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
gboolean mono_arch_is_soft_float (void) MONO_INTERNAL;
void mono_arch_skip_single_step (MonoContext *ctx) MONO_INTERNAL;
gpointer mono_arch_get_seq_point_info (MonoDomain *domain, guint8 *code) MONO_INTERNAL;
void mono_arch_setup_resume_sighandler_ctx (MonoContext *ctx, gpointer func) MONO_INTERNAL;
+void mono_arch_init_lmf_ext (MonoLMFExt *ext, gpointer prev_lmf) MONO_INTERNAL;
#endif
#ifdef USE_JUMP_TABLES
typedef gboolean (*MonoExceptionFrameWalk) (MonoMethod *method, gpointer ip, size_t native_offset, gboolean managed, gpointer user_data);
gboolean mono_exception_walk_trace (MonoException *ex, MonoExceptionFrameWalk func, gpointer user_data);
+void mono_restore_context (MonoContext *ctx) MONO_INTERNAL;
gboolean
mono_find_jit_info_ext (MonoDomain *domain, MonoJitTlsData *jit_tls,
void mono_ssa_deadce (MonoCompile *cfg) MONO_INTERNAL;
void mono_ssa_strength_reduction (MonoCompile *cfg) MONO_INTERNAL;
void mono_free_loop_info (MonoCompile *cfg) MONO_INTERNAL;
+void mono_ssa_loop_invariant_code_motion (MonoCompile *cfg) MONO_INTERNAL;
void mono_ssa_compute2 (MonoCompile *cfg);
void mono_ssa_remove2 (MonoCompile *cfg);
mono_local_cprop (MonoCompile *cfg);
extern void
mono_local_deadce (MonoCompile *cfg);
+void
+mono_local_alias_analysis (MonoCompile *cfg) MONO_INTERNAL;
/* CAS - stack walk */
MonoSecurityFrame* ves_icall_System_Security_SecurityFrame_GetSecurityFrame (gint32 skip) MONO_INTERNAL;
#ifdef MONO_ARCH_USE_SIGACTION
#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy, siginfo_t *info, void *context)
+#define SIG_HANDLER_FUNC(access, ftn) MONO_SIGNAL_HANDLER_FUNC (access, ftn, (int _dummy, siginfo_t *info, void *context))
#define SIG_HANDLER_PARAMS _dummy, info, context
#elif defined(HOST_WIN32)
#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy, EXCEPTION_POINTERS *info, void *context)
+#define SIG_HANDLER_FUNC(access, ftn) MONO_SIGNAL_HANDLER_FUNC (access, ftn, (int _dummy, EXCEPTION_POINTERS *info, void *context))
#define SIG_HANDLER_PARAMS _dummy, info, context
#elif defined(__HAIKU__)
#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy, void *userData, vregs regs)
+#define SIG_HANDLER_FUNC(access, ftn) MONO_SIGNAL_HANDLER_FUNC (access, ftn, (int _dummy, void *userData, vregs regs))
#define SIG_HANDLER_PARAMS _dummy, userData, regs
#else
#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy)
+#define SIG_HANDLER_FUNC(access, ftn) MONO_SIGNAL_HANDLER_FUNC (access, ftn, (int _dummy))
#define SIG_HANDLER_PARAMS _dummy
#endif
#define ARCH_HAVE_DELEGATE_TRAMPOLINES 0
#endif
-#ifdef MONO_ARCH_USE_OP_TAIL_CALL
-#define ARCH_USE_OP_TAIL_CALL 1
+#ifdef MONO_ARCH_HAVE_OP_TAIL_CALL
+#define ARCH_HAVE_OP_TAIL_CALL 1
#else
-#define ARCH_USE_OP_TAIL_CALL 0
+#define ARCH_HAVE_OP_TAIL_CALL 0
#endif
#ifndef MONO_ARCH_HAVE_TLS_GET
#define ARCH_HAVE_TLS_GET_REG 0
#endif
+#ifdef MONO_ARCH_EMULATE_MUL_DIV
+#define ARCH_EMULATE_MUL_DIV 1
+#else
+#define ARCH_EMULATE_MUL_DIV 0
+#endif
+
+#ifndef MONO_ARCH_MONITOR_ENTER_ADJUSTMENT
+#define MONO_ARCH_MONITOR_ENTER_ADJUSTMENT 1
+#endif
+
+#ifndef MONO_ARCH_DYN_CALL_PARAM_AREA
+#define MONO_ARCH_DYN_CALL_PARAM_AREA 0
+#endif
+
+#ifdef MONO_ARCH_HAVE_IMT
+#define ARCH_HAVE_IMT 1
+#else
+#define ARCH_HAVE_IMT 0
+#endif
+
+#ifdef MONO_ARCH_VARARG_ICALLS
+#define ARCH_VARARG_ICALLS 1
+#else
+#define ARCH_VARARG_ICALLS 0
+#endif
+
#endif /* __MONO_MINI_H__ */