Avoid compiling libmonoruntime and libmono when --disable-boehm is used.
[mono.git] / mono / mini / mini.h
index b32b638a2126ccad5baeac20d87d802c9d0b5289..e9ab524ff1314e03928cda75cd04e7acbae1911e 100644 (file)
@@ -1,9 +1,17 @@
+/*
+ * Copyright 2002-2003 Ximian Inc
+ * Copyright 2003-2011 Novell Inc
+ * Copyright 2011 Xamarin Inc
+ */
 #ifndef __MONO_MINI_H__
 #define __MONO_MINI_H__
 
 #include "config.h"
 #include <glib.h>
 #include <signal.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #include <mono/metadata/loader.h>
 #include <mono/metadata/mempool.h>
 #include <mono/utils/monobitset.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/utils/mono-compiler.h>
+#include <mono/utils/mono-machine.h>
+#include <mono/utils/mono-stack-unwinding.h>
+#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-tls.h>
 
 #define MONO_BREAKPOINT_ARRAY_SIZE 64
 
-/* C type matching the size of a machine register. Not always the same as 'int' */
-/* Note that member 'p' of MonoInst must be the same type, as OP_PCONST is defined
- * as one of the OP_ICONST types, so inst_c0 must be the same as inst_p0
- */
-#if SIZEOF_REGISTER == 4
-typedef gint32 mgreg_t;
-#elif SIZEOF_REGISTER == 8
-typedef gint64 mgreg_t;
-#endif
-
 #include "mini-arch.h"
 #include "regalloc.h"
 #include "declsec.h"
@@ -48,6 +50,11 @@ typedef gint64 mgreg_t;
 #define G_MININT32 (-G_MAXINT32 - 1)
 #endif
 
+#ifndef __GNUC__
+/*#define __alignof__(a) sizeof(a)*/
+#define __alignof__(type) G_STRUCT_OFFSET(struct { char c; type x; }, x)
+#endif
+
 #if DISABLE_LOGGING
 #define MINI_DEBUG(level,limit,code)
 #else
@@ -111,7 +118,7 @@ typedef gint64 mgreg_t;
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION "70"
+#define MONO_AOT_FILE_VERSION 82
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
@@ -119,17 +126,35 @@ typedef gint64 mgreg_t;
 /* Constants used to encode different types of methods in AOT */
 enum {
        MONO_AOT_METHODREF_MIN = 240,
-       /* Method encoded using its name */
-       MONO_AOT_METHODREF_WRAPPER_NAME = 250,
        /* Runtime provided methods on arrays */
-       MONO_AOT_METHODREF_ARRAY = 251,
-       MONO_AOT_METHODREF_NO_AOT_TRAMPOLINE = 252,
+       MONO_AOT_METHODREF_ARRAY = 250,
+       MONO_AOT_METHODREF_NO_AOT_TRAMPOLINE = 251,
        /* Wrappers */
-       MONO_AOT_METHODREF_WRAPPER = 253,
+       MONO_AOT_METHODREF_WRAPPER = 252,
        /* Methods on generic instances */
-       MONO_AOT_METHODREF_GINST = 254,
+       MONO_AOT_METHODREF_GINST = 253,
        /* Methods resolve using a METHODSPEC token */
-       MONO_AOT_METHODREF_METHODSPEC = 255,
+       MONO_AOT_METHODREF_METHODSPEC = 254,
+};
+
+/* Constants used to encode different types of types in AOT */
+enum {
+       /* typedef index */
+       MONO_AOT_TYPEREF_TYPEDEF_INDEX = 1,
+       /* typedef index + image index */
+       MONO_AOT_TYPEREF_TYPEDEF_INDEX_IMAGE = 2,
+       /* typespec token */
+       MONO_AOT_TYPEREF_TYPESPEC_TOKEN = 3,
+       /* generic inst */
+       MONO_AOT_TYPEREF_GINST = 4,
+       /* type/method variable */
+       MONO_AOT_TYPEREF_VAR = 5,
+       /* array */
+       MONO_AOT_TYPEREF_ARRAY = 6,
+       /* blob index of the type encoding */
+       MONO_AOT_TYPEREF_BLOB_INDEX = 7,
+       /* ptr */
+       MONO_AOT_TYPEREF_PTR = 8
 };
 
 /* Trampolines which we have a lot of */
@@ -149,19 +174,85 @@ typedef enum {
 /* This structure is stored in the AOT file */
 typedef struct MonoAotFileInfo
 {
+       /* The version number of the AOT file format, should match MONO_AOT_FILE_VERSION */
+       guint32 version;
+       /* For alignment */
+       guint32 dummy;
+
+       /* All the pointers should be at the start to avoid alignment problems */
+
+       /* Mono's Global Offset Table */
+       gpointer got;
+       /* Compiled code for methods */
+       gpointer methods;
+       /* Mono EH Frame created by llc when using LLVM */
+       gpointer mono_eh_frame;
+       /* Data blob */
+       gpointer blob;
+       gpointer class_name_table;
+       gpointer class_info_offsets;
+       gpointer method_info_offsets;
+       gpointer ex_info_offsets;
+       gpointer code_offsets;
+       gpointer extra_method_info_offsets;
+       gpointer extra_method_table;
+       gpointer got_info_offsets;
+       gpointer methods_end;
+       gpointer unwind_info;
+       gpointer mem_end;
+       gpointer image_table;
+       /* Start of Mono's Program Linkage Table */
+       gpointer plt;
+       /* End of Mono's Program Linkage Table */
+       gpointer plt_end;
+       /* The GUID of the assembly which the AOT image was generated from */
+       gpointer assembly_guid;
+       /*
+        * The runtime version string for AOT images generated using 'bind-to-runtime-version',
+        * NULL otherwise.
+        */
+       gpointer runtime_version;
+       /* Blocks of various kinds of trampolines */
+       gpointer specific_trampolines;
+       gpointer static_rgctx_trampolines;
+       gpointer imt_thunks;
+       /*
+        * The end of LLVM generated thumb code, or NULL.
+        */
+       gpointer thumb_end;
+       /* In static mode, points to a table of global symbols for trampolines etc */
+       gpointer globals;
+       /* Points to a string containing the assembly name*/
+       gpointer assembly_name;
+       /* Points to a table mapping methods to their unbox trampolines */
+       gpointer unbox_trampolines;
+       /* Points to the end of the previous table */
+       gpointer unbox_trampolines_end;
+
+       /* The index of the first GOT slot used by the PLT */
        guint32 plt_got_offset_base;
+       /* Number of entries in the GOT */
        guint32 got_size;
+       /* Number of entries in the PLT */
        guint32 plt_size;
+       /* Number of methods */
        guint32 nmethods;
+       /* A union of MonoAotFileFlags */
        guint32 flags;
        /* Optimization flags used to compile the module */
        guint32 opts;
        /* Index of the blob entry holding the GC used by this module */
        gint32 gc_name_index;
 
+       /* Number of trampolines */
        guint32 num_trampolines [MONO_AOT_TRAMP_NUM];
+       /* The indexes of the first GOT slots used by the trampolines */
        guint32 trampoline_got_offset_base [MONO_AOT_TRAMP_NUM];
+       /* The size of one trampoline */
        guint32 trampoline_size [MONO_AOT_TRAMP_NUM];
+
+       /* These are used for sanity checking object layout problems when cross-compiling */
+       guint32 double_align, long_align;
 } MonoAotFileInfo;
 
 /* Per-domain information maintained by the JIT */
@@ -197,48 +288,21 @@ typedef struct {
 
 #define domain_jit_info(domain) ((MonoJitDomainInfo*)((domain)->runtime_info))
 
+/* Contains a list of ips which needs to be patched when a method is compiled */
+typedef struct {
+       GSList *list;
+} MonoJumpList;
+
 /* Arch-specific */
 typedef struct {
        int dummy;
 } MonoDynCallInfo;
 
 /*
- * Possible frame types returned by the stack walker.
+ * Information about a stack frame.
+ * FIXME This typedef exists only to avoid tons of code rewriting
  */
-typedef enum {
-       /* Normal managed frames */
-       FRAME_TYPE_MANAGED = 0,
-       /* Pseudo frame marking the start of a method invocation done by the soft debugger */
-       FRAME_TYPE_DEBUGGER_INVOKE = 1,
-       /* Frame for transitioning to native code */
-       FRAME_TYPE_MANAGED_TO_NATIVE = 2,
-       FRAME_TYPE_SENTINEL = 3
-} StackFrameType;
-
-/*
- * Information about a stack frame
- */
-typedef struct {
-       StackFrameType type;
-       /* 
-        * For FRAME_TYPE_MANAGED, otherwise NULL.
-        */
-       MonoJitInfo *ji;
-       /*
-        * Same as ji->method.
-        */
-       MonoMethod *method;
-       /*
-        * If ji->method is a gshared method, this is the actual method instance.
-        */
-       MonoMethod *actual_method;
-       /* The domain containing the code executed by this frame */
-       MonoDomain *domain;
-       gboolean managed;
-       int native_offset;
-       int il_offset;
-       gpointer lmf;
-} StackFrameInfo;
+typedef MonoStackFrameInfo StackFrameInfo;
 
 typedef struct {
        int il_offset, native_offset;
@@ -404,7 +468,7 @@ typedef struct MonoLMF MonoLMF;
 typedef struct MonoSpillInfo MonoSpillInfo;
 typedef struct MonoTraceSpec MonoTraceSpec;
 
-extern guint32 mono_jit_tls_id;
+extern MonoNativeTlsKey mono_jit_tls_id;
 extern MonoTraceSpec *mono_jit_trace_calls;
 extern gboolean mono_break_on_exc;
 extern int mono_exc_esp_offset;
@@ -444,6 +508,26 @@ struct MonoSpillInfo {
        int offset;
 };
 
+/*
+ * Information about a call site for the GC map creation code
+ */
+typedef struct {
+       /* The next offset after the call instruction */
+       int pc_offset;
+       /* The basic block containing the call site */
+       MonoBasicBlock *bb;
+       /* 
+        * The set of variables live at the call site.
+        * Has length cfg->num_varinfo in bits.
+        */
+       guint8 *liveness;
+       /*
+        * List of OP_GC_PARAM_SLOT_LIVENESS_DEF instructions defining the param slots
+        * used by this call.
+        */
+       GSList *param_slots;
+} GCCallSite;
+
 /*
  * The IR-level extended basic block.  
  *
@@ -487,7 +571,10 @@ struct MonoBasicBlock {
 
        /* The offset of the generated code, used for fixups */
        int native_offset;
+       /* The length of the generated code, doesn't include alignment padding */
        int native_length;
+       /* The real native offset, which includes alignment padding too */
+       int real_native_offset;
        int max_offset;
        int max_length;
 
@@ -551,6 +638,11 @@ struct MonoBasicBlock {
        GSList *seq_points;
        MonoInst *last_seq_point;
 
+       GSList *spill_slot_defs;
+
+       /* List of call sites in this bblock sorted by pc_offset */
+       GSList *gc_callsites;
+
        /*
         * The region encodes whether the basic block is inside
         * a finally, catch, filter or none of these.
@@ -670,6 +762,8 @@ struct MonoInst {
                gboolean record_cast_details; /* For CEE_CASTCLASS */
                MonoInst *spill_var; /* for OP_ICONV_TO_R8_RAW and OP_FCONV_TO_R8_X */
                guint16 source_opcode; /*OP_XCONV_R8_TO_I4 needs to know which op was used to do proper widening*/
+               int pc_offset; /* OP_GC_LIVERANGE_START/END */
+               int memory_barrier_kind; /* see mono-memory-model.h for valid values */
        } backend;
        
        MonoClass *klass;
@@ -701,6 +795,7 @@ struct MonoCallInst {
        regmask_t used_fregs;
        GSList *out_ireg_args;
        GSList *out_freg_args;
+       GSList *outarg_vts;
 #ifdef ENABLE_LLVM
        LLVMCallInfo *cinfo;
        int rgctx_arg_reg, imt_arg_reg;
@@ -736,8 +831,20 @@ enum {
        MONO_INST_NORANGECHECK   = 16,
        /* On loads, the source address can be null */
        MONO_INST_FAULT = 32,
+       /* 
+        * On variables, identifies LMF variables. These variables have a dummy type (int), but
+        * require stack space for a MonoLMF struct.
+        */
+       MONO_INST_LMF = 32,
        /* On loads, the source address points to a constant value */
-       MONO_INST_CONSTANT_LOAD = 64
+       MONO_INST_CONSTANT_LOAD = 64,
+       /* On variables, the variable needs GC tracking */
+       MONO_INST_GC_TRACK = 128,
+       /*
+        * 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
 };
 
 #define inst_c0 data.op[0].const_val
@@ -876,11 +983,17 @@ typedef struct {
        /* Stores state needed by handler block with a guard */
        MonoContext     ex_ctx;
        ResumeState resume_state;
-       /* handle block return address */
+
+       /*Variabled use to implement handler blocks (finally/catch/etc) guards during interruption*/
+       /* handler block return address */
        gpointer handler_block_return_address;
-       /* handler block been guarded */
+
+       /* handler block been guarded. It's safe to store this even for dynamic methods since there
+       is an activation on stack making sure it will remain alive.*/
        MonoJitExceptionInfo *handler_block;
 
+       /* context to be used by the guard trampoline when resuming interruption.*/
+       MonoContext handler_block_context;
        /* 
         * Stores the state at the exception throw site to be used by mono_stack_walk ()
         * when it is called from profiler functions during exception handling.
@@ -898,6 +1011,48 @@ typedef struct {
        MonoContext ctx; /* if debugger_invoke is TRUE */
 } MonoLMFExt;
 
+/* Generic sharing */
+typedef enum {
+       MONO_RGCTX_INFO_STATIC_DATA,
+       MONO_RGCTX_INFO_KLASS,
+       MONO_RGCTX_INFO_VTABLE,
+       MONO_RGCTX_INFO_TYPE,
+       MONO_RGCTX_INFO_REFLECTION_TYPE,
+       MONO_RGCTX_INFO_METHOD,
+       MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
+       MONO_RGCTX_INFO_CLASS_FIELD,
+       MONO_RGCTX_INFO_METHOD_RGCTX,
+       MONO_RGCTX_INFO_METHOD_CONTEXT,
+       MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK,
+       MONO_RGCTX_INFO_METHOD_DELEGATE_CODE,
+       MONO_RGCTX_INFO_CAST_CACHE
+} MonoRgctxInfoType;
+
+typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
+       MonoRgctxInfoType info_type;
+       gpointer data;
+       struct _MonoRuntimeGenericContextOtherInfoTemplate *next;
+} MonoRuntimeGenericContextOtherInfoTemplate;
+
+typedef struct {
+       MonoClass *next_subclass;
+       MonoRuntimeGenericContextOtherInfoTemplate *other_infos;
+       GSList *method_templates;
+} MonoRuntimeGenericContextTemplate;
+
+typedef struct {
+       MonoVTable *class_vtable; /* must be the first element */
+       MonoGenericInst *method_inst;
+       gpointer infos [MONO_ZERO_LEN_ARRAY];
+} MonoMethodRuntimeGenericContext;
+
+#define MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT (sizeof (MonoMethodRuntimeGenericContext) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
+
+#define MONO_RGCTX_SLOT_MAKE_RGCTX(i)  (i)
+#define MONO_RGCTX_SLOT_MAKE_MRGCTX(i) ((i) | 0x80000000)
+#define MONO_RGCTX_SLOT_INDEX(s)       ((s) & 0x7fffffff)
+#define MONO_RGCTX_SLOT_IS_MRGCTX(s)   (((s) & 0x80000000) ? TRUE : FALSE)
+
 typedef enum {
 #define PATCH_INFO(a,b) MONO_PATCH_INFO_ ## a,
 #include "patch-info.h"
@@ -967,7 +1122,7 @@ struct MonoJumpInfoRgctxEntry {
        MonoMethod *method;
        gboolean in_mrgctx;
        MonoJumpInfo *data; /* describes the data to be loaded */
-       int info_type;
+       MonoRgctxInfoType info_type;
 };
 
 typedef enum {
@@ -1015,11 +1170,15 @@ enum {
 #define MONO_BBLOCK_IS_IN_REGION(bblock, regtype) (((bblock)->region & (0xf << 4)) == (regtype))
 
 #define MONO_REGION_FLAGS(region) ((region) & 0x7)
+#define MONO_REGION_CLAUSE_INDEX(region) (((region) >> 8) - 1)
 
 #define get_vreg_to_inst(cfg, vreg) ((vreg) < (cfg)->vreg_to_inst_len ? (cfg)->vreg_to_inst [(vreg)] : NULL)
 
 #define vreg_is_volatile(cfg, vreg) (G_UNLIKELY (get_vreg_to_inst ((cfg), (vreg)) && (get_vreg_to_inst ((cfg), (vreg))->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT))))
 
+#define vreg_is_ref(cfg, vreg) ((vreg) < (cfg)->vreg_is_ref_len ? (cfg)->vreg_is_ref [(vreg)] : 0)
+#define vreg_is_mp(cfg, vreg) ((vreg) < (cfg)->vreg_is_mp_len ? (cfg)->vreg_is_mp [(vreg)] : 0)
+
 /*
  * Control Flow Graph and compilation unit information
  */
@@ -1048,7 +1207,6 @@ typedef struct {
        gint             stack_offset;
        gint             max_ireg;
        gint             cil_offset_to_bb_len;
-       gint             locals_min_stack_offset, locals_max_stack_offset;
        MonoRegState    *rs;
        MonoSpillInfo   *spill_info [16]; /* machine register spills */
        gint             spill_count;
@@ -1155,6 +1313,9 @@ typedef struct {
        guint            keep_cil_nops : 1;
        guint            gen_seq_points : 1;
        guint            explicit_null_checks : 1;
+       guint            compute_gc_maps : 1;
+       guint            soft_breakpoints : 1;
+       guint            arch_eh_jit_info : 1;
        gpointer         debug_info;
        guint32          lmf_offset;
     guint16          *intvars;
@@ -1182,6 +1343,20 @@ typedef struct {
        /* Size of above array */
        guint32 vreg_to_inst_len;
 
+       /* Marks vregs which hold a GC ref */
+       /* FIXME: Use a bitmap */
+       gboolean *vreg_is_ref;
+
+       /* Size of above array */
+       guint32 vreg_is_ref_len;
+
+       /* Marks vregs which hold a managed pointer */
+       /* FIXME: Use a bitmap */
+       gboolean *vreg_is_mp;
+
+       /* Size of above array */
+       guint32 vreg_is_mp_len;
+
        /* 
         * The original method to compile, differs from 'method' when doing generic
         * sharing.
@@ -1230,12 +1405,48 @@ typedef struct {
        guint32 got_offset, ex_info_offset, method_info_offset;
        /* Symbol used to refer to this method in generated assembly */
        char *asm_symbol;
+       char *llvm_method_name;
 
        MonoJitExceptionInfo *llvm_ex_info;
        guint32 llvm_ex_info_len;
        int llvm_this_reg, llvm_this_offset;
 
        GSList *try_block_holes;
+
+       /* DWARF location list for 'this' */
+       GSList *this_loclist;
+
+       /* DWARF location list for 'rgctx_var' */
+       GSList *rgctx_loclist;
+
+       /* GC Maps */
+   
+       /* The offsets of the locals area relative to the frame pointer */
+       gint locals_min_stack_offset, locals_max_stack_offset;
+
+       /* The final CFA rule at the end of the prolog */
+       int cfa_reg, cfa_offset;
+
+       /* Points to a MonoCompileGC */
+       gpointer gc_info;
+
+       /*
+        * The encoded GC map along with its size. This contains binary data so it can be saved in an AOT
+        * image etc, but it requires a 4 byte alignment.
+        */
+       guint8 *gc_map;
+       guint32 gc_map_size;
+
+       /* Stats */
+       int stat_allocate_var;
+       int stat_locals_stack_size;
+       int stat_basic_blocks;
+       int stat_cil_code_size;
+       int stat_n_regvars;
+       int stat_inlineable_methods;
+       int stat_inlined_methods;
+       int stat_cas_demand_generation;
+       int stat_code_reallocs;
 } MonoCompile;
 
 typedef enum {
@@ -1251,30 +1462,30 @@ typedef enum {
 } MonoCompileFlags;
 
 typedef struct {
-       gulong methods_compiled;
-       gulong methods_aot;
-       gulong methods_lookups;
-       gulong allocate_var;
-       gulong cil_code_size;
-       gulong native_code_size;
-       gulong code_reallocs;
-       gulong max_code_size_ratio;
-       gulong biggest_method_size;
-       gulong allocated_code_size;
-       gulong inlineable_methods;
-       gulong inlined_methods;
-       gulong basic_blocks;
-       gulong max_basic_blocks;
-       gulong locals_stack_size;
-       gulong regvars;
-       gulong cas_declsec_check;
-       gulong cas_linkdemand_icall;
-       gulong cas_linkdemand_pinvoke;
-       gulong cas_linkdemand_aptc;
-       gulong cas_linkdemand;
-       gulong cas_demand_generation;
-       gulong generic_virtual_invocations;
-    int methods_with_llvm;
+       gint32 methods_compiled;
+       gint32 methods_aot;
+       gint32 methods_lookups;
+       gint32 allocate_var;
+       gint32 cil_code_size;
+       gint32 native_code_size;
+       gint32 code_reallocs;
+       gint32 max_code_size_ratio;
+       gint32 biggest_method_size;
+       gint32 allocated_code_size;
+       gint32 inlineable_methods;
+       gint32 inlined_methods;
+       gint32 basic_blocks;
+       gint32 max_basic_blocks;
+       gint32 locals_stack_size;
+       gint32 regvars;
+       gint32 cas_declsec_check;
+       gint32 cas_linkdemand_icall;
+       gint32 cas_linkdemand_pinvoke;
+       gint32 cas_linkdemand_aptc;
+       gint32 cas_linkdemand;
+       gint32 cas_demand_generation;
+       gint32 generic_virtual_invocations;
+       int methods_with_llvm;
        int methods_without_llvm;
        char *max_ratio_method;
        char *biggest_method;
@@ -1350,7 +1561,7 @@ enum {
 #endif
 
 /* Opcodes to load/store regsize quantities */
-#if defined (__mono_ilp32__) || (defined(__native_client_codegen__) && defined(TARGET_AMD64))
+#if defined (__mono_ilp32__)
 #define OP_LOADR_MEMBASE OP_LOADI8_MEMBASE
 #define OP_STORER_MEMBASE_REG OP_STOREI8_MEMBASE_REG
 #else
@@ -1429,6 +1640,7 @@ typedef struct {
        gboolean mdb_optimizations;
        gboolean no_gdb_backtrace;
        gboolean suspend_on_sigsegv;
+       gboolean suspend_on_unhandled;
        gboolean dyn_runtime_invoke;
        gboolean gdb;
        gboolean gen_seq_points;
@@ -1438,6 +1650,18 @@ typedef struct {
         * debugging of the stack marking code in the GC.
         */
        gboolean init_stacks;
+
+       /*
+        * Whenever to implement single stepping and breakpoints without signals in the
+        * soft debugger. This is useful on platforms without signals, like the ps3, or during
+        * runtime debugging, since it avoids SIGSEGVs when a single step location or breakpoint
+        * is hit.
+        */
+       gboolean soft_breakpoints;
+       /*
+        * Whenever to break in the debugger using G_BREAKPOINT on unhandled exceptions.
+        */
+       gboolean break_on_exc;
 } MonoDebugOptions;
 
 enum {
@@ -1521,6 +1745,8 @@ char*       mono_get_runtime_build_info    (void) MONO_INTERNAL;
 
 /* helper methods */
 void      mono_disable_optimizations       (guint32 opts) MONO_INTERNAL;
+void      mono_set_optimizations           (guint32 opts) MONO_INTERNAL;
+void      mono_set_verbose_level           (guint32 level) MONO_INTERNAL;
 MonoJumpInfoToken* mono_jump_info_token_new (MonoMemPool *mp, MonoImage *image, guint32 token) MONO_INTERNAL;
 MonoJumpInfoToken* mono_jump_info_token_new2 (MonoMemPool *mp, MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
 MonoInst* mono_find_spvar_for_region        (MonoCompile *cfg, int region) MONO_INTERNAL;
@@ -1549,6 +1775,11 @@ guint32   mono_alloc_ireg                   (MonoCompile *cfg) MONO_LLVM_INTERNA
 guint32   mono_alloc_freg                   (MonoCompile *cfg) MONO_LLVM_INTERNAL;
 guint32   mono_alloc_preg                   (MonoCompile *cfg) MONO_LLVM_INTERNAL;
 guint32   mono_alloc_dreg                   (MonoCompile *cfg, MonoStackType stack_type) MONO_INTERNAL;
+guint32   mono_alloc_ireg_ref               (MonoCompile *cfg) MONO_LLVM_INTERNAL;
+guint32   mono_alloc_ireg_mp                (MonoCompile *cfg) MONO_LLVM_INTERNAL;
+guint32   mono_alloc_ireg_copy              (MonoCompile *cfg, guint32 vreg) MONO_LLVM_INTERNAL;
+void      mono_mark_vreg_as_ref             (MonoCompile *cfg, int vreg) MONO_INTERNAL;
+void      mono_mark_vreg_as_mp              (MonoCompile *cfg, int vreg) MONO_INTERNAL;
 
 void      mono_link_bblock                  (MonoCompile *cfg, MonoBasicBlock *from, MonoBasicBlock* to) MONO_INTERNAL;
 void      mono_unlink_bblock                (MonoCompile *cfg, MonoBasicBlock *from, MonoBasicBlock* to) MONO_INTERNAL;
@@ -1575,7 +1806,7 @@ guint     mono_type_to_store_membase        (MonoCompile *cfg, MonoType *type) M
 guint     mini_type_to_stind                (MonoCompile* cfg, MonoType *type) MONO_INTERNAL;
 guint32   mono_reverse_branch_op            (guint32 opcode) MONO_INTERNAL;
 void      mono_disassemble_code             (MonoCompile *cfg, guint8 *code, int size, char *id) MONO_INTERNAL;
-void      mono_add_patch_info               (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target) MONO_INTERNAL;
+void      mono_add_patch_info               (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target) MONO_LLVM_INTERNAL;
 void      mono_remove_patch_info            (MonoCompile *cfg, int ip) MONO_INTERNAL;
 MonoJumpInfo* mono_patch_info_dup_mp        (MonoMemPool *mp, MonoJumpInfo *patch_info) MONO_INTERNAL;
 guint     mono_patch_info_hash (gconstpointer data) MONO_INTERNAL;
@@ -1589,7 +1820,7 @@ MonoLMF * mono_get_lmf                      (void) MONO_INTERNAL;
 MonoLMF** mono_get_lmf_addr                 (void) MONO_INTERNAL;
 void      mono_set_lmf                      (MonoLMF *lmf) MONO_INTERNAL;
 void      mono_jit_thread_attach            (MonoDomain *domain);
-guint32   mono_get_jit_tls_key              (void) MONO_INTERNAL;
+MonoNativeTlsKey mono_get_jit_tls_key       (void) MONO_INTERNAL;
 gint32    mono_get_jit_tls_offset           (void) MONO_INTERNAL;
 gint32    mono_get_lmf_tls_offset           (void) MONO_INTERNAL;
 gint32    mono_get_lmf_addr_tls_offset      (void) MONO_INTERNAL;
@@ -1599,6 +1830,7 @@ MonoInst* mono_get_thread_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;
+void      mono_analyze_liveness_gc          (MonoCompile *cfg) MONO_INTERNAL;
 void      mono_linear_scan                  (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_mask) MONO_INTERNAL;
 void      mono_global_regalloc              (MonoCompile *cfg) MONO_INTERNAL;
 void      mono_create_jump_table            (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks) MONO_INTERNAL;
@@ -1612,6 +1844,7 @@ gboolean  mini_assembly_can_skip_verification (MonoDomain *domain, MonoMethod *m
 gboolean mono_compile_is_broken (MonoCompile *cfg, MonoMethod *method, gboolean fail_compile) MONO_INTERNAL;
 MonoInst *mono_get_got_var (MonoCompile *cfg) MONO_INTERNAL;
 void      mono_add_seq_point (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, int native_offset) MONO_INTERNAL;
+void      mono_add_var_location (MonoCompile *cfg, MonoInst *var, gboolean is_reg, int reg, int offset, int from, int to) MONO_INTERNAL;
 MonoInst* mono_emit_jit_icall (MonoCompile *cfg, gconstpointer func, MonoInst **args) MONO_INTERNAL;
 MonoInst* mono_emit_method_call (MonoCompile *cfg, MonoMethod *method, MonoInst **args, MonoInst *this) MONO_INTERNAL;
 void      mono_create_helper_signatures (void) MONO_INTERNAL;
@@ -1683,12 +1916,12 @@ MonoMethod* mono_aot_get_array_helper_from_wrapper (MonoMethod *method) MONO_INT
 guint32  mono_aot_get_got_offset            (MonoJumpInfo *ji) MONO_LLVM_INTERNAL;
 char*    mono_aot_get_method_name           (MonoCompile *cfg) MONO_LLVM_INTERNAL;
 char*    mono_aot_get_plt_symbol            (MonoJumpInfoType type, gconstpointer data) MONO_LLVM_INTERNAL;
-char*    mono_aot_get_method_debug_name     (MonoCompile *cfg) MONO_LLVM_INTERNAL;
 MonoJumpInfo* mono_aot_patch_info_dup       (MonoJumpInfo* ji) MONO_LLVM_INTERNAL;
 void     mono_aot_set_make_unreadable       (gboolean unreadable) MONO_INTERNAL;
 gboolean mono_aot_is_pagefault              (void *ptr) MONO_INTERNAL;
 void     mono_aot_handle_pagefault          (void *ptr) MONO_INTERNAL;
 void     mono_aot_register_jit_icall        (const char *name, gpointer addr) MONO_INTERNAL;
+void*    mono_aot_readonly_field_override   (MonoClassField *field) MONO_INTERNAL;
 
 /* This is an exported function */
 void     mono_aot_register_globals          (gpointer *globals);
@@ -1736,7 +1969,7 @@ gpointer          mono_create_generic_class_init_trampoline (void) MONO_INTERNAL
 gpointer          mono_create_jit_trampoline (MonoMethod *method) MONO_INTERNAL;
 gpointer          mono_create_jit_trampoline_from_token (MonoImage *image, guint32 token) MONO_INTERNAL;
 gpointer          mono_create_jit_trampoline_in_domain (MonoDomain *domain, MonoMethod *method) MONO_LLVM_INTERNAL;
-gpointer          mono_create_delegate_trampoline (MonoClass *klass) MONO_INTERNAL;
+gpointer          mono_create_delegate_trampoline (MonoDomain *domain, MonoClass *klass) MONO_INTERNAL;
 gpointer          mono_create_rgctx_lazy_fetch_trampoline (guint32 offset) MONO_INTERNAL;
 gpointer          mono_create_monitor_enter_trampoline (void) MONO_INTERNAL;
 gpointer          mono_create_monitor_exit_trampoline (void) MONO_INTERNAL;
@@ -1766,8 +1999,7 @@ void*             nacl_global_codeman_get_dest(void *data) MONO_INTERNAL;
 void              mono_global_codeman_commit(void *data, int size, int newsize) MONO_INTERNAL;
 void              nacl_global_codeman_validate(guint8 **buf_base, int buf_size, guint8 **code_end) MONO_INTERNAL;
 const char       *mono_regname_full (int reg, int bank) MONO_INTERNAL;
-gint32*           mono_allocate_stack_slots_full (MonoCompile *cfg, gboolean backward, guint32 *stack_size, guint32 *stack_align) MONO_INTERNAL;
-gint32*           mono_allocate_stack_slots (MonoCompile *cfg, guint32 *stack_size, guint32 *stack_align) MONO_INTERNAL;
+gint32*           mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_size, guint32 *stack_align) MONO_INTERNAL;
 void              mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) MONO_INTERNAL;
 MonoInst         *mono_branch_optimize_exception_target (MonoCompile *cfg, MonoBasicBlock *bb, const char * exname) MONO_INTERNAL;
 void              mono_remove_critical_edges (MonoCompile *cfg) MONO_INTERNAL;
@@ -1803,6 +2035,7 @@ void              mono_if_conversion (MonoCompile *cfg) MONO_INTERNAL;
 
 /* methods that must be provided by the arch-specific port */
 void      mono_arch_init                        (void) MONO_INTERNAL;
+void      mono_arch_finish_init                 (void) MONO_INTERNAL;
 void      mono_arch_cleanup                     (void) MONO_INTERNAL;
 void      mono_arch_cpu_init                    (void) MONO_INTERNAL;
 guint32   mono_arch_cpu_optimizazions           (guint32 *exclude_mask) MONO_INTERNAL;
@@ -1812,6 +2045,7 @@ void     *mono_arch_instrument_epilog           (MonoCompile *cfg, void *func, v
 void     *mono_arch_instrument_epilog_full     (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments, gboolean preserve_argument_registers) MONO_INTERNAL;
 void      mono_codegen                          (MonoCompile *cfg) MONO_INTERNAL;
 void      mono_call_inst_add_outarg_reg         (MonoCompile *cfg, MonoCallInst *call, int vreg, int hreg, int bank) MONO_LLVM_INTERNAL;
+void      mono_call_inst_add_outarg_vt          (MonoCompile *cfg, MonoCallInst *call, MonoInst *outarg_vt) MONO_INTERNAL;
 const char *mono_arch_regname                   (int reg) MONO_INTERNAL;
 const char *mono_arch_fregname                  (int reg) MONO_INTERNAL;
 void      mono_arch_exceptions_init             (void) MONO_INTERNAL;
@@ -1827,7 +2061,7 @@ GList    *mono_arch_get_global_fp_regs          (MonoCompile *cfg) MONO_INTERNAL
 GList    *mono_arch_get_iregs_clobbered_by_call (MonoCallInst *call) MONO_INTERNAL;
 GList    *mono_arch_get_fregs_clobbered_by_call (MonoCallInst *call) MONO_INTERNAL;
 guint32   mono_arch_regalloc_cost               (MonoCompile *cfg, MonoMethodVar *vmv) MONO_INTERNAL;
-void      mono_arch_patch_code                  (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors) MONO_INTERNAL;
+void      mono_arch_patch_code                  (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, MonoCodeManager *dyn_code_mp, gboolean run_cctors) MONO_INTERNAL;
 void      mono_arch_flush_icache                (guint8 *code, gint size) MONO_INTERNAL;
 int       mono_arch_max_epilog_size             (MonoCompile *cfg) MONO_INTERNAL;
 guint8   *mono_arch_emit_prolog                 (MonoCompile *cfg) MONO_INTERNAL;
@@ -1837,8 +2071,6 @@ void      mono_arch_lowering_pass               (MonoCompile *cfg, MonoBasicBloc
 void      mono_arch_peephole_pass_1             (MonoCompile *cfg, MonoBasicBlock *bb) MONO_INTERNAL;
 void      mono_arch_peephole_pass_2             (MonoCompile *cfg, MonoBasicBlock *bb) MONO_INTERNAL;
 void      mono_arch_output_basic_block          (MonoCompile *cfg, MonoBasicBlock *bb) MONO_INTERNAL;
-gboolean  mono_arch_has_unwind_info             (gconstpointer addr) MONO_INTERNAL;
-void      mono_arch_setup_jit_tls_data          (MonoJitTlsData *tls) MONO_INTERNAL;
 void      mono_arch_free_jit_tls_data           (MonoJitTlsData *tls) MONO_INTERNAL;
 void      mono_arch_fill_argument_info          (MonoCompile *cfg) MONO_INTERNAL;
 void      mono_arch_allocate_vars               (MonoCompile *m) MONO_INTERNAL;
@@ -1869,9 +2101,7 @@ void      mono_arch_start_single_stepping       (void) MONO_INTERNAL;
 void      mono_arch_stop_single_stepping        (void) MONO_INTERNAL;
 gboolean  mono_arch_is_single_step_event        (void *info, void *sigctx) MONO_INTERNAL;
 gboolean  mono_arch_is_breakpoint_event         (void *info, void *sigctx) MONO_INTERNAL;
-guint8*   mono_arch_get_ip_for_single_step      (MonoJitInfo *ji, MonoContext *ctx) MONO_INTERNAL;
-guint8*   mono_arch_get_ip_for_breakpoint       (MonoJitInfo *ji, MonoContext *ctx) MONO_INTERNAL;
-void     mono_arch_skip_breakpoint              (MonoContext *ctx) MONO_INTERNAL;
+void     mono_arch_skip_breakpoint              (MonoContext *ctx, MonoJitInfo *ji) 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;
@@ -1880,7 +2110,8 @@ void     mono_arch_setup_resume_sighandler_ctx  (MonoContext *ctx, gpointer func
 gboolean
 mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, 
                                                 MonoJitInfo *ji, MonoContext *ctx, 
-                                                MonoContext *new_ctx, MonoLMF **lmf, 
+                                                MonoContext *new_ctx, MonoLMF **lmf,
+                                                mgreg_t **save_locations,
                                                 StackFrameInfo *frame_info) MONO_INTERNAL;
 gpointer  mono_arch_get_throw_exception_by_name (void) MONO_INTERNAL;
 gpointer mono_arch_get_call_filter              (MonoTrampInfo **info, gboolean aot) MONO_INTERNAL;
@@ -1889,13 +2120,15 @@ gpointer  mono_arch_get_throw_exception         (MonoTrampInfo **info, gboolean
 gpointer  mono_arch_get_rethrow_exception       (MonoTrampInfo **info, gboolean aot) MONO_INTERNAL;
 gpointer  mono_arch_get_throw_corlib_exception  (MonoTrampInfo **info, gboolean aot) MONO_INTERNAL;
 gpointer  mono_arch_get_throw_pending_exception (MonoTrampInfo **info, gboolean aot) MONO_INTERNAL;
-gboolean mono_arch_handle_exception             (void *sigctx, gpointer obj, gboolean test_only) MONO_INTERNAL;
+gboolean mono_arch_handle_exception             (void *sigctx, gpointer obj) MONO_INTERNAL;
 void     mono_arch_handle_altstack_exception    (void *sigctx, gpointer fault_addr, gboolean stack_ovf) MONO_INTERNAL;
 gboolean mono_handle_soft_stack_ovf             (MonoJitTlsData *jit_tls, MonoJitInfo *ji, void *ctx, guint8* fault_addr) MONO_INTERNAL;
+void     mono_handle_hard_stack_ovf             (MonoJitTlsData *jit_tls, MonoJitInfo *ji, void *ctx, guint8* fault_addr) MONO_INTERNAL;
 gpointer mono_arch_ip_from_context              (void *sigctx) MONO_INTERNAL;
 void     mono_arch_sigctx_to_monoctx            (void *sigctx, MonoContext *ctx) MONO_INTERNAL;
 void     mono_arch_monoctx_to_sigctx            (MonoContext *mctx, void *ctx) MONO_INTERNAL;
-gpointer mono_arch_context_get_int_reg         (MonoContext *ctx, int reg) MONO_INTERNAL;
+mgreg_t mono_arch_context_get_int_reg              (MonoContext *ctx, int reg) MONO_INTERNAL;
+void     mono_arch_context_set_int_reg             (MonoContext *ctx, int reg, mgreg_t val) MONO_INTERNAL;
 void     mono_arch_flush_register_windows       (void) MONO_INTERNAL;
 gboolean mono_arch_is_inst_imm                  (gint64 imm) MONO_INTERNAL;
 MonoInst* mono_arch_get_domain_intrinsic        (MonoCompile* cfg) MONO_INTERNAL;
@@ -1930,21 +2163,34 @@ GSList *mono_arch_get_trampolines               (gboolean aot) MONO_INTERNAL;
 gpointer mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value) MONO_INTERNAL;
 gpointer mono_arch_create_handler_block_trampoline (void) MONO_INTERNAL;
 gpointer mono_create_handler_block_trampoline (void) MONO_INTERNAL;
-gboolean mono_install_handler_block_guard (MonoInternalThread *thread, MonoContext *ctx) MONO_INTERNAL;
+gboolean mono_install_handler_block_guard (MonoThreadUnwindState *ctx) MONO_INTERNAL;
 
-/* Exception handling */
+/*New interruption machinery */
+void
+mono_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data) MONO_INTERNAL;
+
+void
+mono_arch_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data) MONO_INTERNAL;
+
+gboolean
+mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoNativeThreadId thread_id, MonoNativeThreadHandle thread_handle) MONO_INTERNAL;
 
+
+/* Exception handling */
 typedef gboolean (*MonoJitStackWalk)            (StackFrameInfo *frame, MonoContext *ctx, gpointer data);
 
 void     mono_exceptions_init                   (void) MONO_INTERNAL;
-gboolean mono_handle_exception                  (MonoContext *ctx, gpointer obj,
-                                                gpointer original_ip, gboolean test_only) MONO_INTERNAL;
+gboolean mono_handle_exception                  (MonoContext *ctx, gpointer obj) MONO_INTERNAL;
 void     mono_handle_native_sigsegv             (int signal, void *sigctx) MONO_INTERNAL;
 void     mono_print_thread_dump                 (void *sigctx);
 void     mono_print_thread_dump_from_ctx        (MonoContext *ctx);
-void     mono_jit_walk_stack                    (MonoStackWalk func, gboolean do_il_offset, gpointer user_data) MONO_INTERNAL;
-void     mono_jit_walk_stack_from_ctx           (MonoStackWalk func, MonoContext *ctx, gboolean do_il_offset, gpointer user_data) MONO_INTERNAL;
-void     mono_walk_stack                        (MonoJitStackWalk func, MonoDomain *domain, MonoContext *start_ctx, gboolean do_il_offset, MonoInternalThread *thread, MonoLMF *lmf, gpointer user_data) MONO_INTERNAL;
+void     mono_walk_stack_with_ctx               (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data) MONO_INTERNAL;
+void     mono_walk_stack_with_state             (MonoJitStackWalk func, MonoThreadUnwindState *state, MonoUnwindOptions unwind_options, void *user_data) MONO_INTERNAL;
+void     mono_walk_stack                        (MonoJitStackWalk func, MonoUnwindOptions options, void *user_data) MONO_INTERNAL;
+gboolean mono_thread_state_init_from_sigctx     (MonoThreadUnwindState *ctx, void *sigctx) MONO_INTERNAL;
+gboolean mono_thread_state_init_from_current    (MonoThreadUnwindState *ctx) MONO_INTERNAL;
+gboolean mono_thread_state_init_from_monoctx    (MonoThreadUnwindState *ctx, MonoContext *mctx) MONO_INTERNAL;
+
 void     mono_setup_altstack                    (MonoJitTlsData *tls) MONO_INTERNAL;
 void     mono_free_altstack                     (MonoJitTlsData *tls) MONO_INTERNAL;
 gpointer mono_altstack_restore_prot             (mgreg_t *regs, guint8 *code, gpointer *tramp_data, guint8* tramp) MONO_INTERNAL;
@@ -1957,6 +2203,7 @@ gboolean
 mono_find_jit_info_ext (MonoDomain *domain, MonoJitTlsData *jit_tls, 
                                                MonoJitInfo *prev_ji, MonoContext *ctx,
                                                MonoContext *new_ctx, char **trace, MonoLMF **lmf,
+                                               mgreg_t **save_locations,
                                                StackFrameInfo *frame) MONO_INTERNAL;
 
 gpointer mono_get_throw_exception               (void) MONO_INTERNAL;
@@ -1972,6 +2219,7 @@ MonoBoolean ves_icall_get_frame_info            (gint32 skip, MonoBoolean need_f
                                                 gint32 *iloffset, gint32 *native_offset,
                                                 MonoString **file, gint32 *line, gint32 *column) MONO_INTERNAL;
 MonoString *ves_icall_System_Exception_get_trace (MonoException *exc) MONO_INTERNAL;
+void mono_set_cast_details                      (MonoClass *from, MonoClass *to) MONO_INTERNAL;
 
 /* Dominator/SSA methods */
 void        mono_compile_dominator_info         (MonoCompile *cfg, int dom_flags) MONO_INTERNAL;
@@ -2067,11 +2315,14 @@ mono_class_rgctx_get_array_size (int n, gboolean mrgctx) MONO_INTERNAL;
 
 guint32
 mono_method_lookup_or_register_other_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
-       int info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
+       MonoRgctxInfoType info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
 
 MonoGenericContext
 mono_method_construct_object_context (MonoMethod *method) MONO_INTERNAL;
 
+MonoMethod*
+mono_method_get_declaring_generic_method (MonoMethod *method) MONO_INTERNAL;
+
 int
 mono_generic_context_check_used (MonoGenericContext *context) MONO_INTERNAL;
 
@@ -2127,6 +2378,8 @@ guint mono_type_to_regmove (MonoCompile *cfg, MonoType *type) MONO_INTERNAL;
 void mono_cfg_add_try_hole (MonoCompile *cfg, MonoExceptionClause *clause, guint8 *start, MonoBasicBlock *bb) MONO_INTERNAL;
 
 void mono_cfg_set_exception (MonoCompile *cfg, int type) MONO_INTERNAL;
+gboolean mini_type_is_reference (MonoCompile *cfg, MonoType *type) MONO_INTERNAL;
+
 
 /* wapihandles.c */
 int mini_wapi_hps (int argc, char **argv) MONO_INTERNAL;
@@ -2208,7 +2461,7 @@ void mono_runtime_setup_stat_profiler (void) MONO_INTERNAL;
 void mono_runtime_shutdown_stat_profiler (void) MONO_INTERNAL;
 void mono_runtime_posix_install_handlers (void) MONO_INTERNAL;
 pid_t mono_runtime_syscall_fork (void) MONO_INTERNAL;
-gboolean mono_gdb_render_native_backtraces (void) MONO_INTERNAL;
+void mono_gdb_render_native_backtraces (pid_t crashed_pid) MONO_INTERNAL;
 
 /*
  * Signal handling
@@ -2240,7 +2493,7 @@ gboolean mono_gdb_render_native_backtraces (void) MONO_INTERNAL;
 #define SIG_HANDLER_SIGNATURE(ftn) 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_RECORD *info, void *context)
+#define SIG_HANDLER_SIGNATURE(ftn) 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)
@@ -2256,12 +2509,4 @@ void SIG_HANDLER_SIGNATURE (mono_sigsegv_signal_handler) MONO_INTERNAL;
 void SIG_HANDLER_SIGNATURE (mono_sigint_signal_handler)  MONO_INTERNAL;
 gboolean SIG_HANDLER_SIGNATURE (mono_chain_signal) MONO_INTERNAL;
 
-/* for MONO_WRAPPER_UNKNOWN/MANAGED_TO_MANAGED subtypes */
-enum {
-       MONO_AOT_WRAPPER_MONO_ENTER,
-       MONO_AOT_WRAPPER_MONO_EXIT,
-       MONO_AOT_WRAPPER_ELEMENT_ADDR,
-       MONO_AOT_WRAPPER_LAST
-};
-
 #endif /* __MONO_MINI_H__ */