+/*
+ * Copyright 2002-2003 Ximian Inc
+ * Copyright 2003-2011 Novell Inc
+ * Copyright 2011 Xamarin Inc
+ */
#ifndef __MONO_MINI_H__
#define __MONO_MINI_H__
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 79
+#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))
/* array */
MONO_AOT_TYPEREF_ARRAY = 6,
/* blob index of the type encoding */
- MONO_AOT_TYPEREF_BLOB_INDEX = 7
+ MONO_AOT_TYPEREF_BLOB_INDEX = 7,
+ /* ptr */
+ MONO_AOT_TYPEREF_PTR = 8
};
/* Trampolines which we have a lot of */
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"
MonoMethod *method;
gboolean in_mrgctx;
MonoJumpInfo *data; /* describes the data to be loaded */
- int info_type;
+ MonoRgctxInfoType info_type;
};
typedef enum {
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;
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 */
* is hit.
*/
gboolean soft_breakpoints;
+ /*
+ * Whenever to break in the debugger using G_BREAKPOINT on unhandled exceptions.
+ */
+ gboolean break_on_exc;
} MonoDebugOptions;
enum {
/* 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;
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;
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;
/* 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;
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;
-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;
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;
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;
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
void SIG_HANDLER_SIGNATURE (mono_sigint_signal_handler) MONO_INTERNAL;
gboolean SIG_HANDLER_SIGNATURE (mono_chain_signal) MONO_INTERNAL;
-/* Subtypes of some wrapper types */
-enum {
- MONO_AOT_WRAPPER_MONITOR_ENTER,
- MONO_AOT_WRAPPER_MONITOR_EXIT,
- MONO_AOT_WRAPPER_ELEMENT_ADDR,
- MONO_AOT_WRAPPER_PTR_TO_STRUCTURE,
- MONO_AOT_WRAPPER_STRUCTURE_TO_PTR,
- MONO_AOT_WRAPPER_CASTCLASS_WITH_CACHE,
- MONO_AOT_WRAPPER_ISINST_WITH_CACHE,
- MONO_AOT_WRAPPER_MONITOR_ENTER_V4,
- MONO_AOT_WRAPPER_JIT_ICALL,
- MONO_AOT_WRAPPER_RUNTIME_INVOKE_DYNAMIC,
- MONO_AOT_WRAPPER_RUNTIME_INVOKE_DIRECT,
- MONO_AOT_WRAPPER_RUNTIME_INVOKE_VIRTUAL,
- /*
- * We can't encode this wrapper directly, so we emit its name instead.
- * This means that its not possible to decode this into a method, only to check
- * that the method reference matches a given method. This is normally not a problem
- * as these wrappers only occur in the extra_methods table, where we already have
- * a method we want to lookup.
- */
- MONO_AOT_WRAPPER_BY_NAME,
- MONO_AOT_WRAPPER_LAST
-};
-
#endif /* __MONO_MINI_H__ */