Merge pull request #409 from Alkarex/patch-1
[mono.git] / mono / interpreter / interp.h
index 387c2b31fc4d5547198f04fbcba7d6a58a9d572f..0953e5a54cfb93f1448dd9a80a815952469127bb 100644 (file)
@@ -2,6 +2,8 @@
 #include <glib.h>
 #include <mono/metadata/loader.h>
 #include <mono/metadata/object.h>
+#include <mono/metadata/domain-internals.h>
+#include <mono/metadata/class-internals.h>
 #include "config.h"
 
 enum {
@@ -13,7 +15,7 @@ enum {
        VAL_NATI    = 0 + VAL_POINTER,
        VAL_MP      = 1 + VAL_POINTER,
        VAL_TP      = 2 + VAL_POINTER,
-       VAL_OBJ     = 3 + VAL_POINTER,
+       VAL_OBJ     = 3 + VAL_POINTER
 };
 
 #if SIZEOF_VOID_P == 4
@@ -53,8 +55,14 @@ typedef void (*MonoPIFunc) (MonoFunc callme, void *retval, void *obj_this, stack
  * Structure representing a method transformed for the interpreter 
  * This is domain specific
  */
-typedef struct 
+typedef struct _RuntimeMethod
 {
+       /* NOTE: These first two elements (method and
+          next_jit_code_hash) must be in the same order and at the
+          same offset as in MonoJitInfo, because of the jit_code_hash
+          internal hash table in MonoDomain. */
+       MonoMethod *method;
+       struct _RuntimeMethod *next_jit_code_hash;
        guint32 locals_size;
        guint32 args_size;
        guint32 stack_size;
@@ -62,7 +70,6 @@ typedef struct
        guint32 alloca_size;
        unsigned short *code;
        unsigned short *new_body_start; /* after all STINARG instrs */
-       MonoMethod *method;
        MonoPIFunc func;
        int num_clauses;
        MonoExceptionClause *clauses;
@@ -100,7 +107,6 @@ typedef struct {
        jmp_buf *current_env;
        unsigned char search_for_handler;
        unsigned char managed_code;
-       unsigned char abort_thread;
 } ThreadContext;
 
 void mono_init_icall (void);
@@ -108,6 +114,9 @@ void mono_init_icall (void);
 MonoException *
 mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context);
 
+MonoDelegate*
+mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);
+
 void
 mono_interp_transform_init (void);