3 #include <mono/metadata/loader.h>
4 #include <mono/metadata/object.h>
5 #include <mono/metadata/domain-internals.h>
6 #include <mono/metadata/class-internals.h>
15 VAL_NATI = 0 + VAL_POINTER,
16 VAL_MP = 1 + VAL_POINTER,
17 VAL_TP = 2 + VAL_POINTER,
18 VAL_OBJ = 3 + VAL_POINTER
21 #if SIZEOF_VOID_P == 4
22 typedef guint32 mono_u;
23 typedef gint32 mono_i;
24 #elif SIZEOF_VOID_P == 8
25 typedef guint64 mono_u;
26 typedef gint64 mono_i;
30 * Value types are represented on the eval stack as pointers to the
31 * actual storage. The size field tells how much storage is allocated.
32 * A value type can't be larger than 16 MB.
39 /* native size integer and pointer types */
44 #if defined(__ppc__) || defined(__powerpc__)
49 typedef struct _MonoInvocation MonoInvocation;
51 typedef void (*MonoFuncV) (void);
52 typedef void (*MonoPIFunc) (MonoFuncV callme, void *margs);
55 * Structure representing a method transformed for the interpreter
56 * This is domain specific
58 typedef struct _RuntimeMethod
60 /* NOTE: These first two elements (method and
61 next_jit_code_hash) must be in the same order and at the
62 same offset as in MonoJitInfo, because of the jit_code_hash
63 internal hash table in MonoDomain. */
65 struct _RuntimeMethod *next_jit_code_hash;
69 guint32 vt_stack_size;
72 unsigned short *new_body_start; /* after all STINARG instrs */
75 MonoExceptionClause *clauses;
79 guint32 *local_offsets;
80 unsigned int param_count;
82 unsigned int valuetype;
85 struct _MonoInvocation {
86 MonoInvocation *parent; /* parent */
87 RuntimeMethod *runtime_method; /* parent */
88 MonoMethod *method; /* parent */
89 stackval *retval; /* parent */
90 void *obj; /* this - parent */
92 stackval *stack_args; /* parent */
94 stackval *sp; /* For GC stack marking */
96 unsigned char invoke_trap;
97 const unsigned short *ip;
99 MonoExceptionClause *ex_handler;
104 MonoInvocation *base_frame;
105 MonoInvocation *current_frame;
106 MonoInvocation *env_frame;
107 jmp_buf *current_env;
108 unsigned char search_for_handler;
109 unsigned char managed_code;
112 void mono_init_icall (void);
115 mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context);
118 mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);
121 interp_regression_list (int verbose, int count, char *images []);
124 mono_interp_transform_init (void);
126 static void inline stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke);
127 static void inline stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke);
128 void ves_exec_method (MonoInvocation *frame);
131 mono_interp_init(const char *file);
134 * defined in an arch specific file.
137 mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor);
140 mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error);
142 void *mono_arch_create_method_pointer (MonoMethod *method);
144 extern int mono_interp_traceopt;