#include "mono/metadata/class-internals.h"
#include "mono/metadata/object-internals.h"
#include <mono/metadata/profiler-private.h>
+#include <mono/metadata/debug-helpers.h>
#include <mono/utils/mono-compiler.h>
+#define MONO_BREAKPOINT_ARRAY_SIZE 64
+
#include "mini-arch.h"
#include "regalloc.h"
#include "declsec.h"
#define inst_ls_word data.op[MINI_LS_WORD_IDX].const_val
#define inst_ms_word data.op[MINI_MS_WORD_IDX].const_val
+#define MONO_FAKE_IMT_METHOD ((MonoMethod*)GINT_TO_POINTER(-1))
+#define MONO_FAKE_VTABLE_METHOD ((MonoMethod*)GINT_TO_POINTER(-2))
+
/* Version number of the AOT file format */
#define MONO_AOT_FILE_VERSION "32"
#else
extern gboolean mono_compile_aot;
#endif
+extern MonoMethodDesc *mono_inject_async_exc_method;
+extern int mono_inject_async_exc_pos;
struct MonoEdge {
MonoEdge *next;
#define MONO_BBLOCK_IS_IN_REGION(bblock, regtype) (((bblock)->region & (0xf << 4)) == (regtype))
+/*
+ * Will contain information on the generic type arguments in the
+ * future. For now, all arguments are always reference types.
+ */
+typedef struct {
+ int dummy;
+} MonoGenericSharingContext;
+
/*
* Control Flow Graph and compilation unit information
*/
MonoDomain *domain;
+ MonoGenericSharingContext *generic_sharing_context;
+
unsigned char *cil_start;
unsigned char *native_code;
guint code_size;
MONO_EXC_INTRINS_NUM
};
+/*
+ * Flags for which contexts were used in inflating a generic.
+ */
+enum {
+ MONO_GENERIC_CONTEXT_USED_CLASS = 1,
+ MONO_GENERIC_CONTEXT_USED_METHOD = 2
+};
+
+#define MONO_GENERIC_CONTEXT_USED_BOTH (MONO_GENERIC_CONTEXT_USED_CLASS | MONO_GENERIC_CONTEXT_USED_METHOD)
+
typedef void (*MonoInstFunc) (MonoInst *tree, gpointer data);
/* main function */
CompType mono_opcode_to_type (int opcode, int cmp_opcode) MONO_INTERNAL;
/* methods that must be provided by the arch-specific port */
+void mono_arch_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_instrument_mem_needs (MonoMethod *method, int *stack, int *code) MONO_INTERNAL;
void mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg) MONO_INTERNAL;
guint32 mono_arch_get_patch_offset (guint8 *code) MONO_INTERNAL;
gpointer*mono_arch_get_vcall_slot_addr (guint8* code, gpointer *regs) MONO_INTERNAL;
+gpointer mono_arch_get_vcall_slot (guint8 *code, gpointer *regs, int *displacement) MONO_INTERNAL;
gpointer*mono_arch_get_delegate_method_ptr_addr (guint8* code, gpointer *regs) MONO_INTERNAL;
void mono_arch_create_vars (MonoCompile *cfg) MONO_INTERNAL;
void mono_arch_save_unwind_info (MonoCompile *cfg) MONO_INTERNAL;
void mono_debug_print_vars (gpointer ip, gboolean only_arguments);
void mono_debugger_run_finally (MonoContext *start_ctx);
+extern gssize mono_breakpoint_info_index [MONO_BREAKPOINT_ARRAY_SIZE];
+
+gboolean mono_breakpoint_clean_code (guint8 *code, guint8 *buf, int size);
+
/* Mono Debugger support */
void mono_debugger_init (void);
int mono_debugger_main (MonoDomain *domain, MonoAssembly *assembly, int argc, char **argv);
int mini_wapi_semdel (int argc, char **argv);
int mini_wapi_seminfo (int argc, char **argv);
+/* Generic sharing */
+
+int mono_method_check_context_used (MonoMethod *method, MonoGenericContext *context) MONO_INTERNAL;
+int mono_class_check_context_used (MonoClass *class, MonoGenericContext *context) MONO_INTERNAL;
+
+gboolean mono_method_is_generic_impl (MonoMethod *method) MONO_INTERNAL;
+gboolean mono_method_is_generic_sharable_impl (MonoMethod *method) MONO_INTERNAL;
+
+MonoGenericContext* mono_make_shared_context (MonoCompile *cfg, MonoGenericContext *context) MONO_INTERNAL;
+
+MonoType* mini_get_basic_type_from_generic (MonoGenericSharingContext *gsctx, MonoType *type) MONO_INTERNAL;
+
+int mini_type_stack_size (MonoGenericSharingContext *gsctx, MonoType *t, int *align) MONO_INTERNAL;
+
#endif /* __MONO_MINI_H__ */