Merge pull request #3387 from xmcclure/test-suite-bump
[mono.git] / mono / mini / mini.h
index 48729fc2eeeac4601b3a06e59a30d06c120fabf4..bafaa414969ec65fa1aafd1bfbcaaa7da7307102 100644 (file)
 #define MINI_DEBUG(level,limit,code) do {if (G_UNLIKELY ((level) >= (limit))) code} while (0)
 #endif
 
-#if !defined(DISABLE_TASKLETS) && defined(MONO_ARCH_SUPPORT_TASKLETS) && defined(__GNUC__)
+#if !defined(DISABLE_TASKLETS) && defined(MONO_ARCH_SUPPORT_TASKLETS)
+#if defined(__GNUC__)
 #define MONO_SUPPORT_TASKLETS 1
+#elif defined(HOST_WIN32)
+#define MONO_SUPPORT_TASKLETS 1
+// Replace some gnu intrinsics needed for tasklets with MSVC equivalents.
+#define __builtin_extract_return_addr(x) x
+#define __builtin_return_address(x) _ReturnAddress()
+#define __builtin_frame_address(x) _AddressOfReturnAddress()
+#endif
 #endif
 
 #if ENABLE_LLVM
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 133
+#define MONO_AOT_FILE_VERSION 136
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
@@ -307,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 */
@@ -478,7 +488,7 @@ enum {
 
 #define MONO_IS_COND_EXC(ins) ((((ins)->opcode >= OP_COND_EXC_EQ) && ((ins)->opcode <= OP_COND_EXC_LT_UN)) || (((ins)->opcode >= OP_COND_EXC_IEQ) && ((ins)->opcode <= OP_COND_EXC_ILT_UN)))
 
-#define MONO_IS_SETCC(ins) ((((ins)->opcode >= OP_CEQ) && ((ins)->opcode <= OP_CLT_UN)) || (((ins)->opcode >= OP_ICEQ) && ((ins)->opcode <= OP_ICLT_UN)) || (((ins)->opcode >= OP_LCEQ) && ((ins)->opcode <= OP_LCLT_UN)) || (((ins)->opcode >= OP_FCEQ) && ((ins)->opcode <= OP_FCLT_UN)))
+#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_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))
@@ -1164,6 +1174,11 @@ typedef struct {
         * The current exception in flight
         */
        guint32 thrown_exc;
+       /*
+        * If the current exception is not a subclass of Exception,
+        * the original exception.
+        */
+       guint32 thrown_non_exc;
 
        /*
         * The calling assembly in llvmonly mode.
@@ -1869,7 +1884,8 @@ typedef enum {
        MONO_CFG_HAS_FPOUT    = 1 << 5, /* there are fp values passed in int registers */
        MONO_CFG_HAS_SPILLUP  = 1 << 6, /* spill var slots are allocated from bottom to top */
        MONO_CFG_HAS_CHECK_THIS  = 1 << 7,
-       MONO_CFG_HAS_ARRAY_ACCESS = 1 << 8
+       MONO_CFG_HAS_ARRAY_ACCESS = 1 << 8,
+       MONO_CFG_HAS_TYPE_CHECK = 1 << 9
 } MonoCompileFlags;
 
 typedef struct {
@@ -1903,6 +1919,7 @@ typedef struct {
        double jit_liveness_handle_exception_clauses;
        double jit_handle_out_of_line_bblock;
        double jit_decompose_long_opts;
+       double jit_decompose_typechecks;
        double jit_local_cprop;
        double jit_local_emulate_ops;
        double jit_optimize_branches;
@@ -2104,7 +2121,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.
@@ -2411,6 +2428,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);
@@ -2623,6 +2641,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 */
@@ -2847,14 +2866,7 @@ 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);
 void        mono_compute_natural_loops          (MonoCompile *cfg);