2007-09-30 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mono / mini / mini.h
index 9212770117f75a9b764e87c6fdd16321826163fa..6e0ab2f1f120c2cbd8b335124391bdf94e100d06 100644 (file)
@@ -15,6 +15,7 @@
 #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>
 
 #include "mini-arch.h"
 
 /* for 32 bit systems */
 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define MINI_LS_WORD_OFFSET 0
-#define MINI_MS_WORD_OFFSET 4
-#define inst_ls_word data.op[0].const_val
-#define inst_ms_word data.op[1].const_val
+#define MINI_LS_WORD_IDX 0
+#define MINI_MS_WORD_IDX 1
 #else
-#define MINI_LS_WORD_OFFSET 4
-#define MINI_MS_WORD_OFFSET 0
-#define inst_ls_word data.op[1].const_val
-#define inst_ms_word data.op[0].const_val
+#define MINI_LS_WORD_IDX 1
+#define MINI_MS_WORD_IDX 0
 #endif
+#define MINI_LS_WORD_OFFSET (MINI_LS_WORD_IDX * 4)
+#define MINI_MS_WORD_OFFSET (MINI_MS_WORD_IDX * 4)
+#define inst_ls_word data.op[MINI_LS_WORD_IDX].const_val
+#define inst_ms_word data.op[MINI_MS_WORD_IDX].const_val
 
 /* Version number of the AOT file format */
 #define MONO_AOT_FILE_VERSION "32"
@@ -130,6 +131,8 @@ extern int mono_exc_esp_offset;
 #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;
@@ -605,6 +608,7 @@ typedef struct {
        guint            dont_verify_stack_merge : 1;
        guint            unverifiable : 1;
        guint            skip_visibility : 1;
+       guint            generic_shared : 1;
        gpointer         debug_info;
        guint32          lmf_offset;
        guint16          *intvars;
@@ -825,6 +829,16 @@ enum {
        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 */
@@ -944,6 +958,8 @@ CompRelation      mono_opcode_to_cond (int opcode) MONO_INTERNAL;
 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;
@@ -1096,4 +1112,15 @@ int mini_wapi_hps     (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;
+
+
 #endif /* __MONO_MINI_H__ */