#include "mono/metadata/class-internals.h"
#include "mono/metadata/object-internals.h"
#include <mono/metadata/profiler-private.h>
+#include <mono/utils/mono-compiler.h>
#include "mini-arch.h"
#include "regalloc.h"
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION "15"
+#define MONO_AOT_FILE_VERSION "19"
#if 1
#define mono_bitset_test_fast(set,n) (((guint32*)set)[2+(n)/32] & (1 << ((n) % 32)))
gint8 nesting;
gint8 loop_body_start;
+ /*
+ * Whenever the bblock is rarely executed so it should be emitted after
+ * the function epilog.
+ */
+ gboolean out_of_line;
+
/* use for liveness analysis */
MonoBitSet *gen_set;
MonoBitSet *kill_set;
/* The current symbolic register number, used in local register allocation. */
guint32 max_ireg, max_freg;
-
- /*
- * Whenever the bblock is rarely executed so it should be emitted after
- * the function epilog.
- */
- gboolean out_of_line;
};
/* BBlock flags */
MONO_PATCH_INFO_EXC_OVF,
MONO_PATCH_INFO_WRAPPER,
MONO_PATCH_INFO_GOT_OFFSET,
+ MONO_PATCH_INFO_DECLSEC,
MONO_PATCH_INFO_NONE
} MonoJumpInfoType;
} data;
};
+typedef enum {
+ MONO_TRAMPOLINE_GENERIC,
+ MONO_TRAMPOLINE_JUMP,
+ MONO_TRAMPOLINE_CLASS_INIT,
+ MONO_TRAMPOLINE_AOT,
+ MONO_TRAMPOLINE_NUM
+} MonoTrampolineType;
+
/* optimization flags: keep up to date with the name array in driver.c */
enum {
MONO_OPT_PEEPHOLE = 1 << 0,
};
/* Bit-fields in the MonoBasicBlock.region */
+#define MONO_REGION_TRY 0
#define MONO_REGION_FINALLY 16
#define MONO_REGION_CATCH 32
#define MONO_REGION_FAULT 64 /* Currently unused */
#define MONO_REGION_FILTER 128
+#define MONO_BBLOCK_IS_IN_REGION(bblock, regtype) (((bblock)->region & (0xf << 4)) == (regtype))
+
/*
* Control Flow Graph and compilation unit information
*/
gboolean need_lmf_area;
gboolean compile_aot;
gboolean got_var_allocated;
+ gboolean ret_var_is_local;
gpointer debug_info;
guint32 lmf_offset;
guint16 *intvars;
MonoProfileCoverageInfo *coverage_info;
MonoCompileArch arch;
+ guint32 exception_type; /* MONO_EXCEPTION_* */
+ guint32 exception_data;
+ char* exception_message;
#ifdef __ia64
guint8 ins, locals, outs; /* reg stack region sizes */
#endif /* __ia64 */
gulong inlined_methods;
gulong basic_blocks;
gulong max_basic_blocks;
+ gulong cas_declsec_check;
+ gulong cas_linkdemand_icall;
+ gulong cas_linkdemand_pinvoke;
+ gulong cas_linkdemand_aptc;
+ gulong cas_linkdemand;
+ gulong cas_demand_generation;
MonoMethod *max_ratio_method;
MonoMethod *biggest_method;
gboolean enabled;
BRANCH_UNDEF
};
+/* Implicit exceptions */
+enum {
+ MONO_EXC_INDEX_OUT_OF_RANGE,
+ MONO_EXC_OVERFLOW,
+ MONO_EXC_ARITHMETIC,
+ MONO_EXC_DIVIDE_BY_ZERO,
+ MONO_EXC_INVALID_CAST,
+ MONO_EXC_NULL_REF,
+ MONO_EXC_ARRAY_TYPE_MISMATCH,
+ MONO_EXC_INTRINS_NUM
+};
+
typedef void (*MonoInstFunc) (MonoInst *tree, gpointer data);
/* main function */
void mono_remove_patch_info (MonoCompile *cfg, int ip);
gpointer mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *patch_info, gboolean run_cctors);
MonoLMF** mono_get_lmf_addr (void);
+void mono_jit_thread_attach (MonoDomain *domain);
+guint32 mono_get_jit_tls_key (void);
+gint32 mono_get_lmf_tls_offset (void);
GList *mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, gboolean sort_end);
GList *mono_varlist_sort (MonoCompile *cfg, GList *list, int sort_type);
void mono_analyze_liveness (MonoCompile *cfg);
MonoJitInfo* mono_aot_get_method (MonoDomain *domain,
MonoMethod *method);
gboolean mono_aot_is_got_entry (guint8 *code, guint8 *addr);
+gboolean mono_aot_init_vtable (MonoVTable *vtable);
+gboolean mono_aot_get_cached_class_info (MonoClass *klass, MonoCachedClassInfo *res);
gboolean mono_method_blittable (MonoMethod *method);
gboolean mono_method_same_domain (MonoJitInfo *caller, MonoJitInfo *callee);
void mono_register_opcode_emulation (int opcode, const char* name, MonoMethodSignature *sig, gpointer func, gboolean no_throw);
MonoJitICallInfo *mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save);
gconstpointer mono_icall_get_wrapper (MonoJitICallInfo* callinfo);
+guint8 * mono_get_trampoline_code (MonoTrampolineType tramp_type);
gpointer mono_create_jump_trampoline (MonoDomain *domain,
MonoMethod *method,
gboolean add_sync_wrapper);
gpointer mono_create_class_init_trampoline (MonoVTable *vtable);
gpointer mono_create_jit_trampoline (MonoMethod *method);
+gpointer mono_create_jit_trampoline_from_token (MonoImage *image, guint32 token);
MonoVTable* mono_find_class_init_trampoline_by_addr (gconstpointer addr);
+
gboolean mono_running_on_valgrind (void);
void* mono_global_codeman_reserve (int size);
+gint32* mono_allocate_stack_slots (MonoCompile *cfg, guint32 *stack_size, guint32 *stack_align);
/* methods that must be provided by the arch-specific port */
void mono_arch_cpu_init (void);
gpointer mono_arch_get_rethrow_exception (void);
gpointer mono_arch_get_throw_exception_by_name (void);
gpointer mono_arch_get_throw_corlib_exception (void);
+guchar* mono_arch_create_trampoline_code (MonoTrampolineType tramp_type);
gpointer mono_arch_create_jit_trampoline (MonoMethod *method);
+gpointer mono_arch_create_jit_trampoline_from_token (MonoImage *image, guint32 token);
MonoJitInfo *mono_arch_create_jump_trampoline (MonoMethod *method);
gpointer mono_arch_create_class_init_trampoline(MonoVTable *vtable);
GList *mono_arch_get_allocatable_int_vars (MonoCompile *cfg);
gpointer mono_arch_get_restore_context (void);
gboolean mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only);
gpointer mono_arch_ip_from_context (void *sigctx);
+void mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext *ctx);
+void mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *ctx);
void mono_arch_flush_register_windows (void);
gboolean mono_arch_is_inst_imm (gint64 imm);
MonoInst* mono_arch_get_domain_intrinsic (MonoCompile* cfg);
gboolean mono_arch_is_int_overflow (void *sigctx, void *info);
void mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg);
guint32 mono_arch_get_patch_offset (guint8 *code);
+gpointer*mono_arch_get_vcall_slot_addr (guint8* code, gpointer *regs);
+gpointer*mono_arch_get_delegate_method_ptr_addr (guint8* code, gpointer *regs);
+void mono_arch_create_vars (MonoCompile *cfg);
/* Exception handling */
gboolean mono_handle_exception (MonoContext *ctx, gpointer obj,
MonoReflectionMethod **method,
gint32 *iloffset, gint32 *native_offset,
MonoString **file, gint32 *line, gint32 *column);
+MonoString *ves_icall_System_Exception_get_trace (MonoException *exc);
/* Dominator/SSA methods */
void mono_compile_dominator_info (MonoCompile *cfg, int dom_flags);
mono_perform_ssapre (MonoCompile *cfg);
/* CAS - stack walk */
-//MonoBoolean ves_icall_System_Security_SecurityFrame_GetSecurityFrameInformation (gint32 skip, MonoReflectionMethod **method, gint32 *flags);
MonoSecurityFrame* ves_icall_System_Security_SecurityFrame_GetSecurityFrame (gint32 skip);
MonoArray* ves_icall_System_Security_SecurityFrame_GetSecurityStack (gint32 skip);