2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / monograph / monograph.c
index 72103b0b9af9347499a7a0d5dbd1be260caa9494..11f220226c193c838a00db9c566a7dacbf49038f 100644 (file)
@@ -184,7 +184,7 @@ method_stats (MonoMethod *method) {
        if (method->flags & (METHOD_ATTRIBUTE_PINVOKE_IMPL | METHOD_ATTRIBUTE_ABSTRACT))
                return;
 
-       header = ((MonoMethodNormal *)method)->header;
+       header = mono_method_get_header (method);
        if (header->num_clauses)
                has_exceptions++;
        num_exceptions += header->num_clauses;
@@ -236,10 +236,10 @@ method_stats (MonoMethod *method) {
                        n = read32 (ip + 1);
                        if (n >= -1 && n <= 8) {
                                int_waste += 4;
-                               g_print ("%s %d\n", mono_opcode_names [i], n);
+                               g_print ("%s %d\n", mono_opcode_name (i), n);
                        } else if (n < 128 && n >= -128) {
                                int_waste += 3;
-                               g_print ("%s %d\n", mono_opcode_names [i], n);
+                               g_print ("%s %d\n", mono_opcode_name (i), n);
                        }
                        ip += 5;
                        break;
@@ -280,16 +280,16 @@ method_stats (MonoMethod *method) {
                                        case MONO_CEE_LDLOC:
                                        case MONO_CEE_STLOC:
                                                var_waste += 3;
-                                               g_print ("%s %d\n", mono_opcode_names [i], n);
+                                               g_print ("%s %d\n", mono_opcode_name (i), n);
                                                break;
                                        default:
                                                var_waste += 2;
-                                               g_print ("%s %d\n", mono_opcode_names [i], n);
+                                               g_print ("%s %d\n", mono_opcode_name (i), n);
                                                break;
                                        }
                                } else {
                                        var_waste += 2;
-                                       g_print ("%s %d\n", mono_opcode_names [i], n);
+                                       g_print ("%s %d\n", mono_opcode_name (i), n);
                                }
                        }
                        ip += 3;
@@ -301,7 +301,7 @@ method_stats (MonoMethod *method) {
                                case MONO_CEE_LDLOC_S:
                                case MONO_CEE_STLOC_S:
                                        var_waste++;
-                                       g_print ("%s %d\n", mono_opcode_names [i], (signed char)ip [1]);
+                                       g_print ("%s %d\n", mono_opcode_name (i), (signed char)ip [1]);
                                        break;
                                default:
                                        break;
@@ -311,7 +311,7 @@ method_stats (MonoMethod *method) {
                        break;
                case MonoShortInlineI:
                        if ((signed char)ip [1] <= 8 && (signed char)ip [1] >= -1) {
-                               g_print ("%s %d\n", mono_opcode_names [i], (signed char)ip [1]);
+                               g_print ("%s %d\n", mono_opcode_name (i), (signed char)ip [1]);
                                int_waste ++;
                        }
                        ip += 2;
@@ -528,7 +528,7 @@ print_method (MonoMethod *method, int depth) {
        if (method->flags & (METHOD_ATTRIBUTE_PINVOKE_IMPL | METHOD_ATTRIBUTE_ABSTRACT))
                return;
 
-       header = ((MonoMethodNormal *)method)->header;
+       header = mono_method_get_header (method);
        ip = header->code;
 
        hash = g_hash_table_new (g_direct_hash, g_direct_equal);
@@ -874,7 +874,7 @@ print_method_cfg (MonoMethod *method) {
        int i, dfn;
        char *code;
 
-       header = ((MonoMethodNormal*)method)->header;
+       header = mono_method_get_header (method);
        bblocks = mono_method_find_bblocks (header);
        for (i = 0; i < bblocks->len; ++i) {
                bb = (MonoBasicBlock*)g_ptr_array_index (bblocks, i);