#include <mono/utils/mono-machine.h>
#include <mono/utils/mono-stack-unwinding.h>
#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-threads-coop.h>
#include <mono/utils/mono-tls.h>
#include <mono/utils/atomic.h>
#include <mono/utils/mono-conc-hashtable.h>
#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))
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 */
#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))
* 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.
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 {
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;
* 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.
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);
gpointer mini_add_method_wrappers_llvmonly (MonoMethod *m, gpointer compiled_method, gboolean caller_gsharedvt, gboolean add_unbox_tramp, gpointer *out_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);
+ gboolean *out_need_rgctx_tramp, MonoMethod **variant_iface,
+ MonoError *error);
MonoFtnDesc *mini_create_llvmonly_ftndesc (MonoDomain *domain, gpointer addr, gpointer arg);
gboolean mono_running_on_valgrind (void);
/* 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 */
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);