Add par_alloc_object to the major collector function table.
[mono.git] / mono / mini / graph.c
index 45168cf7a7f0353250e07c428ee420dc199ecc6e..79e06a323686b67038949e75ac34bd62d588aeaa 100644 (file)
@@ -11,8 +11,6 @@
 
 #include "mini.h"
 
-extern guint8 mono_burg_arity [];
-
 static char *
 convert_name (const char *str)
 {
@@ -151,6 +149,8 @@ mono_draw_cfg (MonoCompile *cfg, FILE *fp)
        fprintf (fp, "}\n");
 }
 
+#if 0
+
 static void
 mono_print_label (FILE *fp, MonoInst *tree) {
        int arity;
@@ -164,10 +164,10 @@ mono_print_label (FILE *fp, MonoInst *tree) {
 
        switch (tree->opcode) {
        case OP_ICONST:
-               fprintf (fp, "[%d]", tree->inst_c0);
+               fprintf (fp, "[%ld]", (long)tree->inst_c0);
                break;
        case OP_I8CONST:
-               fprintf (fp, "[%lld]", tree->inst_l);
+               fprintf (fp, "[%lld]", (long long)tree->inst_l);
                break;
        case OP_R8CONST:
                fprintf (fp, "[%f]", *(double*)tree->inst_p0);
@@ -177,10 +177,10 @@ mono_print_label (FILE *fp, MonoInst *tree) {
                break;
        case OP_ARG:
        case OP_LOCAL:
-               fprintf (fp, "[%d]", tree->inst_c0);
+               fprintf (fp, "[%d]", (int)tree->inst_c0);
                break;
        case OP_REGOFFSET:
-               fprintf (fp, "[0x%x(%s)]", tree->inst_offset, mono_arch_regname (tree->inst_basereg));
+               fprintf (fp, "[0x%x(%s)]", (int)tree->inst_offset, mono_arch_regname (tree->inst_basereg));
                break;
        case OP_REGVAR:
                fprintf (fp, "[%s]", mono_arch_regname (tree->dreg));
@@ -189,8 +189,8 @@ mono_print_label (FILE *fp, MonoInst *tree) {
                fprintf (fp, "[%s]",  tree->inst_newa_class->name);
                mono_print_label (fp, tree->inst_newa_len);
                break;
-       case CEE_CALL:
-       case CEE_CALLVIRT:
+       case OP_CALL:
+       case OP_CALLVIRT:
        case OP_FCALL:
        case OP_FCALLVIRT:
        case OP_LCALL:
@@ -201,7 +201,7 @@ mono_print_label (FILE *fp, MonoInst *tree) {
        case OP_VOIDCALLVIRT: {
                MonoCallInst *call = (MonoCallInst*)tree;
                if (call->method) {
-                       if (call->method->signature->hasthis && tree->inst_left) {
+                       if (mono_method_signature (call->method)->hasthis && tree->inst_left) {
                                mono_print_label (fp, tree->inst_left);
                        }
                        fprintf (fp, "[%s]", call->method->name);
@@ -210,7 +210,7 @@ mono_print_label (FILE *fp, MonoInst *tree) {
        }
        case OP_PHI: {
                int i;
-               fprintf (fp, "[%d\\ (", tree->inst_c0);
+               fprintf (fp, "[%d\\ (", (int)tree->inst_c0);
                for (i = 0; i < tree->inst_phi_args [0]; i++) {
                        if (i)
                                fprintf (fp, ",\\ ");
@@ -219,19 +219,16 @@ mono_print_label (FILE *fp, MonoInst *tree) {
                fprintf (fp, ")]");
                break;
        }
-       case OP_RENAME:
-       case OP_RETARG:
-       case CEE_NOP:
-       case CEE_JMP:
-       case CEE_BREAK:
+       case OP_NOP:
+       case OP_JMP:
+       case OP_BREAK:
                break;
-       case CEE_BR:
+       case OP_BR:
                fprintf (fp, "[B%d]", tree->inst_target_bb->block_num);
                break;
-       case CEE_SWITCH:
+       case OP_SWITCH:
        case CEE_ISINST:
        case CEE_CASTCLASS:
-       case OP_OUTARG:
        case OP_CALL_REG:
        case OP_FCALL_REG:
        case OP_LCALL_REG:
@@ -265,6 +262,8 @@ mono_print_label (FILE *fp, MonoInst *tree) {
                fprintf (fp, ")");
 }
 
+#endif
+
 static void
 mono_draw_code_cfg (MonoCompile *cfg, FILE *fp)
 {
@@ -291,8 +290,8 @@ mono_draw_code_cfg (MonoCompile *cfg, FILE *fp)
 
                fprintf (fp, "BB%d [%sshape=record,labeljust=l,label=\"{BB%d|", bb->block_num, color, bb->block_num);
                        
-               for (inst = bb->code; inst; inst = inst->next) {
-                       mono_print_label (fp, inst);
+               MONO_BB_FOR_EACH_INS (bb, inst) {
+                       //mono_print_label (fp, inst);
                        fprintf (fp, "\\n");                    
                }