1 #ifndef __MONO_MINI_INTERPRETER_INTERNALS_H__
2 #define __MONO_MINI_INTERPRETER_INTERNALS_H__
6 #include <mono/metadata/loader.h>
7 #include <mono/metadata/object.h>
8 #include <mono/metadata/domain-internals.h>
9 #include <mono/metadata/class-internals.h>
10 #include <mono/metadata/debug-internals.h>
19 VAL_NATI = 0 + VAL_POINTER,
20 VAL_MP = 1 + VAL_POINTER,
21 VAL_TP = 2 + VAL_POINTER,
22 VAL_OBJ = 3 + VAL_POINTER
25 #if SIZEOF_VOID_P == 4
26 typedef guint32 mono_u;
27 typedef gint32 mono_i;
28 #elif SIZEOF_VOID_P == 8
29 typedef guint64 mono_u;
30 typedef gint64 mono_i;
34 * Value types are represented on the eval stack as pointers to the
35 * actual storage. The size field tells how much storage is allocated.
36 * A value type can't be larger than 16 MB.
47 /* native size integer and pointer types */
52 #if defined(__ppc__) || defined(__powerpc__)
57 typedef struct _InterpFrame InterpFrame;
59 typedef void (*MonoFuncV) (void);
60 typedef void (*MonoPIFunc) (MonoFuncV callme, void *margs);
63 * Structure representing a method transformed for the interpreter
64 * This is domain specific
66 typedef struct _InterpMethod
68 /* NOTE: These first two elements (method and
69 next_jit_code_hash) must be in the same order and at the
70 same offset as in MonoJitInfo, because of the jit_code_hash
71 internal hash table in MonoDomain. */
73 struct _InterpMethod *next_jit_code_hash;
77 guint32 vt_stack_size;
80 unsigned short *new_body_start; /* after all STINARG instrs */
83 MonoExceptionClause *clauses;
87 guint32 *local_offsets;
88 guint32 *exvar_offsets;
89 unsigned int param_count;
93 MonoMethodSignature *jit_sig;
96 MonoType **param_types;
99 MonoProfilerCallInstrumentationFlags prof_flags;
102 struct _InterpFrame {
103 InterpFrame *parent; /* parent */
104 InterpMethod *imethod; /* parent */
105 MonoMethod *method; /* parent */
106 stackval *retval; /* parent */
108 stackval *stack_args; /* parent */
110 stackval *sp; /* For GC stack marking */
111 unsigned char *locals;
113 unsigned char invoke_trap;
114 const unsigned short *ip;
116 MonoExceptionClause *ex_handler;
120 MonoDomain *original_domain;
121 InterpFrame *base_frame;
122 InterpFrame *current_frame;
123 InterpFrame *env_frame;
124 jmp_buf *current_env;
125 unsigned char search_for_handler;
126 unsigned char managed_code;
128 /* Resume state for resuming execution in mixed mode */
129 gboolean has_resume_state;
130 /* Frame to resume execution at */
131 InterpFrame *handler_frame;
132 /* IP to resume execution at */
136 extern int mono_interp_traceopt;
137 extern GSList *jit_classes;
140 mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context);
143 mono_interp_transform_init (void);
146 mono_interp_get_imethod (MonoDomain *domain, MonoMethod *method, MonoError *error);
148 #endif /* __MONO_MINI_INTERPRETER_INTERNALS_H__ */