2006-08-02 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / mini.h
1 #ifndef __MONO_MINI_H__
2 #define __MONO_MINI_H__
3
4 #include "config.h"
5 #include <glib.h>
6 #include <signal.h>
7 #include <mono/metadata/loader.h>
8 #include <mono/metadata/mempool.h>
9 #include <mono/utils/monobitset.h>
10 #include <mono/metadata/class.h>
11 #include <mono/metadata/object.h>
12 #include <mono/metadata/opcodes.h>
13 #include <mono/metadata/tabledefs.h>
14 #include <mono/metadata/domain-internals.h>
15 #include "mono/metadata/class-internals.h"
16 #include "mono/metadata/object-internals.h"
17 #include <mono/metadata/profiler-private.h>
18 #include <mono/utils/mono-compiler.h>
19
20 #include "mini-arch.h"
21 #include "regalloc.h"
22 #include "declsec.h"
23
24 #ifndef G_LIKELY
25 #define G_LIKELY(a) (a)
26 #define G_UNLIKELY(a) (a)
27 #endif
28
29 #if DISABLE_LOGGING
30 #define MINI_DEBUG(level,limit,code)
31 #else
32 #define MINI_DEBUG(level,limit,code) do {if (G_UNLIKELY ((level) >= (limit))) code} while (0)
33 #endif
34
35 #ifndef DISABLE_AOT
36 #define MONO_USE_AOT_COMPILER
37 #endif
38
39 /* for 32 bit systems */
40 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
41 #define MINI_LS_WORD_OFFSET 0
42 #define MINI_MS_WORD_OFFSET 4
43 #define inst_ls_word data.op[0].const_val
44 #define inst_ms_word data.op[1].const_val
45 #else
46 #define MINI_LS_WORD_OFFSET 4
47 #define MINI_MS_WORD_OFFSET 0
48 #define inst_ls_word data.op[1].const_val
49 #define inst_ms_word data.op[0].const_val
50 #endif
51
52 /* Version number of the AOT file format */
53 #define MONO_AOT_FILE_VERSION "27"
54
55 #if 0
56 #define mono_bitset_foreach_bit(set,b,n) \
57         for (b = 0; b < n; b++)\
58                 if (mono_bitset_test_fast(set,b))
59 #define mono_bitset_foreach_bit_rev(set,b,n) \
60         for (b = n - 1; b >= 0; b--)\
61                 if (mono_bitset_test_fast(set,b))
62 #else
63 #define mono_bitset_foreach_bit(set,b,n) \
64         for (b = mono_bitset_find_start (set); b < n && b >= 0; b = mono_bitset_find_first (set, b))
65 #define mono_bitset_foreach_bit_rev(set,b,n) \
66         for (b = mono_bitset_find_last (set, n - 1); b >= 0; b = b ? mono_bitset_find_last (set, b) : -1)
67  
68 #endif
69
70 /*
71  * Pull the list of opcodes
72  */
73 #define OPDEF(a,b,c,d,e,f,g,h,i,j) \
74         a = i,
75
76 enum {
77 #include "mono/cil/opcode.def"
78         CEE_LASTOP
79 };
80 #undef OPDEF
81
82 #define MONO_VARINFO(cfg,varnum) ((cfg)->vars [varnum])
83
84 #define MONO_INST_NEW(cfg,dest,op) do { \
85                 (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst));       \
86                 (dest)->opcode = (op);  \
87         } while (0)
88
89 #define MONO_INST_NEW_CALL(cfg,dest,op) do {    \
90                 (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoCallInst));   \
91                 (dest)->inst.opcode = (op);     \
92         } while (0)
93
94 #define MONO_INST_NEW_CALL_ARG(cfg,dest,op) do {        \
95                 (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoCallArgParm));        \
96                 (dest)->ins.opcode = (op);      \
97         } while (0)
98
99 #define MONO_ADD_INS(b,inst) do {       \
100                 if ((b)->last_ins) {    \
101                         (b)->last_ins->next = (inst);   \
102                         (b)->last_ins = (inst); \
103                 } else {        \
104                         (b)->code = (b)->last_ins = (inst);     \
105                 }       \
106         } while (0)
107
108 typedef struct MonoInst MonoInst;
109 typedef struct MonoCallInst MonoCallInst;
110 typedef struct MonoCallArgParm MonoCallArgParm;
111 typedef struct MonoEdge MonoEdge;
112 typedef struct MonoMethodVar MonoMethodVar;
113 typedef struct MonoBasicBlock MonoBasicBlock;
114 typedef struct MonoLMF MonoLMF;
115 typedef struct MonoSpillInfo MonoSpillInfo;
116 typedef struct MonoTraceSpec MonoTraceSpec;
117
118 extern guint32 mono_jit_tls_id;
119 extern MonoTraceSpec *mono_jit_trace_calls;
120 extern gboolean mono_break_on_exc;
121 extern int mono_exc_esp_offset;
122 #ifdef DISABLE_AOT
123 #define mono_compile_aot 0
124 #else
125 extern gboolean mono_compile_aot;
126 #endif
127 extern gboolean mono_use_security_manager;
128
129 struct MonoEdge {
130         MonoEdge *next;
131         MonoBasicBlock *bb;
132         /* add edge type? */
133 };
134
135 struct MonoSpillInfo {
136 #ifndef MONO_ARCH_HAS_XP_REGALLOC
137         MonoSpillInfo *next;
138 #endif
139         int offset;
140 };
141
142 /*
143  * This structure contains the information maintained by the verifier for each CIL
144  * stack slot. This information is also available in MonoInst, but the verifier needs to
145  * update the type information during stack merges, which could lead to problems if done
146  * on MonoInsts, so we use a dedicated structure instead.
147  */
148 typedef struct {
149         int type;
150         MonoClass *klass;
151 } MonoStackSlot;
152
153 /*
154  * The IR-level basic block.  
155  *
156  * A basic block can have multiple exits just fine, as long as the point of
157  * 'departure' is the last instruction in the basic block. Extended basic
158  * blocks, on the other hand, may have instructions that leave the block
159  * midstream. The important thing is that they cannot be _entered_
160  * midstream, ie, execution of a basic block (or extened bb) always start
161  * at the beginning of the block, never in the middle.
162  */
163 struct MonoBasicBlock {
164         MonoInst *last_ins;
165
166         /* the next basic block in the order it appears in IL */
167         MonoBasicBlock *next_bb;
168
169         /*
170          * Before instruction selection it is the first tree in the
171          * forest and the first item in the list of trees. After
172          * instruction selection it is the first instruction and the
173          * first item in the list of instructions.
174          */
175         MonoInst *code;
176
177         /* unique block number identification */
178         gint32 block_num;
179         
180         gint32 dfn;
181
182         /* Basic blocks: incoming and outgoing counts and pointers */
183         /* Each bb should only appear once in each array */
184         gint16 out_count, in_count;
185         MonoBasicBlock **in_bb;
186         MonoBasicBlock **out_bb;
187
188         /* Points to the start of the CIL code that initiated this BB */
189         unsigned char* cil_code;
190
191         /* Length of the CIL block */
192         gint32 cil_length;
193
194         /* The address of the generated code, used for fixups */
195         int native_offset;
196         int max_offset;
197
198         /* Visited and reachable flags */
199         guint32 flags;
200
201         /*
202          * SSA and loop based flags
203          */
204         MonoBitSet *dominators;
205         MonoBitSet *dfrontier;
206         MonoBasicBlock *idom;
207         GList *dominated;
208         /* fast dominator algorithm */
209         MonoBasicBlock *df_parent, *ancestor, *child, *label;
210         MonoEdge *bucket;
211         int size, sdom, idomn;
212         
213         /* loop nesting and recognition */
214         GList *loop_blocks;
215         gint8  nesting;
216         gint8  loop_body_start;
217
218         /* 
219          * Whenever the bblock is rarely executed so it should be emitted after
220          * the function epilog.
221          */
222         guint out_of_line : 1;
223         /* Caches the result of uselessness calculation during optimize_branches */
224         guint not_useless : 1;
225
226         /* use for liveness analysis */
227         MonoBitSet *gen_set;
228         MonoBitSet *kill_set;
229         MonoBitSet *live_in_set;
230         MonoBitSet *live_out_set;
231
232         /* fields to deal with non-empty stack slots at bb boundary */
233         guint16 out_scount, in_scount;
234         MonoInst **out_stack;
235         MonoInst **in_stack;
236         MonoStackSlot *stack_state; /* Verification stack state on enter to bblock */
237
238         /* we use that to prevent merging of bblock covered by different clauses*/
239         guint real_offset;
240
241         /*
242          * The region encodes whether the basic block is inside
243          * a finally, catch, filter or none of thoese.
244          *
245          * If the value is -1, then it is neither finally, catch nor filter
246          *
247          * Otherwise the format is:
248          *
249          *  Bits: |     0-3      |       4-7      |     8-31
250          *        |              |                |
251          *        | clause-flags |   MONO_REGION  | clause-index 
252          *
253          */
254         guint region;
255
256         /* The current symbolic register number, used in local register allocation. */
257         guint32 max_ireg, max_freg;
258 };
259
260 /* BBlock flags */
261 enum {
262         BB_VISITED            = 1 << 0,
263         BB_REACHABLE          = 1 << 1,
264         BB_EXCEPTION_DEAD_OBJ = 1 << 2,
265         BB_EXCEPTION_UNSAFE   = 1 << 3,
266         BB_EXCEPTION_HANDLER  = 1 << 4
267 };
268
269 struct MonoInst {
270         union {
271                 union {
272                         MonoInst *src;
273                         MonoMethodVar *var;
274                         gssize const_val;
275                         gpointer p;
276                         MonoMethod *method;
277                         MonoMethodSignature *signature;
278                         MonoBasicBlock **many_blocks;
279                         MonoBasicBlock *target_block;
280                         MonoInst **args;
281                         MonoType *vtype;
282                         MonoClass *klass;
283                         int *phi_args;
284                 } op [2];
285                 gint64 i8const;
286                 double r8const;
287         } data;
288         guint16 opcode;
289         guint8  type; /* stack type */
290         guint   ssa_op : 3;
291         guint8  flags  : 5;
292         
293         /* used by the register allocator */
294         gint32 dreg, sreg1, sreg2, unused;
295         
296         MonoInst *next;
297         MonoClass *klass;
298         const unsigned char* cil_code; /* for debugging and bblock splitting */
299 };
300         
301 struct MonoCallInst {
302         MonoInst inst;
303         MonoMethodSignature *signature;
304         MonoMethod *method;
305         MonoInst **args;
306         MonoInst *out_args;
307         gconstpointer fptr;
308         guint stack_usage;
309         gboolean virtual;
310         regmask_t used_iregs;
311         regmask_t used_fregs;
312 #if defined(MONO_ARCH_HAS_XP_LOCAL_REGALLOC)
313         GSList *out_ireg_args;
314         GSList *out_freg_args;
315 #endif
316 };
317
318 struct MonoCallArgParm {
319         MonoInst ins;
320         gint32 size;
321         gint32 offset;
322         gint32 offPrm;
323 };
324
325 /* 
326  * flags for MonoInst
327  * Note: some of the values overlap, because they can't appear
328  * in the same MonoInst.
329  */
330 enum {
331         MONO_INST_HAS_METHOD = 1,
332         /* temp local created by a DUP: used only within a BB */
333         MONO_INST_IS_TEMP    = 1,
334         MONO_INST_INIT       = 1, /* in localloc */
335         MONO_INST_IS_DEAD    = 2,
336         MONO_INST_TAILCALL   = 4,
337         MONO_INST_VOLATILE   = 4,
338         MONO_INST_BRLABEL    = 4,
339         MONO_INST_NOTYPECHECK    = 4,
340         MONO_INST_UNALIGNED  = 8,
341         MONO_INST_DEFINITION_HAS_SIDE_EFFECTS = 8,
342         /* the address of the variable has been taken */
343         MONO_INST_INDIRECT   = 16,
344         MONO_INST_NORANGECHECK   = 16
345 };
346
347 #define inst_c0 data.op[0].const_val
348 #define inst_c1 data.op[1].const_val
349 #define inst_i0 data.op[0].src
350 #define inst_i1 data.op[1].src
351 #define inst_p0 data.op[0].p
352 #define inst_p1 data.op[1].p
353 #define inst_l  data.i8const
354 #define inst_r  data.r8const
355 #define inst_left  data.op[0].src
356 #define inst_right data.op[1].src
357
358 #define inst_newa_len   data.op[0].src
359 #define inst_newa_class data.op[1].klass
360
361 #define inst_var    data.op[0].var
362 #define inst_vtype  data.op[1].vtype
363 /* in branch instructions */
364 #define inst_many_bb   data.op[1].many_blocks
365 #define inst_target_bb data.op[0].target_block
366 #define inst_true_bb   data.op[1].many_blocks[0]
367 #define inst_false_bb  data.op[1].many_blocks[1]
368
369 #define inst_basereg sreg1
370 #define inst_indexreg sreg2
371 #define inst_destbasereg dreg
372 #define inst_offset data.op[0].const_val
373 #define inst_imm    data.op[1].const_val
374
375 #define inst_phi_args   data.op[1].phi_args
376
377 /* instruction description for use in regalloc/scheduling */
378 enum {
379         MONO_INST_DEST,
380         MONO_INST_SRC1,
381         MONO_INST_SRC2,
382         MONO_INST_FLAGS,
383         MONO_INST_CLOB,
384         MONO_INST_COST,
385         MONO_INST_DELAY,
386         MONO_INST_RES,
387         MONO_INST_LEN,
388         MONO_INST_MAX
389 };
390
391 typedef union {
392         struct {
393                 guint16 tid; /* tree number */
394                 guint16 bid; /* block number */
395         } pos ;
396         guint32 abs_pos; 
397 } MonoPosition;
398
399 typedef struct {
400         MonoPosition first_use, last_use;
401 } MonoLiveRange;
402
403 /*
404  * Additional information about a variable
405  */
406 struct MonoMethodVar {
407         guint           idx; /* inside cfg->varinfo, cfg->vars */
408         guint           last_name;
409         MonoBitSet     *dfrontier;
410         MonoLiveRange   range; /* generated by liveness analysis */
411         int             reg; /* != -1 if allocated into a register */
412         int             spill_costs;
413         MonoBitSet     *def_in; /* used by SSA */
414         MonoInst       *def;    /* used by SSA */
415         MonoBasicBlock *def_bb; /* used by SSA */
416         GList          *uses;   /* used by SSA */
417         char            cpstate;  /* used by SSA conditional  constant propagation */
418 };
419
420 typedef struct {
421         gpointer          end_of_stack;
422         guint32           stack_size;
423         MonoLMF          *lmf;
424         MonoLMF          *first_lmf;
425         gpointer         signal_stack;
426         guint32          signal_stack_size;
427         void            (*abort_func) (MonoObject *object);
428 } MonoJitTlsData;
429
430 typedef enum {
431         MONO_PATCH_INFO_BB,
432         MONO_PATCH_INFO_ABS,
433         MONO_PATCH_INFO_LABEL,
434         MONO_PATCH_INFO_METHOD,
435         MONO_PATCH_INFO_METHOD_JUMP,
436         MONO_PATCH_INFO_METHOD_REL,
437         MONO_PATCH_INFO_METHODCONST,
438         MONO_PATCH_INFO_INTERNAL_METHOD,
439         MONO_PATCH_INFO_SWITCH,
440         MONO_PATCH_INFO_EXC,
441         MONO_PATCH_INFO_EXC_NAME,
442         MONO_PATCH_INFO_CLASS,
443         MONO_PATCH_INFO_IMAGE,
444         MONO_PATCH_INFO_FIELD,
445         MONO_PATCH_INFO_VTABLE,
446         MONO_PATCH_INFO_CLASS_INIT,
447         MONO_PATCH_INFO_SFLDA,
448         MONO_PATCH_INFO_LDSTR,
449         MONO_PATCH_INFO_LDTOKEN,
450         MONO_PATCH_INFO_TYPE_FROM_HANDLE,
451         MONO_PATCH_INFO_R4,
452         MONO_PATCH_INFO_R8,
453         MONO_PATCH_INFO_IP,
454         MONO_PATCH_INFO_IID,
455         MONO_PATCH_INFO_ADJUSTED_IID,
456         MONO_PATCH_INFO_BB_OVF,
457         MONO_PATCH_INFO_EXC_OVF,
458         MONO_PATCH_INFO_WRAPPER,
459         MONO_PATCH_INFO_GOT_OFFSET,
460         MONO_PATCH_INFO_DECLSEC,
461         MONO_PATCH_INFO_NONE
462 } MonoJumpInfoType;
463
464 /*
465  * We need to store the image which the token refers to along with the token,
466  * since the image might not be the same as the image of the method which
467  * contains the relocation, because of inlining.
468  */
469 typedef struct MonoJumpInfoToken {
470         MonoImage *image;
471         guint32 token;
472 } MonoJumpInfoToken;
473
474 typedef struct MonoJumpInfoBBTable {
475         MonoBasicBlock **table;
476         int table_size;
477 } MonoJumpInfoBBTable;
478
479 typedef struct MonoJumpInfo MonoJumpInfo;
480 struct MonoJumpInfo {
481         MonoJumpInfo *next;
482         union {
483                 int i;
484                 guint8 *p;
485                 MonoInst *label;
486         } ip;
487
488         MonoJumpInfoType type;
489         union {
490                 gconstpointer   target;
491 #if SIZEOF_VOID_P == 8
492                 gint64          offset;
493 #else
494                 int             offset;
495 #endif
496                 MonoBasicBlock *bb;
497                 MonoInst       *inst;
498                 MonoMethod     *method;
499                 MonoClass      *klass;
500                 MonoClassField *field;
501                 MonoImage      *image;
502                 MonoVTable     *vtable;
503                 const char     *name;
504                 MonoJumpInfoToken  *token;
505                 MonoJumpInfoBBTable *table;
506         } data;
507 };
508
509 typedef enum {
510         MONO_TRAMPOLINE_GENERIC,
511         MONO_TRAMPOLINE_JUMP,
512         MONO_TRAMPOLINE_CLASS_INIT,
513         MONO_TRAMPOLINE_AOT,
514         MONO_TRAMPOLINE_AOT_PLT,
515         MONO_TRAMPOLINE_DELEGATE,
516         MONO_TRAMPOLINE_NUM
517 } MonoTrampolineType;
518
519 /* optimization flags: keep up to date with the name array in driver.c */
520 enum {
521         MONO_OPT_PEEPHOLE = 1 << 0,
522         MONO_OPT_BRANCH   = 1 << 1,
523         MONO_OPT_INLINE   = 1 << 2,
524         MONO_OPT_CFOLD    = 1 << 3,
525         MONO_OPT_CONSPROP = 1 << 4,
526         MONO_OPT_COPYPROP = 1 << 5,
527         MONO_OPT_DEADCE   = 1 << 6,
528         MONO_OPT_LINEARS  = 1 << 7,
529         MONO_OPT_CMOV     = 1 << 8,
530         MONO_OPT_SHARED   = 1 << 9,
531         MONO_OPT_SCHED    = 1 << 10,
532         MONO_OPT_INTRINS  = 1 << 11,
533         MONO_OPT_TAILC    = 1 << 12,
534         MONO_OPT_LOOP     = 1 << 13,
535         MONO_OPT_FCMOV    = 1 << 14,
536         MONO_OPT_LEAF     = 1 << 15,
537         MONO_OPT_AOT      = 1 << 16,
538         MONO_OPT_PRECOMP  = 1 << 17,
539         MONO_OPT_ABCREM   = 1 << 18,
540         MONO_OPT_SSAPRE   = 1 << 19,
541         MONO_OPT_EXCEPTION= 1 << 20,
542         MONO_OPT_SSA      = 1 << 21,
543         MONO_OPT_TREEPROP = 1 << 22
544 };
545
546 /* Bit-fields in the MonoBasicBlock.region */
547 #define MONO_REGION_TRY       0
548 #define MONO_REGION_FINALLY  16
549 #define MONO_REGION_CATCH    32
550 #define MONO_REGION_FAULT    64         /* Currently unused */
551 #define MONO_REGION_FILTER  128
552
553 #define MONO_BBLOCK_IS_IN_REGION(bblock, regtype) (((bblock)->region & (0xf << 4)) == (regtype))
554
555 /*
556  * Control Flow Graph and compilation unit information
557  */
558 typedef struct {
559         MonoMethod      *method;
560         MonoMemPool     *mempool;
561         MonoInst       **varinfo;
562         MonoMethodVar  **vars;
563         MonoInst        *ret;
564         MonoBasicBlock  *bb_entry;
565         MonoBasicBlock  *bb_exit;
566         MonoBasicBlock  *bb_init;
567         MonoBasicBlock **bblocks;
568         GHashTable      *bb_hash;
569         MonoMemPool     *state_pool; /* used by instruction selection */
570         MonoBasicBlock  *cbb;        /* used by instruction selection */
571         MonoInst        *prev_ins;   /* in decompose */
572         MonoJumpInfo    *patch_info;
573         MonoJitInfo     *jit_info;
574         MonoJitDynamicMethodInfo *dynamic_info;
575         guint            num_bblocks;
576         guint            locals_start;
577         guint            num_varinfo; /* used items in varinfo */
578         guint            varinfo_count; /* total storage in varinfo */
579         gint             stack_offset;
580         gint             max_ireg;
581         MonoRegState    *rs;
582         MonoSpillInfo   *spill_info; /* machine register spills */
583         MonoSpillInfo   *spill_info_float; /* fp register spills */
584         gint             spill_count;
585         gint             spill_info_len, spill_info_float_len;
586         /* unsigned char   *cil_code; */
587         MonoMethod      *inlined_method; /* the method which is currently inlined */
588         MonoInst        *domainvar; /* a cache for the current domain */
589         MonoInst        *got_var; /* Global Offset Table variable */
590         
591         struct MonoAliasingInformation *aliasing_info;
592
593         /* A hashtable of region ID-> SP var mappings */
594         /* An SP var is a place to store the stack pointer (used by handlers)*/
595         GHashTable      *spvars;
596
597         /* A hashtable of region ID -> EX var mappings */
598         /* An EX var stores the exception object passed to catch/filter blocks */
599         GHashTable      *exvars;
600
601         GList           *ldstr_list; /* used by AOT */
602         
603         MonoDomain      *domain;
604
605         unsigned char   *native_code;
606         guint            code_size;
607         guint            code_len;
608         guint            prolog_end;
609         guint            epilog_begin;
610         regmask_t        used_int_regs;
611         guint32          opt;
612         guint32          prof_options;
613         guint32          flags;
614         guint32          comp_done;
615         guint32          verbose_level;
616         guint32          stack_usage;
617         guint32          param_area;
618         guint32          frame_reg;
619         gint32           sig_cookie;
620         guint            disable_aot : 1;
621         guint            disable_ssa : 1;
622         guint            run_cctors : 1;
623         guint            need_lmf_area : 1;
624         guint            compile_aot : 1;
625         guint            got_var_allocated : 1;
626         guint            ret_var_is_local : 1;
627         guint            dont_verify_stack_merge : 1;
628         guint            unverifiable : 1;
629         gpointer         debug_info;
630         guint32          lmf_offset;
631         guint16          *intvars;
632         MonoProfileCoverageInfo *coverage_info;
633         MonoCompileArch  arch;
634         guint32          exception_type;        /* MONO_EXCEPTION_* */
635         guint32          exception_data;
636         char*            exception_message;
637
638         /* Fields used by the local reg allocator */
639         void*            reginfo;
640         void*            reginfof;
641         void*            reverse_inst_list;
642         int              reginfo_len, reginfof_len;
643         int              reverse_inst_list_len;
644 } MonoCompile;
645
646 typedef enum {
647         MONO_CFG_HAS_ALLOCA = 1 << 0,
648         MONO_CFG_HAS_CALLS  = 1 << 1,
649         MONO_CFG_HAS_LDELEMA  = 1 << 2,
650         MONO_CFG_HAS_VARARGS  = 1 << 3,
651         MONO_CFG_HAS_TAIL     = 1 << 4,
652         MONO_CFG_HAS_FPOUT    = 1 << 5, /* there are fp values passed in int registers */
653         MONO_CFG_HAS_SPILLUP  = 1 << 6  /* spill var slots are allocated from bottom to top */
654 } MonoCompileFlags;
655
656 typedef struct {
657         gulong methods_compiled;
658         gulong methods_aot;
659         gulong methods_lookups;
660         gulong method_trampolines;
661         gulong allocate_var;
662         gulong analyze_stack_repeat;
663         gulong cil_code_size;
664         gulong native_code_size;
665         gulong code_reallocs;
666         gulong max_code_size_ratio;
667         gulong biggest_method_size;
668         gulong allocated_code_size;
669         gulong inlineable_methods;
670         gulong inlined_methods;
671         gulong basic_blocks;
672         gulong max_basic_blocks;
673         gulong cas_declsec_check;
674         gulong cas_linkdemand_icall;
675         gulong cas_linkdemand_pinvoke;
676         gulong cas_linkdemand_aptc;
677         gulong cas_linkdemand;
678         gulong cas_demand_generation;
679         MonoMethod *max_ratio_method;
680         MonoMethod *biggest_method;
681         gboolean enabled;
682 } MonoJitStats;
683
684 extern MonoJitStats mono_jit_stats;
685
686 /* values for MonoInst.ssa_op */
687 enum {
688         MONO_SSA_NOP = 0,
689         MONO_SSA_ADDRESS_TAKEN = 1,
690         MONO_SSA_LOAD = 2,
691         MONO_SSA_STORE = 4,
692         MONO_SSA_LOAD_STORE = MONO_SSA_LOAD|MONO_SSA_STORE,
693         MONO_SSA_INDIRECT_LOAD = MONO_SSA_LOAD|MONO_SSA_ADDRESS_TAKEN,
694         MONO_SSA_INDIRECT_STORE = MONO_SSA_STORE|MONO_SSA_ADDRESS_TAKEN,
695         MONO_SSA_INDIRECT_LOAD_STORE =
696         MONO_SSA_LOAD|MONO_SSA_STORE|MONO_SSA_ADDRESS_TAKEN
697 };
698
699 #define OP_CEQ    (256+CEE_CEQ)
700 #define OP_CLT    (256+CEE_CLT)
701 #define OP_CLT_UN (256+CEE_CLT_UN)
702 #define OP_CGT    (256+CEE_CGT)
703 #define OP_CGT_UN (256+CEE_CGT_UN)
704 #define OP_LOCALLOC (256+CEE_LOCALLOC)
705
706 /* opcodes: value assigned after all the CIL opcodes */
707 #ifdef MINI_OP
708 #undef MINI_OP
709 #endif
710 #define MINI_OP(a,b) a,
711 enum {
712         OP_START = MONO_CEE_LAST,
713 #include "mini-ops.h"
714         OP_LAST
715 };
716 #undef MINI_OP
717
718 #if SIZEOF_VOID_P == 8
719 #define OP_PCONST OP_I8CONST
720 #define OP_PADD OP_LADD
721 #define OP_PNEG OP_LNEG
722 #define OP_PCONV_TO_U2 OP_LCONV_TO_U2
723 #define OP_PCONV_TO_OVF_I1_UN OP_LCONV_TO_OVF_I1_UN
724 #define OP_PCONV_TO_OVF_I1 OP_LCONV_TO_OVF_I1
725 #define OP_PCEQ CEE_CEQ
726 #define OP_STOREP_MEMBASE_REG OP_STOREI8_MEMBASE_REG
727 #define OP_STOREP_MEMBASE_IMM OP_STOREI8_MEMBASE_IMM
728 #else
729 #define OP_PCONST OP_ICONST
730 #define OP_PADD CEE_ADD
731 #define OP_PNEG CEE_NEG
732 #define OP_PCONV_TO_U2 CEE_CONV_U2
733 #define OP_PCONV_TO_OVF_I1_UN CEE_CONV_OVF_I1_UN
734 #define OP_PCONV_TO_OVF_I1 CEE_CONV_OVF_I1
735 #define OP_PCEQ CEE_CEQ
736 #define OP_STOREP_MEMBASE_REG OP_STOREI4_MEMBASE_REG
737 #define OP_STOREP_MEMBASE_IMM OP_STOREI4_MEMBASE_IMM
738 #endif
739
740 typedef enum {
741         STACK_INV,
742         STACK_I4,
743         STACK_I8,
744         STACK_PTR,
745         STACK_R8,
746         STACK_MP,
747         STACK_OBJ,
748         STACK_VTYPE,
749         STACK_MAX
750 } MonoStackType;
751
752 typedef struct {
753         union {
754                 double   r8;
755                 gint32   i4;
756                 gint64   i8;
757                 gpointer p;
758                 MonoClass *klass;
759         } data;
760         int type;
761 } StackSlot;
762
763 #if HAVE_ARRAY_ELEM_INIT
764 extern const guint8 mono_burg_arity [];
765 #else
766 extern guint8 mono_burg_arity [];
767 #endif
768
769 enum {
770         MONO_COMP_DOM = 1,
771         MONO_COMP_IDOM = 2,
772         MONO_COMP_DFRONTIER = 4,
773         MONO_COMP_DOM_REV = 8,
774         MONO_COMP_LIVENESS = 16,
775         MONO_COMP_SSA = 32,
776         MONO_COMP_SSA_DEF_USE = 64,
777         MONO_COMP_REACHABILITY = 128,
778         MONO_COMP_LOOPS = 256
779 };
780
781 typedef enum {
782         MONO_GRAPH_CFG = 1,
783         MONO_GRAPH_DTREE = 2,
784         MONO_GRAPH_CFG_CODE = 4,
785         MONO_GRAPH_CFG_SSA = 8,
786         MONO_GRAPH_CFG_OPTCODE = 16
787 } MonoGraphOptions;
788
789 typedef struct {
790         guint16 size;
791         guint16 offset;
792         guint8  pad;
793 } MonoJitArgumentInfo;
794
795 typedef struct {
796         gboolean handle_sigint;
797         gboolean keep_delegates;
798         gboolean collect_pagefault_stats;
799 } MonoDebugOptions;
800
801 enum {
802         BRANCH_NOT_TAKEN,
803         BRANCH_TAKEN,
804         BRANCH_UNDEF
805 };
806
807 /* Implicit exceptions */
808 enum {
809         MONO_EXC_INDEX_OUT_OF_RANGE,
810         MONO_EXC_OVERFLOW,
811         MONO_EXC_ARITHMETIC,
812         MONO_EXC_DIVIDE_BY_ZERO,
813         MONO_EXC_INVALID_CAST,
814         MONO_EXC_NULL_REF,
815         MONO_EXC_ARRAY_TYPE_MISMATCH,
816         MONO_EXC_INTRINS_NUM
817 };
818
819 typedef void (*MonoInstFunc) (MonoInst *tree, gpointer data);
820
821 /* main function */
822 int         mono_main                      (int argc, char* argv[]);
823 void        mono_set_defaults              (int verbose_level, guint32 opts);
824 MonoDomain* mini_init                      (const char *filename);
825 void        mini_cleanup                   (MonoDomain *domain);
826
827 /* helper methods */
828 MonoJumpInfoToken * mono_jump_info_token_new (MonoMemPool *mp, MonoImage *image, guint32 token);
829 MonoInst* mono_find_spvar_for_region        (MonoCompile *cfg, int region);
830 void      mono_precompile_assemblies        (void);
831 int       mono_parse_default_optimizations  (const char* p);
832 void      mono_bblock_add_inst              (MonoBasicBlock *bb, MonoInst *inst);
833 void      mono_constant_fold                (MonoCompile *cfg);
834 void      mono_constant_fold_inst           (MonoInst *inst, gpointer data);
835 int       mono_eval_cond_branch             (MonoInst *branch);
836 int       mono_is_power_of_two              (guint32 val);
837 void      mono_cprop_local                  (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **acp, int acp_size);
838 MonoInst* mono_compile_create_var           (MonoCompile *cfg, MonoType *type, int opcode);
839 void      mono_compile_make_var_load        (MonoCompile *cfg, MonoInst *dest, gssize var_index);
840 MonoInst* mono_compile_create_var_load      (MonoCompile *cfg, gssize var_index);
841 MonoInst* mono_compile_create_var_store     (MonoCompile *cfg, gssize var_index, MonoInst *value);
842 MonoType* mono_type_from_stack_type         (MonoInst *ins);
843 void      mono_blockset_print               (MonoCompile *cfg, MonoBitSet *set, const char *name, guint idom);
844 void      mono_print_tree                   (MonoInst *tree);
845 void      mono_print_tree_nl                (MonoInst *tree);
846 void      mono_print_code                   (MonoCompile *cfg);
847 void      mono_print_method_from_ip         (void *ip);
848 char     *mono_pmip                         (void *ip);
849 void      mono_select_instructions          (MonoCompile *cfg);
850 const char* mono_inst_name                  (int op);
851 void      mono_inst_foreach                 (MonoInst *tree, MonoInstFunc func, gpointer data);
852 void      mono_disassemble_code             (MonoCompile *cfg, guint8 *code, int size, char *id);
853 void      mono_add_patch_info               (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target);
854 void      mono_remove_patch_info            (MonoCompile *cfg, int ip);
855 MonoJumpInfo* mono_patch_info_dup_mp        (MonoMemPool *mp, MonoJumpInfo *patch_info);
856 gpointer  mono_resolve_patch_target         (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *patch_info, gboolean run_cctors);
857 MonoLMF** mono_get_lmf_addr                 (void);
858 void      mono_jit_thread_attach            (MonoDomain *domain);
859 guint32   mono_get_jit_tls_key              (void);
860 gint32    mono_get_lmf_tls_offset           (void);
861 GList    *mono_varlist_insert_sorted        (MonoCompile *cfg, GList *list, MonoMethodVar *mv, gboolean sort_end);
862 GList    *mono_varlist_sort                 (MonoCompile *cfg, GList *list, int sort_type);
863 void      mono_analyze_liveness             (MonoCompile *cfg);
864 void      mono_linear_scan                  (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_mask);
865 void      mono_create_jump_table            (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks);
866 int       mono_compile_assembly             (MonoAssembly *ass, guint32 opts, const char *aot_options);
867 MonoCompile *mini_method_compile            (MonoMethod *method, guint32 opts, MonoDomain *domain, gboolean run_cctors, gboolean compile_aot, int parts);
868 void      mono_destroy_compile              (MonoCompile *cfg);
869 MonoJitICallInfo *mono_find_jit_opcode_emulation (int opcode);
870
871
872 void      mono_aot_init                     (void);
873 MonoJitInfo*  mono_aot_get_method           (MonoDomain *domain,
874                                                                                          MonoMethod *method);
875 gpointer  mono_aot_get_method_from_token    (MonoDomain *domain, MonoImage *image, guint32 token);
876 gboolean  mono_aot_is_got_entry             (guint8 *code, guint8 *addr);
877 guint8*   mono_aot_get_plt_entry            (guint8 *code);
878 gboolean  mono_aot_init_vtable              (MonoVTable *vtable);
879 gboolean  mono_aot_get_cached_class_info    (MonoClass *klass, MonoCachedClassInfo *res);
880 MonoJitInfo* mono_aot_find_jit_info         (MonoDomain *domain, MonoImage *image, gpointer addr);
881 void mono_aot_set_make_unreadable           (gboolean unreadable);
882 gboolean mono_aot_is_pagefault              (void *ptr);
883 void mono_aot_handle_pagefault              (void *ptr);
884 guint32 mono_aot_get_n_pagefaults           (void);
885 gpointer mono_aot_plt_resolve               (gpointer aot_module, guint32 plt_info_offset, guint8 *code);
886
887 gboolean  mono_method_blittable             (MonoMethod *method);
888 gboolean  mono_method_same_domain           (MonoJitInfo *caller, MonoJitInfo *callee);
889
890 void      mono_register_opcode_emulation    (int opcode, const char* name, const char *sigstr, gpointer func, gboolean no_throw);
891 void      mono_draw_graph                   (MonoCompile *cfg, MonoGraphOptions draw_options);
892 void      mono_add_varcopy_to_end           (MonoCompile *cfg, MonoBasicBlock *bb, int src, int dest);
893 void      mono_add_ins_to_end               (MonoBasicBlock *bb, MonoInst *inst);
894 gpointer  mono_create_ftnptr                (MonoDomain *domain, gpointer addr);
895
896 int               mono_find_method_opcode      (MonoMethod *method);
897 MonoJitICallInfo *mono_find_jit_icall_by_name  (const char *name);
898 MonoJitICallInfo *mono_find_jit_icall_by_addr  (gconstpointer addr);
899 MonoJitICallInfo *mono_register_jit_icall      (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save);
900 gconstpointer     mono_icall_get_wrapper       (MonoJitICallInfo* callinfo);
901
902 guint8 *          mono_get_trampoline_code (MonoTrampolineType tramp_type);
903 gpointer          mono_create_jump_trampoline (MonoDomain *domain, 
904                                                                                            MonoMethod *method, 
905                                                                                            gboolean add_sync_wrapper);
906 gpointer          mono_create_class_init_trampoline (MonoVTable *vtable);
907 gpointer          mono_create_jit_trampoline (MonoMethod *method);
908 gpointer          mono_create_jit_trampoline_from_token (MonoImage *image, guint32 token);
909 MonoVTable*       mono_find_class_init_trampoline_by_addr (gconstpointer addr);
910 gpointer          mono_magic_trampoline (gssize *regs, guint8 *code, MonoMethod *m, guint8* tramp);
911 gpointer          mono_delegate_trampoline (gssize *regs, guint8 *code, MonoMethod *m, guint8* tramp);
912 gpointer          mono_aot_trampoline (gssize *regs, guint8 *code, guint8 *token_info, 
913                                                                            guint8* tramp);
914 gpointer          mono_aot_plt_trampoline (gssize *regs, guint8 *code, guint8 *token_info, 
915                                                                                    guint8* tramp);
916 void              mono_class_init_trampoline (gssize *regs, guint8 *code, MonoVTable *vtable, guint8 *tramp);
917
918 gboolean          mono_running_on_valgrind (void);
919 void*             mono_global_codeman_reserve (int size);
920 const char       *mono_regname_full (int reg, gboolean fp);
921 gint32*           mono_allocate_stack_slots_full (MonoCompile *cfg, gboolean backward, guint32 *stack_size, guint32 *stack_align);
922 gint32*           mono_allocate_stack_slots (MonoCompile *cfg, guint32 *stack_size, guint32 *stack_align);
923 void              mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb);
924 MonoInst         *mono_branch_optimize_exception_target (MonoCompile *cfg, MonoBasicBlock *bb, const char * exname);              
925
926 /* methods that must be provided by the arch-specific port */
927 void      mono_arch_cpu_init                    (void);
928 guint32   mono_arch_cpu_optimizazions           (guint32 *exclude_mask);
929 void      mono_arch_instrument_mem_needs        (MonoMethod *method, int *stack, int *code);
930 void     *mono_arch_instrument_prolog           (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments);
931 void     *mono_arch_instrument_epilog           (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments);
932 MonoCallInst *mono_arch_call_opcode             (MonoCompile *cfg, MonoBasicBlock* bb, MonoCallInst *call, int is_virtual);
933 MonoInst *mono_arch_get_inst_for_method         (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args);
934 void      mono_codegen                          (MonoCompile *cfg);
935 void      mono_call_inst_add_outarg_reg         (MonoCompile *cfg, MonoCallInst *call, int vreg, int hreg, gboolean fp);
936 const char *mono_arch_regname                   (int reg);
937 const char *mono_arch_fregname                  (int reg);
938 gpointer  mono_arch_get_throw_exception         (void);
939 gpointer  mono_arch_get_rethrow_exception       (void);
940 gpointer  mono_arch_get_throw_exception_by_name (void);
941 gpointer  mono_arch_get_throw_corlib_exception  (void);
942 guchar*   mono_arch_create_trampoline_code      (MonoTrampolineType tramp_type);
943 gpointer  mono_arch_create_jit_trampoline       (MonoMethod *method);
944 MonoJitInfo *mono_arch_create_jump_trampoline      (MonoMethod *method);
945 gpointer  mono_arch_create_class_init_trampoline(MonoVTable *vtable);
946 GList    *mono_arch_get_allocatable_int_vars    (MonoCompile *cfg);
947 GList    *mono_arch_get_global_int_regs         (MonoCompile *cfg);
948 guint32   mono_arch_regalloc_cost               (MonoCompile *cfg, MonoMethodVar *vmv);
949 void      mono_arch_patch_code                  (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors);
950 void      mono_arch_flush_icache                (guint8 *code, gint size);
951 int       mono_arch_max_epilog_size             (MonoCompile *cfg);
952 guint8   *mono_arch_emit_prolog                 (MonoCompile *cfg);
953 void      mono_arch_emit_epilog                 (MonoCompile *cfg);
954 void      mono_arch_emit_exceptions             (MonoCompile *cfg);
955 void      mono_arch_local_regalloc              (MonoCompile *cfg, MonoBasicBlock *bb);
956 void      mono_arch_output_basic_block          (MonoCompile *cfg, MonoBasicBlock *bb);
957 gboolean  mono_arch_has_unwind_info             (gconstpointer addr);
958 void      mono_arch_setup_jit_tls_data          (MonoJitTlsData *tls);
959 void      mono_arch_free_jit_tls_data           (MonoJitTlsData *tls);
960 void      mono_arch_emit_this_vret_args         (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg);
961 void      mono_arch_allocate_vars               (MonoCompile *m);
962 int       mono_arch_get_argument_info           (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info);
963 gboolean  mono_arch_print_tree                  (MonoInst *tree, int arity);
964 MonoJitInfo *mono_arch_find_jit_info            (MonoDomain *domain, 
965                                                  MonoJitTlsData *jit_tls, 
966                                                  MonoJitInfo *res, 
967                                                  MonoJitInfo *prev_ji, 
968                                                  MonoContext *ctx, 
969                                                  MonoContext *new_ctx, 
970                                                  char **trace, 
971                                                  MonoLMF **lmf, 
972                                                  int *native_offset,
973                                                  gboolean *managed);
974 gpointer mono_arch_get_call_filter              (void);
975 gpointer mono_arch_get_restore_context          (void);
976 gboolean mono_arch_handle_exception             (void *sigctx, gpointer obj, gboolean test_only);
977 gpointer mono_arch_ip_from_context              (void *sigctx);
978 void     mono_arch_sigctx_to_monoctx            (void *sigctx, MonoContext *ctx);
979 void     mono_arch_monoctx_to_sigctx            (MonoContext *mctx, void *ctx);
980 void     mono_arch_flush_register_windows       (void);
981 gboolean mono_arch_is_inst_imm                  (gint64 imm);
982 MonoInst* mono_arch_get_domain_intrinsic        (MonoCompile* cfg);
983 MonoInst* mono_arch_get_thread_intrinsic        (MonoCompile* cfg);
984 gboolean mono_arch_is_int_overflow              (void *sigctx, void *info);
985 void     mono_arch_invalidate_method            (MonoJitInfo *ji, void *func, gpointer func_arg);
986 guint32  mono_arch_get_patch_offset             (guint8 *code);
987 gpointer*mono_arch_get_vcall_slot_addr          (guint8* code, gpointer *regs);
988 gpointer*mono_arch_get_delegate_method_ptr_addr (guint8* code, gpointer *regs);
989 void     mono_arch_create_vars                  (MonoCompile *cfg);
990 void     mono_arch_save_unwind_info             (MonoCompile *cfg);
991 void     mono_arch_register_lowlevel_calls      (void);
992 gpointer mono_arch_get_unbox_trampoline         (MonoMethod *m, gpointer addr);
993 void     mono_arch_patch_callsite               (guint8 *code, guint8 *addr);
994 void     mono_arch_patch_plt_entry              (guint8 *code, guint8 *addr);
995 void     mono_arch_nullify_class_init_trampoline(guint8 *code, gssize *regs);
996 void     mono_arch_nullify_plt_entry            (guint8 *code);
997 void     mono_arch_patch_delegate_trampoline    (guint8 *code, guint8 *tramp, gssize *regs, guint8 *addr);
998 gpointer mono_arch_create_specific_trampoline   (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len);
999
1000 /* Exception handling */
1001 gboolean mono_handle_exception                  (MonoContext *ctx, gpointer obj,
1002                                                  gpointer original_ip, gboolean test_only);
1003 void     mono_handle_native_sigsegv             (int signal, void *sigctx);
1004 void     mono_print_thread_dump                 (void *sigctx);
1005 void     mono_jit_walk_stack                    (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
1006 void     mono_jit_walk_stack_from_ctx           (MonoStackWalk func, MonoContext *ctx, gboolean do_il_offset, gpointer user_data);
1007 void     mono_setup_altstack                    (MonoJitTlsData *tls);
1008 void     mono_free_altstack                     (MonoJitTlsData *tls);
1009
1010 /* the new function to do stack walks */
1011 typedef gboolean (*MonoStackFrameWalk)          (MonoDomain *domain, MonoContext *ctx, MonoJitInfo *ji, gpointer data);
1012 void      mono_walk_stack                       (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoContext *start_ctx, MonoStackFrameWalk func, gpointer user_data);
1013
1014 MonoArray *ves_icall_get_trace                  (MonoException *exc, gint32 skip, MonoBoolean need_file_info);
1015 MonoBoolean ves_icall_get_frame_info            (gint32 skip, MonoBoolean need_file_info, 
1016                                                  MonoReflectionMethod **method, 
1017                                                  gint32 *iloffset, gint32 *native_offset,
1018                                                  MonoString **file, gint32 *line, gint32 *column);
1019 MonoString *ves_icall_System_Exception_get_trace (MonoException *exc);
1020
1021 /* Dominator/SSA methods */
1022 void        mono_compile_dominator_info         (MonoCompile *cfg, int dom_flags);
1023 void        mono_compute_natural_loops          (MonoCompile *cfg);
1024 MonoBitSet* mono_compile_iterated_dfrontier     (MonoCompile *cfg, MonoBitSet *set);
1025 void        mono_ssa_compute                    (MonoCompile *cfg);
1026 void        mono_ssa_remove                     (MonoCompile *cfg);
1027 void        mono_ssa_cprop                      (MonoCompile *cfg);
1028 void        mono_ssa_deadce                     (MonoCompile *cfg);
1029 void        mono_ssa_strength_reduction         (MonoCompile *cfg);
1030 void        mono_free_loop_info                 (MonoCompile *cfg);
1031
1032 /* debugging support */
1033 void      mono_debug_init_method                (MonoCompile *cfg, MonoBasicBlock *start_block,
1034                                                  guint32 breakpoint_id);
1035 void      mono_debug_open_method                (MonoCompile *cfg);
1036 void      mono_debug_close_method               (MonoCompile *cfg);
1037 void      mono_debug_open_block                 (MonoCompile *cfg, MonoBasicBlock *bb, guint32 address);
1038 void      mono_debug_record_line_number         (MonoCompile *cfg, MonoInst *ins, guint32 address);
1039 void      mono_debug_serialize_debug_info       (MonoCompile *cfg, guint8 **out_buf, guint32 *buf_len);
1040 void      mono_debug_add_aot_method             (MonoDomain *domain,
1041                                                  MonoMethod *method, guint8 *code_start, 
1042                                                  guint8 *debug_info, guint32 debug_info_len);
1043 void      mono_debug_add_icall_wrapper          (MonoMethod *method, MonoJitICallInfo* info);
1044 void      mono_debugger_run_finally             (MonoContext *start_ctx);
1045
1046 /* Mono Debugger support */
1047 void      mono_debugger_init                    (void);
1048 int       mono_debugger_main                    (MonoDomain *domain, MonoAssembly *assembly, int argc, char **argv);
1049
1050
1051 /* Tracing */
1052 MonoTraceSpec *mono_trace_parse_options         (char *options);
1053 void           mono_trace_set_assembly          (MonoAssembly *assembly);
1054 gboolean       mono_trace_eval                  (MonoMethod *method);
1055
1056 extern void
1057 mono_perform_abc_removal (MonoCompile *cfg);
1058 extern void
1059 mono_perform_ssapre (MonoCompile *cfg);
1060 extern void
1061 mono_local_cprop (MonoCompile *cfg);
1062
1063 /* CAS - stack walk */
1064 MonoSecurityFrame* ves_icall_System_Security_SecurityFrame_GetSecurityFrame (gint32 skip);
1065 MonoArray* ves_icall_System_Security_SecurityFrame_GetSecurityStack (gint32 skip);
1066
1067 #endif /* __MONO_MINI_H__ */