2008-08-24 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / inssel.brg
index 9b65357c2affbae878e72c424edbd7e138f44ca6..3b7b094c4ee76451ad2d1b49c8ca688f3d7e888c 100644 (file)
                MonoInst *target_label; \
                target_label = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
                target_label->opcode = OP_LABEL;        \
-               MONO_INST_LIST_ADD (&target_label->node, \
-                                  &(targetbb)->ins_list); \
+               target_label->next = (targetbb)->code; \
+        (targetbb)->code = target_label; \
                target_label->inst_c0 = (targetbb)->native_offset; \
                MONO_INST_NEW ((cfg), inst, op);        \
                inst->inst_i0 = target_label;   \
@@ -1456,6 +1456,7 @@ reg: OP_CCASTCLASS (reg) {
        MonoInst *end_label, *fail_label, *no_proxy_label, *ok_result_label;
        int obj_reg = state->left->reg1;
        int tmp_reg = mono_regstate_next_int (s->rs);
+       int tmp2_reg = mono_regstate_next_int (s->rs);
        int klass_reg = mono_regstate_next_int (s->rs);
 
        MONO_NEW_LABEL (s, end_label);
@@ -1482,12 +1483,8 @@ reg: OP_CCASTCLASS (reg) {
                        MONO_EMIT_NEW_COMPARE_IMM_EXC (s, NE_UN, klass_reg, mono_defaults.transparent_proxy_class, "InvalidCastException");
                }
                
-               
-               MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, remote_class));
-               MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoRemoteClass, proxy_class));
-               
-               MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, custom_type_info));
-               MONO_EMIT_NEW_COMPARE_IMM_EXC (s, EQ, tmp_reg, 0, "InvalidCastException");
+               MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp2_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, custom_type_info));
+               MONO_EMIT_NEW_COMPARE_IMM_EXC (s, EQ, tmp2_reg, 0, "InvalidCastException");
                
                MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
                MONO_EMIT_NEW_BRANCH_LABEL (s, OP_BR, end_label);
@@ -1512,8 +1509,8 @@ reg: OP_CCASTCLASS (reg) {
                MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, remote_class));
                MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoRemoteClass, proxy_class));
                
-               MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, custom_type_info));
-               MONO_EMIT_NEW_COMPARE_IMM_BRANCH_LABEL (s, CEE_BEQ, tmp_reg, 0, no_proxy_label);
+               MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp2_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, custom_type_info));
+               MONO_EMIT_NEW_COMPARE_IMM_BRANCH_LABEL (s, CEE_BEQ, tmp2_reg, 0, no_proxy_label);
                
                mini_emit_isinst (s, klass_reg, klass, fail_label, ok_result_label);
                mono_bblock_add_inst (s->cbb, fail_label);
@@ -1900,7 +1897,7 @@ emit_imt_argument (MonoCompile *cfg, MonoCallInst *call, gboolean have_imt_arg,
 
        mono_call_inst_add_outarg_reg (cfg, call, method_reg, MONO_ARCH_IMT_REG, FALSE);
 #else
-       mono_arch_emit_imt_argument (cfg, call);
+       mono_arch_emit_imt_argument (cfg, call, NULL);
 #endif
 }
 #endif