#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 129
+#define MONO_AOT_FILE_VERSION 131
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
* Set on instructions during code emission which make calls, i.e. OP_CALL, OP_THROW.
* backend.pc_offset will be set to the pc offset at the end of the native call instructions.
*/
- MONO_INST_GC_CALLSITE = 128
+ MONO_INST_GC_CALLSITE = 128,
+ /* On comparisons, mark the branch following the condition as likely to be taken */
+ MONO_INST_LIKELY = 128,
};
#define inst_c0 data.op[0].const_val
* The current exception in flight
*/
guint32 thrown_exc;
+
+ /*
+ * The calling assembly in llvmonly mode.
+ */
+ MonoImage *calling_image;
} MonoJitTlsData;
/*
MONO_RGCTX_INFO_METHOD,
/* In llvmonly mode, this is a function descriptor */
MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
+ MONO_RGCTX_INFO_GSHAREDVT_OUT_WRAPPER,
MONO_RGCTX_INFO_CLASS_FIELD,
MONO_RGCTX_INFO_METHOD_RGCTX,
MONO_RGCTX_INFO_METHOD_CONTEXT,
MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT,
/* Same for calli, associated with a signature */
MONO_RGCTX_INFO_SIG_GSHAREDVT_OUT_TRAMPOLINE_CALLI,
+ MONO_RGCTX_INFO_SIG_GSHAREDVT_IN_TRAMPOLINE_CALLI,
/* One of MONO_GSHAREDVT_BOX_TYPE */
MONO_RGCTX_INFO_CLASS_BOX_TYPE,
/* Resolves to a MonoGSharedVtMethodRuntimeInfo */
* Same as MONO_RGCTX_INFO_CLASS_BOX_TYPE, but for the class
* which implements the method.
*/
- MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE
+ MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE,
} MonoRgctxInfoType;
typedef struct _MonoRuntimeGenericContextInfoTemplate {
gboolean need_rgctx_tramp;
} MonoDelegateTrampInfo;
+/*
+ * A function descriptor, which is a function address + argument pair.
+ * In llvm-only mode, these are used instead of trampolines to pass
+ * extra arguments to runtime functions/methods.
+ */
+typedef struct
+{
+ gpointer addr;
+ gpointer arg;
+} MonoFtnDesc;
+
typedef enum {
#define PATCH_INFO(a,b) MONO_PATCH_INFO_ ## a,
#include "patch-info.h"
#define OP_PADD_IMM OP_LADD_IMM
#define OP_PSUB_IMM OP_LSUB_IMM
#define OP_PAND_IMM OP_LAND_IMM
+#define OP_PXOR_IMM OP_LXOR_IMM
#define OP_PSUB OP_LSUB
#define OP_PMUL OP_LMUL
#define OP_PMUL_IMM OP_LMUL_IMM
#define OP_PADD_IMM OP_IADD_IMM
#define OP_PSUB_IMM OP_ISUB_IMM
#define OP_PAND_IMM OP_IAND_IMM
+#define OP_PXOR_IMM OP_IXOR_IMM
#define OP_PSUB OP_ISUB
#define OP_PMUL OP_IMUL
#define OP_PMUL_IMM OP_IMUL_IMM
MonoDomain* mini_init (const char *filename, const char *runtime_version);
void mini_cleanup (MonoDomain *domain);
MONO_API MonoDebugOptions *mini_get_debug_options (void);
+MONO_API gboolean mini_parse_debug_option (const char *option);
/* helper methods */
void mini_jit_init (void);
void mini_jit_cleanup (void);
void mono_disable_optimizations (guint32 opts);
void mono_set_optimizations (guint32 opts);
+void mono_set_bisect_methods (guint32 opt, const char *method_list_filename);
guint32 mono_get_optimizations_for_method (MonoMethod *method, guint32 default_opt);
+char* mono_opt_descr (guint32 flags);
void mono_set_verbose_level (guint32 level);
MonoJumpInfoToken* mono_jump_info_token_new (MonoMemPool *mp, MonoImage *image, guint32 token);
MonoJumpInfoToken* mono_jump_info_token_new2 (MonoMemPool *mp, MonoImage *image, guint32 token, MonoGenericContext *context);
guint32 mono_aot_find_method_index (MonoMethod *method);
void mono_aot_init_llvm_method (gpointer aot_module, guint32 method_index);
void mono_aot_init_gshared_method_this (gpointer aot_module, guint32 method_index, MonoObject *this_ins);
-void mono_aot_init_gshared_method_rgctx (gpointer aot_module, guint32 method_index, MonoMethodRuntimeGenericContext *rgctx);
+void mono_aot_init_gshared_method_mrgctx (gpointer aot_module, guint32 method_index, MonoMethodRuntimeGenericContext *rgctx);
+void mono_aot_init_gshared_method_vtable (gpointer aot_module, guint32 method_index, MonoVTable *vtable);
/* This is an exported function */
MONO_API void mono_aot_register_module (gpointer *aot_info);
void mono_monitor_enter_v4_trampoline (mgreg_t *regs, guint8 *code, MonoObject *obj, guint8 *tramp);
void mono_monitor_exit_trampoline (mgreg_t *regs, guint8 *code, MonoObject *obj, guint8 *tramp);
gconstpointer mono_get_trampoline_func (MonoTrampolineType tramp_type);
-gpointer mini_get_vtable_trampoline (int slot_index);
+gpointer mini_get_vtable_trampoline (MonoVTable *vt, int slot_index);
const char* mono_get_generic_trampoline_simple_name (MonoTrampolineType tramp_type);
char* mono_get_generic_trampoline_name (MonoTrampolineType tramp_type);
char* mono_get_rgctx_fetch_trampoline_name (int slot);
gpointer mini_get_breakpoint_trampoline (void);
gpointer mini_add_method_trampoline (MonoMethod *m, gpointer compiled_method, gboolean add_static_rgctx_tramp, gboolean add_unbox_tramp);
gpointer mini_add_method_wrappers_llvmonly (MonoMethod *m, gpointer compiled_method, gboolean caller_gsharedvt, gboolean add_unbox_tramp, gpointer *out_arg);
-gpointer mini_create_llvmonly_ftndesc (gpointer addr, gpointer arg);
gboolean mini_jit_info_is_gsharedvt (MonoJitInfo *ji);
gpointer* mini_resolve_imt_method (MonoVTable *vt, gpointer *vtable_slot, MonoMethod *imt_method, MonoMethod **impl_method, gpointer *out_aot_addr,
gboolean *out_need_rgctx_tramp, MonoMethod **variant_iface);
+MonoFtnDesc *mini_create_llvmonly_ftndesc (MonoDomain *domain, gpointer addr, gpointer arg);
gboolean mono_running_on_valgrind (void);
void* mono_global_codeman_reserve (int size);
void mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg);
guint32 mono_arch_get_patch_offset (guint8 *code);
gpointer*mono_arch_get_delegate_method_ptr_addr (guint8* code, mgreg_t *regs);
-void mono_arch_create_vars (MonoCompile *cfg);
+void mono_arch_create_vars (MonoCompile *cfg) MONO_LLVM_INTERNAL;
void mono_arch_save_unwind_info (MonoCompile *cfg);
void mono_arch_register_lowlevel_calls (void);
gpointer mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr);