1 #ifndef __MONO_MINI_H__
2 #define __MONO_MINI_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>
19 #include "mini-arch.h"
22 #define MONO_USE_AOT_COMPILER
24 /* for 32 bit systems */
25 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
26 #define MINI_LS_WORD_OFFSET 0
27 #define MINI_MS_WORD_OFFSET 4
28 #define inst_ls_word data.op[0].const_val
29 #define inst_ms_word data.op[1].const_val
31 #define MINI_LS_WORD_OFFSET 4
32 #define MINI_MS_WORD_OFFSET 0
33 #define inst_ls_word data.op[1].const_val
34 #define inst_ms_word data.op[0].const_val
37 /* Version number of the AOT file format */
38 #define MONO_AOT_FILE_VERSION "8"
41 #define mono_bitset_test_fast(set,n) (((guint32*)set)[2+(n)/32] & (1 << ((n) % 32)))
43 #define mono_bitset_test_fast(set,n) mono_bitset_test(set,n)
47 #define mono_bitset_foreach_bit(set,b,n) \
48 for (b = 0; b < n; b++)\
49 if (mono_bitset_test_fast(set,b))
50 #define mono_bitset_foreach_bit_rev(set,b,n) \
51 for (b = n - 1; b >= 0; b--)\
52 if (mono_bitset_test_fast(set,b))
54 #define mono_bitset_foreach_bit(set,b,n) \
55 for (b = mono_bitset_find_first (set, -1); b < n && b >= 0; b = mono_bitset_find_first (set, b))
56 #define mono_bitset_foreach_bit_rev(set,b,n) \
57 for (b = mono_bitset_find_last (set, n - 1); b >= 0; b = b ? mono_bitset_find_last (set, b) : -1)
62 * Pull the list of opcodes
64 #define OPDEF(a,b,c,d,e,f,g,h,i,j) \
68 #include "mono/cil/opcode.def"
73 #define MONO_VARINFO(cfg,varnum) ((cfg)->vars [varnum])
75 #define MONO_INST_NEW(cfg,dest,op) do { \
76 (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
77 (dest)->opcode = (op); \
80 #define MONO_INST_NEW_CALL(cfg,dest,op) do { \
81 (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoCallInst)); \
82 (dest)->inst.opcode = (op); \
85 #define MONO_ADD_INS(b,inst) do { \
86 if ((b)->last_ins) { \
87 (b)->last_ins->next = (inst); \
88 (b)->last_ins = (inst); \
90 (b)->code = (b)->last_ins = (inst); \
94 typedef struct MonoInst MonoInst;
95 typedef struct MonoCallInst MonoCallInst;
96 typedef struct MonoEdge MonoEdge;
97 typedef struct MonoMethodVar MonoMethodVar;
98 typedef struct MonoBasicBlock MonoBasicBlock;
99 typedef struct MonoLMF MonoLMF;
100 typedef struct MonoSpillInfo MonoSpillInfo;
101 typedef struct MonoTraceSpec MonoTraceSpec;
103 extern guint32 mono_jit_tls_id;
104 extern MonoTraceSpec *mono_jit_trace_calls;
105 extern gboolean mono_break_on_exc;
106 extern int mono_exc_esp_offset;
107 extern gboolean mono_compile_aot;
115 struct MonoSpillInfo {
121 * The IR-level basic block.
123 * A basic block can have multiple exits just fine, as long as the point of
124 * 'departure' is the last instruction in the basic block. Extended basic
125 * blocks, on the other hand, may have instructions that leave the block
126 * midstream. The important thing is that they cannot be _entered_
127 * midstream, ie, execution of a basic block (or extened bb) always start
128 * at the beginning of the block, never in the middle.
130 struct MonoBasicBlock {
133 /* Points to the start of the CIL code that initiated this BB */
134 unsigned char* cil_code;
136 /* Length of the CIL block */
139 /* The address of the generated code, used for fixups */
145 /* unique block number identification */
148 /* Visited and reachable flags */
151 /* Basic blocks: incoming and outgoing counts and pointers */
152 gint16 out_count, in_count;
153 MonoBasicBlock **in_bb;
154 MonoBasicBlock **out_bb;
156 /* the next basic block in the order it appears in IL */
157 MonoBasicBlock *next_bb;
160 * Before instruction selection it is the first tree in the
161 * forest and the first item in the list of trees. After
162 * instruction selection it is the first instruction and the
163 * first item in the list of instructions.
168 * SSA and loop based flags
170 MonoBitSet *dominators;
171 MonoBitSet *dfrontier;
172 MonoBasicBlock *idom;
174 /* fast dominator algorithm */
175 MonoBasicBlock *df_parent, *ancestor, *child, *label;
177 int size, sdom, idomn;
179 /* loop nesting and recognition */
183 /* use for liveness analysis */
185 MonoBitSet *kill_set;
186 MonoBitSet *live_in_set;
187 MonoBitSet *live_out_set;
189 /* fields to deal with non-empty stack slots at bb boundary */
190 guint16 out_scount, in_scount;
191 MonoInst **out_stack;
194 /* we use that to prevent merging of bblock covered by different clauses*/
198 * The region encodes whether the basic block is inside
199 * a finally, catch, filter or none of thoese.
201 * If the value is -1, then it is neither finally, catch nor filter
203 * Otherwise the format is:
205 * Bits: | 0-3 | 4-7 | 8-31
207 * | clause-flags | MONO_REGION | clause-index
212 /* The current symbolic register number, used in local register allocation. */
213 guint32 max_ireg, max_freg;
218 #define BB_REACHABLE 2
228 MonoMethodSignature *signature;
229 MonoBasicBlock **many_blocks;
230 MonoBasicBlock *target_block;
240 guint8 type; /* stack type */
244 /* used by the register allocator */
245 gint32 dreg, sreg1, sreg2, unused;
249 const unsigned char* cil_code; /* for debugging and bblock splitting */
252 struct MonoCallInst {
254 MonoMethodSignature *signature;
261 regmask_t used_iregs;
262 regmask_t used_fregs;
267 * Note: some of the values overlap, because they can't appear
268 * in the same MonoInst.
271 MONO_INST_HAS_METHOD = 1,
272 /* temp local created by a DUP: used only within a BB */
273 MONO_INST_IS_TEMP = 1,
274 MONO_INST_INIT = 1, /* in localloc */
275 MONO_INST_IS_DEAD = 2,
276 MONO_INST_TAILCALL = 4,
277 MONO_INST_VOLATILE = 4,
278 MONO_INST_BRLABEL = 4,
279 MONO_INST_NOTYPECHECK = 4,
280 MONO_INST_UNALIGNED = 8,
281 /* the address of the variable has been taken */
282 MONO_INST_INDIRECT = 16,
283 MONO_INST_NORANGECHECK = 16
286 #define inst_c0 data.op[0].const_val
287 #define inst_c1 data.op[1].const_val
288 #define inst_i0 data.op[0].src
289 #define inst_i1 data.op[1].src
290 #define inst_p0 data.op[0].p
291 #define inst_p1 data.op[1].p
292 #define inst_l data.i8const
293 #define inst_r data.r8const
294 #define inst_left data.op[0].src
295 #define inst_right data.op[1].src
297 #define inst_newa_len data.op[0].src
298 #define inst_newa_class data.op[1].klass
300 #define inst_var data.op[0].var
301 #define inst_vtype data.op[1].vtype
302 /* in branch instructions */
303 #define inst_many_bb data.op[1].many_blocks
304 #define inst_target_bb data.op[0].target_block
305 #define inst_true_bb data.op[1].many_blocks[0]
306 #define inst_false_bb data.op[1].many_blocks[1]
308 #define inst_basereg sreg1
309 #define inst_indexreg sreg2
310 #define inst_destbasereg dreg
311 #define inst_offset data.op[0].const_val
312 #define inst_imm data.op[1].const_val
314 #define inst_phi_args data.op[1].phi_args
316 /* instruction description for use in regalloc/scheduling */
332 guint16 tid; /* tree number */
333 guint16 bid; /* block number */
339 MonoPosition first_use, last_use;
343 * Additional information about a variable
345 struct MonoMethodVar {
346 guint idx; /* inside cfg->varinfo, cfg->vars */
348 MonoBitSet *dfrontier;
349 MonoLiveRange range; /* generated by liveness analysis */
350 int reg; /* != -1 if allocated into a register */
352 MonoBitSet *def_in; /* used by SSA */
353 MonoInst *def; /* used by SSA */
354 MonoBasicBlock *def_bb; /* used by SSA */
355 GList *uses; /* used by SSA */
356 char cpstate; /* used by SSA conditional constant propagation */
360 gpointer end_of_stack;
364 gpointer signal_stack;
365 guint32 signal_stack_size;
366 void (*abort_func) (MonoObject *object);
372 MONO_PATCH_INFO_LABEL,
373 MONO_PATCH_INFO_METHOD,
374 MONO_PATCH_INFO_METHOD_JUMP,
375 MONO_PATCH_INFO_METHOD_REL,
376 MONO_PATCH_INFO_METHODCONST,
377 MONO_PATCH_INFO_INTERNAL_METHOD,
378 MONO_PATCH_INFO_SWITCH,
380 MONO_PATCH_INFO_EXC_NAME,
381 MONO_PATCH_INFO_CLASS,
382 MONO_PATCH_INFO_IMAGE,
383 MONO_PATCH_INFO_FIELD,
384 MONO_PATCH_INFO_VTABLE,
385 MONO_PATCH_INFO_CLASS_INIT,
386 MONO_PATCH_INFO_SFLDA,
387 MONO_PATCH_INFO_LDSTR,
388 MONO_PATCH_INFO_LDTOKEN,
389 MONO_PATCH_INFO_TYPE_FROM_HANDLE,
394 MONO_PATCH_INFO_BB_OVF,
395 MONO_PATCH_INFO_EXC_OVF,
396 MONO_PATCH_INFO_WRAPPER
400 * We need to store the image which the token refers to along with the token,
401 * since the image might not be the same as the image of the method which
402 * contains the relocation, because of inlining.
404 typedef struct MonoJumpInfoToken {
409 typedef struct MonoJumpInfo MonoJumpInfo;
410 struct MonoJumpInfo {
418 MonoJumpInfoType type;
420 gconstpointer target;
421 #if SIZEOF_VOID_P == 8
427 MonoBasicBlock **table;
431 MonoClassField *field;
435 MonoJumpInfoToken *token;
438 int table_size; /* use by switch */
441 /* optimization flags: keep up to date with the name array in driver.c */
443 MONO_OPT_PEEPHOLE = 1 << 0,
444 MONO_OPT_BRANCH = 1 << 1,
445 MONO_OPT_INLINE = 1 << 2,
446 MONO_OPT_CFOLD = 1 << 3,
447 MONO_OPT_CONSPROP = 1 << 4,
448 MONO_OPT_COPYPROP = 1 << 5,
449 MONO_OPT_DEADCE = 1 << 6,
450 MONO_OPT_LINEARS = 1 << 7,
451 MONO_OPT_CMOV = 1 << 8,
452 MONO_OPT_SHARED = 1 << 9,
453 MONO_OPT_SCHED = 1 << 10,
454 MONO_OPT_INTRINS = 1 << 11,
455 MONO_OPT_TAILC = 1 << 12,
456 MONO_OPT_LOOP = 1 << 13,
457 MONO_OPT_FCMOV = 1 << 14,
458 MONO_OPT_LEAF = 1 << 15,
459 MONO_OPT_AOT = 1 << 16,
460 MONO_OPT_PRECOMP = 1 << 17,
461 MONO_OPT_ABCREM = 1 << 18
464 /* Bit-fields in the MonoBasicBlock.region */
465 #define MONO_REGION_FINALLY 16
466 #define MONO_REGION_CATCH 32
467 #define MONO_REGION_FAULT 64 /* Currently unused */
468 #define MONO_REGION_FILTER 128
471 * Control Flow Graph and compilation unit information
475 MonoMemPool *mempool;
477 MonoMethodVar **vars;
479 MonoBasicBlock *bb_entry;
480 MonoBasicBlock *bb_exit;
481 MonoBasicBlock *bb_init;
482 MonoBasicBlock **bblocks;
484 MonoMemPool *state_pool; /* used by instruction selection */
485 MonoBasicBlock *cbb; /* used by instruction selection */
486 MonoInst *prev_ins; /* in decompose */
487 MonoJumpInfo *patch_info;
488 MonoJitInfo *jit_info;
491 guint num_varinfo; /* used items in varinfo */
492 guint varinfo_count; /* total storage in varinfo */
495 MonoSpillInfo *spill_info; /* machine register spills */
496 MonoSpillInfo *spill_info_float; /* fp register spills */
498 /* unsigned char *cil_code; */
499 MonoMethod *inlined_method; /* the method which is currently inlined */
501 /* the exception object passed to catch/filter blocks */
504 MonoInst *domainvar; /* a cache for the current domain */
506 /* A hashtable of region ID-> SP var mappings */
507 /* An SP var is a place to store the stack pointer (used by handlers)*/
510 GList *ldstr_list; /* used by AOT */
514 unsigned char *native_code;
519 regmask_t used_int_regs;
521 guint32 prof_options;
524 guint32 verbose_level;
529 gboolean disable_aot;
530 gboolean disable_ssa;
532 gboolean need_lmf_area;
536 MonoProfileCoverageInfo *coverage_info;
537 MonoCompileArch arch;
539 guint8 ins, locals, outs; /* reg stack region sizes */
544 MONO_CFG_HAS_ALLOCA = 1 << 0,
545 MONO_CFG_HAS_CALLS = 1 << 1,
546 MONO_CFG_HAS_LDELEMA = 1 << 2,
547 MONO_CFG_HAS_VARARGS = 1 << 3
551 gulong methods_compiled;
553 gulong methods_lookups;
554 gulong method_trampolines;
556 gulong analyze_stack_repeat;
557 gulong cil_code_size;
558 gulong native_code_size;
559 gulong code_reallocs;
560 gulong max_code_size_ratio;
561 gulong biggest_method_size;
562 gulong allocated_code_size;
563 gulong inlineable_methods;
564 gulong inlined_methods;
566 gulong max_basic_blocks;
567 MonoMethod *max_ratio_method;
568 MonoMethod *biggest_method;
572 extern MonoJitStats mono_jit_stats;
574 /* values for MonoInst.ssa_op */
583 #define OP_CEQ (256+CEE_CEQ)
584 #define OP_CLT (256+CEE_CLT)
585 #define OP_CLT_UN (256+CEE_CLT_UN)
586 #define OP_CGT (256+CEE_CGT)
587 #define OP_CGT_UN (256+CEE_CGT_UN)
588 #define OP_LOCALLOC (256+CEE_LOCALLOC)
590 /* opcodes: value assigned after all the CIL opcodes */
594 #define MINI_OP(a,b) a,
596 OP_START = MONO_CEE_LAST,
597 #include "mini-ops.h"
602 #if SIZEOF_VOID_P == 8
603 #define OP_PADD OP_LADD
604 #define OP_PNEG OP_LNEG
605 #define OP_PCONV_TO_U2 OP_LCONV_TO_U2
606 #define OP_PCONV_TO_OVF_I1_UN OP_LCONV_TO_OVF_I1_UN
607 #define OP_PCONV_TO_OVF_I1 OP_LCONV_TO_OVF_I1
608 #define OP_PCEQ CEE_CEQ
610 #define OP_PADD CEE_ADD
611 #define OP_PNEG CEE_NEG
612 #define OP_PCONV_TO_U2 CEE_CONV_U2
613 #define OP_PCONV_TO_OVF_I1_UN CEE_CONV_OVF_I1_UN
614 #define OP_PCONV_TO_OVF_I1 CEE_CONV_OVF_I1
615 #define OP_PCEQ CEE_CEQ
644 MONO_COMP_DFRONTIER = 4,
645 MONO_COMP_DOM_REV = 8,
646 MONO_COMP_LIVENESS = 16,
648 MONO_COMP_SSA_DEF_USE = 64,
649 MONO_COMP_REACHABILITY = 128,
650 MONO_COMP_LOOPS = 256
655 MONO_GRAPH_DTREE = 2,
656 MONO_GRAPH_CFG_CODE = 4,
657 MONO_GRAPH_CFG_SSA = 8,
658 MONO_GRAPH_CFG_OPTCODE = 16
665 } MonoJitArgumentInfo;
667 typedef void (*MonoInstFunc) (MonoInst *tree, gpointer data);
670 int mono_main (int argc, char* argv[]);
671 void mono_set_defaults (int verbose_level, guint32 opts);
672 MonoDomain* mini_init (const char *filename);
673 void mini_cleanup (MonoDomain *domain);
676 MonoJumpInfoToken * mono_jump_info_token_new (MonoMemPool *mp, MonoImage *image, guint32 token);
677 MonoInst* mono_find_spvar_for_region (MonoCompile *cfg, int region);
678 void mono_precompile_assemblies (void);
679 int mono_parse_default_optimizations (const char* p);
680 void mono_bblock_add_inst (MonoBasicBlock *bb, MonoInst *inst);
681 void mono_constant_fold (MonoCompile *cfg);
682 void mono_constant_fold_inst (MonoInst *inst, gpointer data);
683 int mono_is_power_of_two (guint32 val);
684 void mono_cprop_local (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **acp, int acp_size);
685 MonoInst* mono_compile_create_var (MonoCompile *cfg, MonoType *type, int opcode);
686 void mono_blockset_print (MonoCompile *cfg, MonoBitSet *set, const char *name, guint idom);
687 void mono_print_tree (MonoInst *tree);
688 void mono_print_tree_nl (MonoInst *tree);
689 void mono_print_code (MonoCompile *cfg);
690 void mono_print_method_from_ip (void *ip);
691 void mono_select_instructions (MonoCompile *cfg);
692 const char* mono_inst_name (int op);
693 void mono_inst_foreach (MonoInst *tree, MonoInstFunc func, gpointer data);
694 void mono_disassemble_code (guint8 *code, int size, char *id);
695 guint mono_type_to_ldind (MonoType *t);
696 guint mono_type_to_stind (MonoType *t);
697 void mono_add_patch_info (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target);
698 void mono_remove_patch_info (MonoCompile *cfg, int ip);
699 gpointer mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *patch_info, gboolean run_cctors);
700 MonoLMF** mono_get_lmf_addr (void);
701 GList *mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, gboolean sort_end);
702 GList *mono_varlist_sort (MonoCompile *cfg, GList *list, int sort_type);
703 void mono_analyze_liveness (MonoCompile *cfg);
704 void mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_mask);
705 void mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks);
706 int mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options);
707 MonoCompile *mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gboolean run_cctors, int parts);
708 void mono_destroy_compile (MonoCompile *cfg);
709 void mono_aot_init (void);
710 MonoJitInfo* mono_aot_get_method (MonoDomain *domain,
712 gboolean mono_method_blittable (MonoMethod *method);
713 gboolean mono_method_same_domain (MonoJitInfo *caller, MonoJitInfo *callee);
714 void mono_register_opcode_emulation (int opcode, const char* name, MonoMethodSignature *sig, gpointer func, gboolean no_throw);
715 void mono_arch_register_lowlevel_calls (void);
716 void mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options);
717 void mono_add_varcopy_to_end (MonoCompile *cfg, MonoBasicBlock *bb, int src, int dest);
719 int mono_find_method_opcode (MonoMethod *method);
720 MonoJitICallInfo *mono_find_jit_icall_by_name (const char *name);
721 MonoJitICallInfo *mono_find_jit_icall_by_addr (gconstpointer addr);
722 MonoJitICallInfo *mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save);
723 gconstpointer mono_icall_get_wrapper (MonoJitICallInfo* callinfo);
725 gpointer mono_create_jump_trampoline (MonoDomain *domain,
727 gboolean add_sync_wrapper);
728 gpointer mono_create_class_init_trampoline (MonoVTable *vtable);
729 MonoVTable* mono_find_class_init_trampoline_by_addr (gconstpointer addr);
730 gboolean mono_running_on_valgrind (void);
732 /* methods that must be provided by the arch-specific port */
733 void mono_arch_cpu_init (void);
734 guint32 mono_arch_cpu_optimizazions (guint32 *exclude_mask);
735 void mono_arch_instrument_mem_needs (MonoMethod *method, int *stack, int *code);
736 void *mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments);
737 void *mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments);
738 MonoCallInst *mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb, MonoCallInst *call, int is_virtual);
739 gint mono_arch_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args);
740 void mono_codegen (MonoCompile *cfg);
741 const char *mono_arch_regname (int reg);
742 gpointer mono_arch_get_throw_exception (void);
743 gpointer mono_arch_get_throw_exception_by_name (void);
744 gpointer mono_arch_create_jit_trampoline (MonoMethod *method);
745 MonoJitInfo *mono_arch_create_jump_trampoline (MonoMethod *method);
746 gpointer mono_arch_create_class_init_trampoline(MonoVTable *vtable);
747 GList *mono_arch_get_allocatable_int_vars (MonoCompile *cfg);
748 GList *mono_arch_get_global_int_regs (MonoCompile *cfg);
749 guint32 mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv);
750 void mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors);
751 void mono_arch_flush_icache (guint8 *code, gint size);
752 int mono_arch_max_epilog_size (MonoCompile *cfg);
753 guint8 *mono_arch_emit_prolog (MonoCompile *cfg);
754 void mono_arch_emit_epilog (MonoCompile *cfg);
755 void mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb);
756 void mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb);
757 gboolean mono_arch_has_unwind_info (gconstpointer addr);
758 void mono_arch_setup_jit_tls_data (MonoJitTlsData *tls);
759 void mono_arch_free_jit_tls_data (MonoJitTlsData *tls);
760 void mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg);
761 void mono_arch_allocate_vars (MonoCompile *m);
762 int mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info);
763 gboolean mono_arch_print_tree (MonoInst *tree, int arity);
764 MonoJitInfo *mono_arch_find_jit_info (MonoDomain *domain,
765 MonoJitTlsData *jit_tls,
767 MonoJitInfo *prev_ji,
769 MonoContext *new_ctx,
774 gpointer mono_arch_get_call_filter (void);
775 gpointer mono_arch_get_restore_context (void);
776 gboolean mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only);
777 gpointer mono_arch_ip_from_context (void *sigctx);
778 void mono_arch_flush_register_windows (void);
780 /* Exception handling */
781 gboolean mono_handle_exception (MonoContext *ctx, gpointer obj,
782 gpointer original_ip, gboolean test_only);
783 void mono_jit_walk_stack (MonoStackWalk func, gpointer user_data);
784 MonoArray *ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info);
785 MonoBoolean ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
786 MonoReflectionMethod **method,
787 gint32 *iloffset, gint32 *native_offset,
788 MonoString **file, gint32 *line, gint32 *column);
790 /* Dominator/SSA methods */
791 void mono_compile_dominator_info (MonoCompile *cfg, int dom_flags);
792 void mono_compute_natural_loops (MonoCompile *cfg);
793 MonoBitSet* mono_compile_iterated_dfrontier (MonoCompile *cfg, MonoBitSet *set);
794 void mono_ssa_compute (MonoCompile *cfg);
795 void mono_ssa_remove (MonoCompile *cfg);
796 void mono_ssa_cprop (MonoCompile *cfg);
797 void mono_ssa_deadce (MonoCompile *cfg);
798 void mono_ssa_strength_reduction (MonoCompile *cfg);
799 void mono_free_loop_info (MonoCompile *cfg);
801 /* debugging support */
802 void mono_debug_init_method (MonoCompile *cfg, MonoBasicBlock *start_block,
803 guint32 breakpoint_id);
804 void mono_debug_open_method (MonoCompile *cfg);
805 void mono_debug_close_method (MonoCompile *cfg);
806 void mono_debug_open_block (MonoCompile *cfg, MonoBasicBlock *bb, guint32 address);
807 void mono_debug_record_line_number (MonoCompile *cfg, MonoInst *ins, guint32 address);
808 void mono_debug_serialize_debug_info (MonoCompile *cfg, guint8 **out_buf, guint32 *buf_len);
809 void mono_debug_add_aot_method (MonoDomain *domain,
810 MonoMethod *method, guint8 *code_start,
811 guint8 *debug_info, guint32 debug_info_len);
812 void mono_debug_add_icall_wrapper (MonoMethod *method, MonoJitICallInfo* info);
816 MonoTraceSpec *mono_trace_parse_options (MonoAssembly *assembly, char *options);
817 gboolean mono_trace_eval (MonoMethod *method);
820 mono_perform_abc_removal (MonoCompile *cfg);
822 #endif /* __MONO_MINI_H__ */