[jit] Make the jit code more c++ clean by renaming class->klass and this->this_arg...
authorZoltan Varga <vargaz@gmail.com>
Tue, 28 Jul 2015 02:04:42 +0000 (22:04 -0400)
committerZoltan Varga <vargaz@gmail.com>
Tue, 28 Jul 2015 02:35:57 +0000 (22:35 -0400)
mono/mini/debugger-agent.c
mono/mini/method-to-ir.c
mono/mini/mini-exceptions.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-mips.c
mono/mini/mini-s390x.c
mono/mini/mini-trampolines.c
mono/mini/trace.c

index 2a52f825d9bef37957ef6702c8f691ee8b61c831..5c26451397ead33aa4de0c436978d889780b0e4e 100644 (file)
@@ -6502,7 +6502,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
        MonoMethodSignature *sig;
        guint8 **arg_buf;
        void **args;
-       MonoObject *this, *res, *exc;
+       MonoObject *this_arg, *res, *exc;
        MonoDomain *domain;
        guint8 *this_buf;
 #ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
@@ -6514,8 +6514,8 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
                /* 
                 * Invoke this method directly, currently only Environment.Exit () is supported.
                 */
-               this = NULL;
-               DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer)GetCurrentThreadId (), mono_method_full_name (invoke->method, TRUE), this ? this->vtable->klass->name : "<null>");
+               this_arg = NULL;
+               DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer)GetCurrentThreadId (), mono_method_full_name (invoke->method, TRUE), this_arg ? this_arg->vtable->klass->name : "<null>");
                mono_runtime_invoke (invoke->method, NULL, invoke->args, &exc);
                g_assert_not_reached ();
        }
@@ -6557,50 +6557,50 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
        }
 
        if (!m->klass->valuetype)
-               this = *(MonoObject**)this_buf;
+               this_arg = *(MonoObject**)this_buf;
        else
-               this = NULL;
+               this_arg = NULL;
 
        if (MONO_CLASS_IS_INTERFACE (m->klass)) {
-               if (!this) {
+               if (!this_arg) {
                        DEBUG_PRINTF (1, "[%p] Error: Interface method invoked without this argument.\n", (gpointer)GetCurrentThreadId ());
                        return ERR_INVALID_ARGUMENT;
                }
-               m = mono_object_get_virtual_method (this, m);
+               m = mono_object_get_virtual_method (this_arg, m);
                /* Transform this to the format the rest of the code expects it to be */
                if (m->klass->valuetype) {
                        this_buf = g_alloca (mono_class_instance_size (m->klass));
-                       memcpy (this_buf, mono_object_unbox (this), mono_class_instance_size (m->klass));
+                       memcpy (this_buf, mono_object_unbox (this_arg), mono_class_instance_size (m->klass));
                }
        } else if ((m->flags & METHOD_ATTRIBUTE_VIRTUAL) && !m->klass->valuetype && invoke->flags & INVOKE_FLAG_VIRTUAL) {
-               if (!this) {
+               if (!this_arg) {
                        DEBUG_PRINTF (1, "[%p] Error: invoke with INVOKE_FLAG_VIRTUAL flag set without this argument.\n", (gpointer)GetCurrentThreadId ());
                        return ERR_INVALID_ARGUMENT;
                }
-               m = mono_object_get_virtual_method (this, m);
+               m = mono_object_get_virtual_method (this_arg, m);
                if (m->klass->valuetype) {
                        this_buf = g_alloca (mono_class_instance_size (m->klass));
-                       memcpy (this_buf, mono_object_unbox (this), mono_class_instance_size (m->klass));
+                       memcpy (this_buf, mono_object_unbox (this_arg), mono_class_instance_size (m->klass));
                }
        }
 
-       DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer)GetCurrentThreadId (), mono_method_full_name (m, TRUE), this ? this->vtable->klass->name : "<null>");
+       DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer)GetCurrentThreadId (), mono_method_full_name (m, TRUE), this_arg ? this_arg->vtable->klass->name : "<null>");
 
-       if (this && this->vtable->domain != domain)
+       if (this_arg && this_arg->vtable->domain != domain)
                NOT_IMPLEMENTED;
 
-       if (!m->klass->valuetype && !(m->flags & METHOD_ATTRIBUTE_STATIC) && !this) {
+       if (!m->klass->valuetype && !(m->flags & METHOD_ATTRIBUTE_STATIC) && !this_arg) {
                if (!strcmp (m->name, ".ctor")) {
                        if (m->klass->flags & TYPE_ATTRIBUTE_ABSTRACT)
                                return ERR_INVALID_ARGUMENT;
                        else
-                               this = mono_object_new (domain, m->klass);
+                               this_arg = mono_object_new (domain, m->klass);
                } else {
                        return ERR_INVALID_ARGUMENT;
                }
        }
 
-       if (this && !obj_is_of_type (this, &m->klass->byval_arg))
+       if (this_arg && !obj_is_of_type (this_arg, &m->klass->byval_arg))
                return ERR_INVALID_ARGUMENT;
 
        nargs = decode_int (p, &p, end);
@@ -6664,7 +6664,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
        if (m->klass->valuetype)
                res = mono_runtime_invoke (m, this_buf, args, &exc);
        else
-               res = mono_runtime_invoke (m, this, args, &exc);
+               res = mono_runtime_invoke (m, this_arg, args, &exc);
        mono_stopwatch_stop (&watch);
        DEBUG_PRINTF (1, "[%p] Invoke result: %p, exc: %s, time: %ld ms.\n", (gpointer)GetCurrentThreadId (), res, exc ? exc->vtable->klass->name : NULL, (long)mono_stopwatch_elapsed_ms (&watch));
        if (exc) {
@@ -6682,7 +6682,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
                if (sig->ret->type == MONO_TYPE_VOID) {
                        if (!strcmp (m->name, ".ctor")) {
                                if (!m->klass->valuetype)
-                                       buffer_add_value (buf, &mono_defaults.object_class->byval_arg, &this, domain);
+                                       buffer_add_value (buf, &mono_defaults.object_class->byval_arg, &this_arg, domain);
                                else
                                        buffer_add_value (buf, &m->klass->byval_arg, this_buf, domain);
                        } else {
index 9798cd745f223b7064f8a5df12cddcaf7a6f8d19..eb118be0c9bf72d7da46ae02be41daf88a70fe20 100644 (file)
@@ -1158,7 +1158,8 @@ param_table [STACK_MAX] [STACK_MAX] = {
 };
 
 static int
-check_values_to_signature (MonoInst *args, MonoType *this, MonoMethodSignature *sig) {
+check_values_to_signature (MonoInst *args, MonoType *this_ins, MonoMethodSignature *sig)
+{
        int i;
 
        if (sig->hasthis) {
@@ -2726,12 +2727,12 @@ emit_get_rgctx_klass (MonoCompile *cfg, int context_used, MonoClass *klass, Mono
 
 static MonoInst*
 mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSignature *sig, gboolean tail,
-                                                       MonoInst **args, MonoInst *this, MonoInst *imt_arg, MonoInst *rgctx_arg)
+                                                       MonoInst **args, MonoInst *this_ins, MonoInst *imt_arg, MonoInst *rgctx_arg)
 {
 #ifndef DISABLE_REMOTING
        gboolean might_be_remote = FALSE;
 #endif
-       gboolean virtual = this != NULL;
+       gboolean virtual = this_ins != NULL;
        gboolean enable_for_aot = TRUE;
        int context_used;
        MonoCallInst *call;
@@ -2758,9 +2759,9 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
        context_used = mini_method_check_context_used (cfg, method);
 
 #ifndef DISABLE_REMOTING
-       might_be_remote = this && sig->hasthis &&
+       might_be_remote = this_ins && sig->hasthis &&
                (mono_class_is_marshalbyref (method->klass) || method->klass == mono_defaults.object_class) &&
-               !(method->flags & METHOD_ATTRIBUTE_VIRTUAL) && (!MONO_CHECK_THIS (this) || context_used);
+               !(method->flags & METHOD_ATTRIBUTE_VIRTUAL) && (!MONO_CHECK_THIS (this_ins) || context_used);
 
        if (might_be_remote && context_used) {
                MonoInst *addr;
@@ -2784,14 +2785,14 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
 #endif
                call->method = method;
        call->inst.flags |= MONO_INST_HAS_METHOD;
-       call->inst.inst_left = this;
+       call->inst.inst_left = this_ins;
        call->tail_call = tail;
 
        if (virtual) {
                int vtable_reg, slot_reg, this_reg;
                int offset;
 
-               this_reg = this->dreg;
+               this_reg = this_ins->dreg;
 
                if ((method->klass->parent == mono_defaults.multicastdelegate_class) && !strcmp (method->name, "Invoke")) {
                        MonoInst *dummy_use;
@@ -2885,9 +2886,9 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
 }
 
 MonoInst*
-mono_emit_method_call (MonoCompile *cfg, MonoMethod *method, MonoInst **args, MonoInst *this)
+mono_emit_method_call (MonoCompile *cfg, MonoMethod *method, MonoInst **args, MonoInst *this_ins)
 {
-       return mono_emit_method_call_full (cfg, method, mono_method_signature (method), FALSE, args, this, NULL, NULL);
+       return mono_emit_method_call_full (cfg, method, mono_method_signature (method), FALSE, args, this_ins, NULL, NULL);
 }
 
 MonoInst*
@@ -3365,19 +3366,19 @@ mini_emit_initobj (MonoCompile *cfg, MonoInst *dest, const guchar *ip, MonoClass
 static MonoInst*
 emit_get_rgctx (MonoCompile *cfg, MonoMethod *method, int context_used)
 {
-       MonoInst *this = NULL;
+       MonoInst *this_ins = NULL;
 
        g_assert (cfg->gshared);
 
        if (!(method->flags & METHOD_ATTRIBUTE_STATIC) &&
                        !(context_used & MONO_GENERIC_CONTEXT_USED_METHOD) &&
                        !method->klass->valuetype)
-               EMIT_NEW_ARGLOAD (cfg, this, 0);
+               EMIT_NEW_ARGLOAD (cfg, this_ins, 0);
 
        if (context_used & MONO_GENERIC_CONTEXT_USED_METHOD) {
                MonoInst *mrgctx_loc, *mrgctx_var;
 
-               g_assert (!this);
+               g_assert (!this_ins);
                g_assert (method->is_inflated && mono_method_get_context (method)->method_inst);
 
                mrgctx_loc = mono_get_vtable_var (cfg);
@@ -3387,7 +3388,7 @@ emit_get_rgctx (MonoCompile *cfg, MonoMethod *method, int context_used)
        } else if (method->flags & METHOD_ATTRIBUTE_STATIC || method->klass->valuetype) {
                MonoInst *vtable_loc, *vtable_var;
 
-               g_assert (!this);
+               g_assert (!this_ins);
 
                vtable_loc = mono_get_vtable_var (cfg);
                EMIT_NEW_TEMPLOAD (cfg, vtable_var, vtable_loc->inst_c0);
@@ -3407,7 +3408,7 @@ emit_get_rgctx (MonoCompile *cfg, MonoMethod *method, int context_used)
                int vtable_reg;
        
                vtable_reg = alloc_preg (cfg);
-               EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, vtable_reg, this->dreg, MONO_STRUCT_OFFSET (MonoObject, vtable));
+               EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, vtable_reg, this_ins->dreg, MONO_STRUCT_OFFSET (MonoObject, vtable));
                return ins;
        }
 }
@@ -6650,7 +6651,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
  */
 inline static MonoInst*
 mini_redirect_call (MonoCompile *cfg, MonoMethod *method,  
-                                       MonoMethodSignature *signature, MonoInst **args, MonoInst *this)
+                                       MonoMethodSignature *signature, MonoInst **args, MonoInst *this_ins)
 {
        if (method->klass == mono_defaults.string_class) {
                /* managed string allocation support */
@@ -6667,7 +6668,7 @@ mini_redirect_call (MonoCompile *cfg, MonoMethod *method,
                                return NULL;
                        EMIT_NEW_VTABLECONST (cfg, iargs [0], vtable);
                        iargs [1] = args [0];
-                       return mono_emit_method_call (cfg, managed_alloc, iargs, this);
+                       return mono_emit_method_call (cfg, managed_alloc, iargs, this_ins);
                }
        }
        return NULL;
@@ -7478,12 +7479,12 @@ emit_optimized_ldloca_ir (MonoCompile *cfg, unsigned char *ip, unsigned char *en
 }
 
 static gboolean
-is_exception_class (MonoClass *class)
+is_exception_class (MonoClass *klass)
 {
-       while (class) {
-               if (class == mono_defaults.exception_class)
+       while (klass) {
+               if (klass == mono_defaults.exception_class)
                        return TRUE;
-               class = class->parent;
+               klass = klass->parent;
        }
        return FALSE;
 }
index d5323d2a3bae65565e1b0dba00affd7927980fc9..5937e45464ddab96661b29795cef6441c8b49eb7 100644 (file)
@@ -511,7 +511,7 @@ static MonoGenericContext
 get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_info)
 {
        MonoGenericContext context = { NULL, NULL };
-       MonoClass *class, *method_container_class;
+       MonoClass *klass, *method_container_class;
        MonoMethod *method;
 
        g_assert (generic_info);
@@ -521,15 +521,15 @@ get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_info)
        if (mono_method_get_context (method)->method_inst) {
                MonoMethodRuntimeGenericContext *mrgctx = generic_info;
 
-               class = mrgctx->class_vtable->klass;
+               klass = mrgctx->class_vtable->klass;
                context.method_inst = mrgctx->method_inst;
                g_assert (context.method_inst);
        } else if ((method->flags & METHOD_ATTRIBUTE_STATIC) || method->klass->valuetype) {
                MonoVTable *vtable = generic_info;
 
-               class = vtable->klass;
+               klass = vtable->klass;
        } else {
-               class = generic_info;
+               klass = generic_info;
        }
 
        //g_assert (!method->klass->generic_container);
@@ -539,18 +539,18 @@ get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_info)
                method_container_class = method->klass;
 
        /* class might refer to a subclass of method's class */
-       while (!(class == method->klass || (class->generic_class && class->generic_class->container_class == method_container_class))) {
-               class = class->parent;
-               g_assert (class);
+       while (!(klass == method->klass || (klass->generic_class && klass->generic_class->container_class == method_container_class))) {
+               klass = klass->parent;
+               g_assert (klass);
        }
 
-       if (class->generic_class || class->generic_container)
-               context.class_inst = mini_class_get_context (class)->class_inst;
+       if (klass->generic_class || klass->generic_container)
+               context.class_inst = mini_class_get_context (klass)->class_inst;
 
-       if (class->generic_class)
-               g_assert (mono_class_has_parent_and_ignore_generics (class->generic_class->container_class, method_container_class));
+       if (klass->generic_class)
+               g_assert (mono_class_has_parent_and_ignore_generics (klass->generic_class->container_class, method_container_class));
        else
-               g_assert (mono_class_has_parent_and_ignore_generics (class, method_container_class));
+               g_assert (mono_class_has_parent_and_ignore_generics (klass, method_container_class));
 
        return context;
 }
index ef1f02a7f030319217e11e19fb67b37cb197fc30..25e979acddca4c44c642440dd656940663fcc716 100644 (file)
@@ -117,17 +117,17 @@ mono_generic_context_check_used (MonoGenericContext *context)
  * variables.
  */
 int
-mono_class_check_context_used (MonoClass *class)
+mono_class_check_context_used (MonoClass *klass)
 {
        int context_used = 0;
 
-       context_used |= type_check_context_used (&class->this_arg, FALSE);
-       context_used |= type_check_context_used (&class->byval_arg, FALSE);
+       context_used |= type_check_context_used (&klass->this_arg, FALSE);
+       context_used |= type_check_context_used (&klass->byval_arg, FALSE);
 
-       if (class->generic_class)
-               context_used |= mono_generic_context_check_used (&class->generic_class->context);
-       else if (class->generic_container)
-               context_used |= mono_generic_context_check_used (&class->generic_container->context);
+       if (klass->generic_class)
+               context_used |= mono_generic_context_check_used (&klass->generic_class->context);
+       else if (klass->generic_container)
+               context_used |= mono_generic_context_check_used (&klass->generic_container->context);
 
        return context_used;
 }
@@ -225,26 +225,26 @@ static GHashTable *generic_subclass_hash;
  * LOCKING: templates lock
  */
 static void
-class_set_rgctx_template (MonoClass *class, MonoRuntimeGenericContextTemplate *rgctx_template)
+class_set_rgctx_template (MonoClass *klass, MonoRuntimeGenericContextTemplate *rgctx_template)
 {
-       if (!class->image->rgctx_template_hash)
-               class->image->rgctx_template_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
+       if (!klass->image->rgctx_template_hash)
+               klass->image->rgctx_template_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
 
-       g_hash_table_insert (class->image->rgctx_template_hash, class, rgctx_template);
+       g_hash_table_insert (klass->image->rgctx_template_hash, klass, rgctx_template);
 }
 
 /*
  * LOCKING: loader lock
  */
 static MonoRuntimeGenericContextTemplate*
-class_lookup_rgctx_template (MonoClass *class)
+class_lookup_rgctx_template (MonoClass *klass)
 {
        MonoRuntimeGenericContextTemplate *template;
 
-       if (!class->image->rgctx_template_hash)
+       if (!klass->image->rgctx_template_hash)
                return NULL;
 
-       template = g_hash_table_lookup (class->image->rgctx_template_hash, class);
+       template = g_hash_table_lookup (klass->image->rgctx_template_hash, klass);
 
        return template;
 }
@@ -253,11 +253,11 @@ class_lookup_rgctx_template (MonoClass *class)
  * LOCKING: loader lock
  */
 static void
-register_generic_subclass (MonoClass *class)
+register_generic_subclass (MonoClass *klass)
 {
-       MonoClass *parent = class->parent;
+       MonoClass *parent = klass->parent;
        MonoClass *subclass;
-       MonoRuntimeGenericContextTemplate *rgctx_template = class_lookup_rgctx_template (class);
+       MonoRuntimeGenericContextTemplate *rgctx_template = class_lookup_rgctx_template (klass);
 
        g_assert (rgctx_template);
 
@@ -269,15 +269,15 @@ register_generic_subclass (MonoClass *class)
 
        subclass = g_hash_table_lookup (generic_subclass_hash, parent);
        rgctx_template->next_subclass = subclass;
-       g_hash_table_insert (generic_subclass_hash, parent, class);
+       g_hash_table_insert (generic_subclass_hash, parent, klass);
 }
 
 static void
-move_subclasses_not_in_image_foreach_func (MonoClass *class, MonoClass *subclass, MonoImage *image)
+move_subclasses_not_in_image_foreach_func (MonoClass *klass, MonoClass *subclass, MonoImage *image)
 {
        MonoClass *new_list;
 
-       if (class->image == image) {
+       if (klass->image == image) {
                /* The parent class itself is in the image, so all the
                   subclasses must be in the image, too.  If not,
                   we're removing an image containing a class which
@@ -305,7 +305,7 @@ move_subclasses_not_in_image_foreach_func (MonoClass *class, MonoClass *subclass
        }
 
        if (new_list)
-               g_hash_table_insert (generic_subclass_hash, class, new_list);
+               g_hash_table_insert (generic_subclass_hash, klass, new_list);
 }
 
 /*
@@ -338,7 +338,7 @@ mono_class_unregister_image_generic_subclasses (MonoImage *image, gpointer user_
 }
 
 static MonoRuntimeGenericContextTemplate*
-alloc_template (MonoClass *class)
+alloc_template (MonoClass *klass)
 {
        static gboolean inited = FALSE;
        static int num_allocted = 0;
@@ -355,7 +355,7 @@ alloc_template (MonoClass *class)
        num_allocted++;
        num_bytes += size;
 
-       return mono_image_alloc0 (class->image, size);
+       return mono_image_alloc0 (klass->image, size);
 }
 
 static MonoRuntimeGenericContextInfoTemplate*
@@ -514,7 +514,7 @@ mono_class_get_method_generic (MonoClass *klass, MonoMethod *method)
 }
 
 static gpointer
-inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *context, MonoClass *class, gboolean temporary)
+inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *context, MonoClass *klass, gboolean temporary)
 {
        gpointer data = oti->data;
        MonoRgctxInfoType info_type = oti->info_type;
@@ -542,7 +542,7 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co
        case MONO_RGCTX_INFO_LOCAL_OFFSET:
        case MONO_RGCTX_INFO_NULLABLE_CLASS_BOX:
        case MONO_RGCTX_INFO_NULLABLE_CLASS_UNBOX: {
-               gpointer result = mono_class_inflate_generic_type_with_mempool (temporary ? NULL : class->image,
+               gpointer result = mono_class_inflate_generic_type_with_mempool (temporary ? NULL : klass->image,
                        data, context, &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
                return result;
@@ -598,7 +598,7 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co
                        MonoRuntimeGenericContextInfoTemplate *template = &res->entries [i];
 
                        memcpy (template, otemplate, sizeof (MonoRuntimeGenericContextInfoTemplate));
-                       template->data = inflate_info (template, context, class, FALSE);
+                       template->data = inflate_info (template, context, klass, FALSE);
                }
                return res;
        }
@@ -710,14 +710,14 @@ free_inflated_info (MonoRgctxInfoType info_type, gpointer info)
 }
 
 static MonoRuntimeGenericContextInfoTemplate
-class_get_rgctx_template_oti (MonoClass *class, int type_argc, guint32 slot, gboolean temporary, gboolean shared, gboolean *do_free);
+class_get_rgctx_template_oti (MonoClass *klass, int type_argc, guint32 slot, gboolean temporary, gboolean shared, gboolean *do_free);
  
 static MonoClass*
-class_uninstantiated (MonoClass *class)
+class_uninstantiated (MonoClass *klass)
 {
-       if (class->generic_class)
-               return class->generic_class->container_class;
-       return class;
+       if (klass->generic_class)
+               return klass->generic_class->container_class;
+       return klass;
 }
 
 /*
@@ -726,9 +726,9 @@ class_uninstantiated (MonoClass *class)
  *   Return the class used to store information when using generic sharing.
  */
 static MonoClass*
-get_shared_class (MonoClass *class)
+get_shared_class (MonoClass *klass)
 {
-       return class_uninstantiated (class);
+       return class_uninstantiated (klass);
 }
 
 /*
@@ -739,15 +739,15 @@ get_shared_class (MonoClass *class)
  * The template is the same for all instantiations of a class.
  */
 static MonoRuntimeGenericContextTemplate*
-mono_class_get_runtime_generic_context_template (MonoClass *class)
+mono_class_get_runtime_generic_context_template (MonoClass *klass)
 {
        MonoRuntimeGenericContextTemplate *parent_template, *template;
        guint32 i;
 
-       class = get_shared_class (class);
+       klass = get_shared_class (klass);
 
        mono_loader_lock ();
-       template = class_lookup_rgctx_template (class);
+       template = class_lookup_rgctx_template (klass);
        mono_loader_unlock ();
 
        if (template)
@@ -755,15 +755,15 @@ mono_class_get_runtime_generic_context_template (MonoClass *class)
 
        //g_assert (get_shared_class (class) == class);
 
-       template = alloc_template (class);
+       template = alloc_template (klass);
 
        mono_loader_lock ();
 
-       if (class->parent) {
+       if (klass->parent) {
                guint32 num_entries;
                int max_argc, type_argc;
 
-               parent_template = mono_class_get_runtime_generic_context_template (class->parent);
+               parent_template = mono_class_get_runtime_generic_context_template (klass->parent);
                max_argc = template_get_max_argc (parent_template);
 
                for (type_argc = 0; type_argc <= max_argc; ++type_argc) {
@@ -773,23 +773,23 @@ mono_class_get_runtime_generic_context_template (MonoClass *class)
                        for (i = 0; i < num_entries; ++i) {
                                MonoRuntimeGenericContextInfoTemplate oti;
 
-                               oti = class_get_rgctx_template_oti (class->parent, type_argc, i, FALSE, FALSE, NULL);
+                               oti = class_get_rgctx_template_oti (klass->parent, type_argc, i, FALSE, FALSE, NULL);
                                if (oti.data && oti.data != MONO_RGCTX_SLOT_USED_MARKER) {
-                                       rgctx_template_set_slot (class->image, template, type_argc, i,
+                                       rgctx_template_set_slot (klass->image, template, type_argc, i,
                                                                                         oti.data, oti.info_type);
                                }
                        }
                }
        }
 
-       if (class_lookup_rgctx_template (class)) {
+       if (class_lookup_rgctx_template (klass)) {
                /* some other thread already set the template */
-               template = class_lookup_rgctx_template (class);
+               template = class_lookup_rgctx_template (klass);
        } else {
-               class_set_rgctx_template (class, template);
+               class_set_rgctx_template (klass, template);
 
-               if (class->parent)
-                       register_generic_subclass (class);
+               if (klass->parent)
+                       register_generic_subclass (klass);
        }
 
        mono_loader_unlock ();
@@ -810,21 +810,21 @@ mono_class_get_runtime_generic_context_template (MonoClass *class)
  * LOCKING: loader lock
  */
 static MonoRuntimeGenericContextInfoTemplate
-class_get_rgctx_template_oti (MonoClass *class, int type_argc, guint32 slot, gboolean temporary, gboolean shared, gboolean *do_free)
+class_get_rgctx_template_oti (MonoClass *klass, int type_argc, guint32 slot, gboolean temporary, gboolean shared, gboolean *do_free)
 {
        g_assert ((temporary && do_free) || (!temporary && !do_free));
 
        DEBUG (printf ("get slot: %s %d\n", mono_type_full_name (&class->byval_arg), slot));
 
-       if (class->generic_class && !shared) {
+       if (klass->generic_class && !shared) {
                MonoRuntimeGenericContextInfoTemplate oti;
                gboolean tmp_do_free;
 
-               oti = class_get_rgctx_template_oti (class->generic_class->container_class,
+               oti = class_get_rgctx_template_oti (klass->generic_class->container_class,
                                                                                        type_argc, slot, TRUE, FALSE, &tmp_do_free);
                if (oti.data) {
                        gpointer info = oti.data;
-                       oti.data = inflate_info (&oti, &class->generic_class->context, class, temporary);
+                       oti.data = inflate_info (&oti, &klass->generic_class->context, klass, temporary);
                        if (tmp_do_free)
                                free_inflated_info (oti.info_type, info);
                }
@@ -836,7 +836,7 @@ class_get_rgctx_template_oti (MonoClass *class, int type_argc, guint32 slot, gbo
                MonoRuntimeGenericContextTemplate *template;
                MonoRuntimeGenericContextInfoTemplate *oti;
 
-               template = mono_class_get_runtime_generic_context_template (class);
+               template = mono_class_get_runtime_generic_context_template (klass);
                oti = rgctx_template_get_other_slot (template, type_argc, slot);
                g_assert (oti);
 
@@ -848,42 +848,42 @@ class_get_rgctx_template_oti (MonoClass *class, int type_argc, guint32 slot, gbo
 }
 
 static gpointer
-class_type_info (MonoDomain *domain, MonoClass *class, MonoRgctxInfoType info_type)
+class_type_info (MonoDomain *domain, MonoClass *klass, MonoRgctxInfoType info_type)
 {
        switch (info_type) {
        case MONO_RGCTX_INFO_STATIC_DATA: {
-               MonoVTable *vtable = mono_class_vtable (domain, class);
+               MonoVTable *vtable = mono_class_vtable (domain, klass);
                if (!vtable)
-                       mono_raise_exception (mono_class_get_exception_for_failure (class));
+                       mono_raise_exception (mono_class_get_exception_for_failure (klass));
                return mono_vtable_get_static_field_data (vtable);
        }
        case MONO_RGCTX_INFO_KLASS:
-               return class;
+               return klass;
        case MONO_RGCTX_INFO_ELEMENT_KLASS:
-               return class->element_class;
+               return klass->element_class;
        case MONO_RGCTX_INFO_VTABLE: {
-               MonoVTable *vtable = mono_class_vtable (domain, class);
+               MonoVTable *vtable = mono_class_vtable (domain, klass);
                if (!vtable)
-                       mono_raise_exception (mono_class_get_exception_for_failure (class));
+                       mono_raise_exception (mono_class_get_exception_for_failure (klass));
                return vtable;
        }
        case MONO_RGCTX_INFO_CAST_CACHE: {
                /*First slot is the cache itself, the second the vtable.*/
                gpointer **cache_data = mono_domain_alloc0 (domain, sizeof (gpointer) * 2);
-               cache_data [1] = (gpointer)class;
+               cache_data [1] = (gpointer)klass;
                return cache_data;
        }
        case MONO_RGCTX_INFO_ARRAY_ELEMENT_SIZE:
-               return GUINT_TO_POINTER (mono_class_array_element_size (class));
+               return GUINT_TO_POINTER (mono_class_array_element_size (klass));
        case MONO_RGCTX_INFO_VALUE_SIZE:
-               if (MONO_TYPE_IS_REFERENCE (&class->byval_arg))
+               if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg))
                        return GUINT_TO_POINTER (sizeof (gpointer));
                else
-                       return GUINT_TO_POINTER (mono_class_value_size (class, NULL));
+                       return GUINT_TO_POINTER (mono_class_value_size (klass, NULL));
        case MONO_RGCTX_INFO_CLASS_BOX_TYPE:
-               if (MONO_TYPE_IS_REFERENCE (&class->byval_arg))
+               if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg))
                        return GUINT_TO_POINTER (1);
-               else if (mono_class_is_nullable (class))
+               else if (mono_class_is_nullable (klass))
                        return GUINT_TO_POINTER (2);
                else
                        return GUINT_TO_POINTER (0);
@@ -897,11 +897,11 @@ class_type_info (MonoDomain *domain, MonoClass *class, MonoRgctxInfoType info_ty
 
                domain_info = domain_jit_info (domain);
 
-               if (MONO_TYPE_IS_REFERENCE (&class->byval_arg)) {
+               if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg)) {
                        size = sizeof (gpointer);
                        align = sizeof (gpointer);
                } else {
-                       size = mono_class_value_size (class, &align);
+                       size = mono_class_value_size (klass, &align);
                }
 
                if (size != 1 && size != 2 && size != 4 && size != 8)
@@ -957,14 +957,14 @@ class_type_info (MonoDomain *domain, MonoClass *class, MonoRgctxInfoType info_ty
                gpointer addr;
                MonoJitInfo *ji;
 
-               if (!mono_class_is_nullable (class))
+               if (!mono_class_is_nullable (klass))
                        /* This can happen since all the entries in MonoGSharedVtMethodInfo are inflated, even those which are not used */
                        return NULL;
 
                if (info_type == MONO_RGCTX_INFO_NULLABLE_CLASS_BOX)
-                       method = mono_class_get_method_from_name (class, "Box", 1);
+                       method = mono_class_get_method_from_name (klass, "Box", 1);
                else
-                       method = mono_class_get_method_from_name (class, "Unbox", 1);
+                       method = mono_class_get_method_from_name (klass, "Unbox", 1);
 
                addr = mono_compile_method (method);
                // The caller uses the gsharedvt call signature
@@ -1123,7 +1123,7 @@ mini_get_gsharedvt_wrapper (gboolean gsharedvt_in, gpointer addr, MonoMethodSign
 
 static gpointer
 instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti,
-                                 MonoGenericContext *context, MonoClass *class)
+                                 MonoGenericContext *context, MonoClass *klass)
 {
        gpointer data;
        gboolean temporary;
@@ -1143,7 +1143,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
                temporary = FALSE;
        }
 
-       data = inflate_info (oti, context, class, temporary);
+       data = inflate_info (oti, context, klass, temporary);
 
        switch (oti->info_type) {
        case MONO_RGCTX_INFO_STATIC_DATA:
@@ -1421,7 +1421,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
                                offset += size;
                                break;
                        default:
-                               res->entries [i] = instantiate_info (domain, template, context, class);
+                               res->entries [i] = instantiate_info (domain, template, context, klass);
                                break;
                        }
                }
@@ -1440,16 +1440,16 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
  * LOCKING: loader lock
  */
 static void
-fill_in_rgctx_template_slot (MonoClass *class, int type_argc, int index, gpointer data, MonoRgctxInfoType info_type)
+fill_in_rgctx_template_slot (MonoClass *klass, int type_argc, int index, gpointer data, MonoRgctxInfoType info_type)
 {
-       MonoRuntimeGenericContextTemplate *template = mono_class_get_runtime_generic_context_template (class);
+       MonoRuntimeGenericContextTemplate *template = mono_class_get_runtime_generic_context_template (klass);
        MonoClass *subclass;
 
-       rgctx_template_set_slot (class->image, template, type_argc, index, data, info_type);
+       rgctx_template_set_slot (klass->image, template, type_argc, index, data, info_type);
 
        /* Recurse for all subclasses */
        if (generic_subclass_hash)
-               subclass = g_hash_table_lookup (generic_subclass_hash, class);
+               subclass = g_hash_table_lookup (generic_subclass_hash, klass);
        else
                subclass = NULL;
 
@@ -1520,10 +1520,10 @@ rgctx_info_to_str (MonoRgctxInfoType info_type, gpointer data)
  * LOCKING: loader lock
  */
 static int
-register_info (MonoClass *class, int type_argc, gpointer data, MonoRgctxInfoType info_type)
+register_info (MonoClass *klass, int type_argc, gpointer data, MonoRgctxInfoType info_type)
 {
        int i;
-       MonoRuntimeGenericContextTemplate *template = mono_class_get_runtime_generic_context_template (class);
+       MonoRuntimeGenericContextTemplate *template = mono_class_get_runtime_generic_context_template (klass);
        MonoClass *parent;
        MonoRuntimeGenericContextInfoTemplate *oti;
 
@@ -1536,7 +1536,7 @@ register_info (MonoClass *class, int type_argc, gpointer data, MonoRgctxInfoType
 
        /* Mark the slot as used in all parent classes (until we find
           a parent class which already has it marked used). */
-       parent = class->parent;
+       parent = klass->parent;
        while (parent != NULL) {
                MonoRuntimeGenericContextTemplate *parent_template;
                MonoRuntimeGenericContextInfoTemplate *oti;
@@ -1558,7 +1558,7 @@ register_info (MonoClass *class, int type_argc, gpointer data, MonoRgctxInfoType
 
        /* Fill in the slot in this class and in all subclasses
           recursively. */
-       fill_in_rgctx_template_slot (class, type_argc, i, data, info_type);
+       fill_in_rgctx_template_slot (klass, type_argc, i, data, info_type);
 
        return i;
 }
@@ -1643,18 +1643,18 @@ mini_rgctx_info_type_to_patch_info_type (MonoRgctxInfoType info_type)
 }
 
 static int
-lookup_or_register_info (MonoClass *class, int type_argc, gpointer data, MonoRgctxInfoType info_type,
+lookup_or_register_info (MonoClass *klass, int type_argc, gpointer data, MonoRgctxInfoType info_type,
        MonoGenericContext *generic_context)
 {
        static gboolean inited = FALSE;
        static int max_slot = 0;
 
        MonoRuntimeGenericContextTemplate *rgctx_template =
-               mono_class_get_runtime_generic_context_template (class);
+               mono_class_get_runtime_generic_context_template (klass);
        MonoRuntimeGenericContextInfoTemplate *oti_list, *oti;
        int i;
 
-       class = get_shared_class (class);
+       klass = get_shared_class (klass);
 
        mono_loader_lock ();
 
@@ -1667,7 +1667,7 @@ lookup_or_register_info (MonoClass *class, int type_argc, gpointer data, MonoRgc
                        if (oti->info_type != info_type || !oti->data)
                                continue;
 
-                       inflated_data = inflate_info (oti, generic_context, class, TRUE);
+                       inflated_data = inflate_info (oti, generic_context, klass, TRUE);
 
                        if (info_equal (data, inflated_data, info_type)) {
                                free_inflated_info (info_type, inflated_data);
@@ -1679,7 +1679,7 @@ lookup_or_register_info (MonoClass *class, int type_argc, gpointer data, MonoRgc
        }
 
        /* We haven't found the info */
-       i = register_info (class, type_argc, data, info_type);
+       i = register_info (klass, type_argc, data, info_type);
 
        mono_loader_unlock ();
 
@@ -1709,7 +1709,7 @@ guint32
 mono_method_lookup_or_register_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
        MonoRgctxInfoType info_type, MonoGenericContext *generic_context)
 {
-       MonoClass *class = method->klass;
+       MonoClass *klass = method->klass;
        int type_argc, index;
 
        if (in_mrgctx) {
@@ -1722,7 +1722,7 @@ mono_method_lookup_or_register_info (MonoMethod *method, gboolean in_mrgctx, gpo
                type_argc = 0;
        }
 
-       index = lookup_or_register_info (class, type_argc, data, info_type, generic_context);
+       index = lookup_or_register_info (klass, type_argc, data, info_type, generic_context);
 
        //g_print ("rgctx item at index %d argc %d\n", index, type_argc);
 
@@ -1793,8 +1793,8 @@ fill_runtime_generic_context (MonoVTable *class_vtable, MonoRuntimeGenericContex
        gpointer info;
        int i, first_slot, size;
        MonoDomain *domain = class_vtable->domain;
-       MonoClass *class = class_vtable->klass;
-       MonoGenericContext *class_context = class->generic_class ? &class->generic_class->context : NULL;
+       MonoClass *klass = class_vtable->klass;
+       MonoGenericContext *class_context = klass->generic_class ? &klass->generic_class->context : NULL;
        MonoRuntimeGenericContextInfoTemplate oti;
        MonoGenericContext context = { class_context ? class_context->class_inst : NULL, method_inst };
        int rgctx_index;
@@ -1839,10 +1839,10 @@ fill_runtime_generic_context (MonoVTable *class_vtable, MonoRuntimeGenericContex
 
        mono_domain_unlock (domain);
 
-       oti = class_get_rgctx_template_oti (get_shared_class (class),
+       oti = class_get_rgctx_template_oti (get_shared_class (klass),
                                                                                method_inst ? method_inst->type_argc : 0, slot, TRUE, TRUE, &do_free);
        /* This might take the loader lock */
-       info = instantiate_info (domain, &oti, &context, class);
+       info = instantiate_info (domain, &oti, &context, klass);
 
        /*
        if (method_inst)
@@ -2397,7 +2397,7 @@ mono_set_partial_sharing_supported (gboolean supported)
  * function will disappear and generic sharing will always be enabled.
  */
 gboolean
-mono_class_generic_sharing_enabled (MonoClass *class)
+mono_class_generic_sharing_enabled (MonoClass *klass)
 {
        if (gshared_supported)
                return TRUE;
@@ -2483,13 +2483,13 @@ mono_generic_context_equal_deep (MonoGenericContext *context1, MonoGenericContex
  * it doesn't have generic_class set.
  */
 MonoClass*
-mini_class_get_container_class (MonoClass *class)
+mini_class_get_container_class (MonoClass *klass)
 {
-       if (class->generic_class)
-               return class->generic_class->container_class;
+       if (klass->generic_class)
+               return klass->generic_class->container_class;
 
-       g_assert (class->generic_container);
-       return class;
+       g_assert (klass->generic_container);
+       return klass;
 }
 
 /*
@@ -2499,13 +2499,13 @@ mini_class_get_container_class (MonoClass *class)
  * Returns the class's generic context.
  */
 MonoGenericContext*
-mini_class_get_context (MonoClass *class)
+mini_class_get_context (MonoClass *klass)
 {
-       if (class->generic_class)
-               return &class->generic_class->context;
+       if (klass->generic_class)
+               return &klass->generic_class->context;
 
-       g_assert (class->generic_container);
-       return &class->generic_container->context;
+       g_assert (klass->generic_container);
+       return &klass->generic_container->context;
 }
 
 /*
index 25fc8541880598d12311a1ca285ea09400987cf3..4c18cc970ee5a77df3e3444edc6e00b5348872fa 100644 (file)
@@ -5813,13 +5813,13 @@ mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_re
 
        /* add the this argument */
        if (this_reg != -1) {
-               MonoInst *this;
-               MONO_INST_NEW (cfg, this, OP_MOVE);
-               this->type = this_type;
-               this->sreg1 = this_reg;
-               this->dreg = mono_alloc_ireg (cfg);
-               mono_bblock_add_inst (cfg->cbb, this);
-               mono_call_inst_add_outarg_reg (cfg, inst, this->dreg, this_dreg, FALSE);
+               MonoInst *this_ins;
+               MONO_INST_NEW (cfg, this_ins, OP_MOVE);
+               this_ins->type = this_type;
+               this_ins->sreg1 = this_reg;
+               this_ins->dreg = mono_alloc_ireg (cfg);
+               mono_bblock_add_inst (cfg->cbb, this_ins);
+               mono_call_inst_add_outarg_reg (cfg, inst, this_ins->dreg, this_dreg, FALSE);
        }
 
        if (vt_reg != -1) {
index 82b17636886587c3f48aa6a798e22b774bc85939..0b482454c2cf3df4b5cc8d780195e836e1fdeee1 100644 (file)
@@ -791,20 +791,20 @@ enum_parmtype:
                        case MONO_TYPE_CLASS :
                        case MONO_TYPE_OBJECT : {
                                MonoObject *obj = *((MonoObject **) curParm);
-                               MonoClass *class;
+                               MonoClass *klass;
                                if ((obj) && (obj->vtable)) {
                                        printf("[CLASS/OBJ:");
-                                       class = obj->vtable->klass;
+                                       klass = obj->vtable->klass;
                                        printf("%p [%p] ",obj,curParm);
-                                       if (class == mono_defaults.string_class) {
+                                       if (klass == mono_defaults.string_class) {
                                                printf("[STRING:%p:%s]", 
                                                       obj, mono_string_to_utf8 ((MonoString *) obj));
-                                       } else if (class == mono_defaults.int32_class) { 
+                                       } else if (klass == mono_defaults.int32_class) { 
                                                printf("[INT32:%p:%d]", 
                                                        obj, *(gint32 *)((char *)obj + sizeof (MonoObject)));
                                        } else
                                                printf("[%s.%s:%p]", 
-                                                      class->name_space, class->name, obj);
+                                                      klass->name_space, klass->name, obj);
                                        printf("], ");
                                } else {
                                        printf("[OBJECT:null], ");
@@ -893,7 +893,7 @@ static void
 enter_method (MonoMethod *method, RegParm *rParm, char *sp)
 {
        int i, oParm = 0, iParm = 0;
-       MonoClass *class;
+       MonoClass *klass;
        MonoObject *obj;
        MonoMethodSignature *sig;
        char *fname;
@@ -923,26 +923,26 @@ enter_method (MonoMethod *method, RegParm *rParm, char *sp)
        }
 
        if (sig->hasthis) {
-               gpointer *this = (gpointer *) rParm->gr[iParm];
-               obj = (MonoObject *) this;
+               gpointer *this_arg = (gpointer *) rParm->gr[iParm];
+               obj = (MonoObject *) this_arg;
                switch(method->klass->this_arg.type) {
                case MONO_TYPE_VALUETYPE:
                        if (obj) {
-                               guint64 *value = (guint64 *) ((uintptr_t)this + sizeof(MonoObject));
-                               printf("this:[value:%p:%016lx], ", this, *value);
+                               guint64 *value = (guint64 *) ((uintptr_t)this_arg + sizeof(MonoObject));
+                               printf("this:[value:%p:%016lx], ", this_arg, *value);
                        } else 
                                printf ("this:[NULL], ");
                        break;
                case MONO_TYPE_STRING:
                        if (obj) {
                                if (obj->vtable) {
-                                       class = obj->vtable->klass;
-                                       if (class == mono_defaults.string_class) {
+                                       klass = obj->vtable->klass;
+                                       if (klass == mono_defaults.string_class) {
                                                printf ("this:[STRING:%p:%s], ", 
                                                        obj, mono_string_to_utf8 ((MonoString *)obj));
                                        } else {
                                                printf ("this:%p[%s.%s], ", 
-                                                       obj, class->name_space, class->name);
+                                                       obj, klass->name_space, klass->name);
                                        }
                                } else 
                                        printf("vtable:[NULL], ");
@@ -950,7 +950,7 @@ enter_method (MonoMethod *method, RegParm *rParm, char *sp)
                                printf ("this:[NULL], ");
                        break;
                default :
-                       printf("this[%s]: %p, ",cvtMonoType(method->klass->this_arg.type),this);
+                       printf("this[%s]: %p, ",cvtMonoType(method->klass->this_arg.type),this_arg);
                }
                oParm++;
        }
index 9f7d946db4a7100fb99fcfc15202794c2f9f07c3..72e8604c2acb36d3ec59a353ab31a9ccfc6fefa0 100644 (file)
@@ -703,7 +703,7 @@ mono_magic_trampoline (mgreg_t *regs, guint8 *code, gpointer arg, guint8* tramp)
 static gpointer
 mono_vcall_trampoline (mgreg_t *regs, guint8 *code, int slot, guint8 *tramp)
 {
-       MonoObject *this;
+       MonoObject *this_arg;
        MonoVTable *vt;
        gpointer *vtable_slot;
        MonoMethod *m;
@@ -722,10 +722,10 @@ mono_vcall_trampoline (mgreg_t *regs, guint8 *code, int slot, guint8 *tramp)
        /*
         * Obtain the vtable from the 'this' arg.
         */
-       this = mono_arch_get_this_arg_from_call (regs, code);
-       g_assert (this);
+       this_arg = mono_arch_get_this_arg_from_call (regs, code);
+       g_assert (this_arg);
 
-       vt = this->vtable;
+       vt = this_arg->vtable;
 
        if (slot >= 0) {
                /* Normal virtual call */
index cb768b9551e03bd942038c5fcff3a6bf6b610dbd..abd79479169cf069619ed65c68f3b33858550e4b 100644 (file)
@@ -403,7 +403,7 @@ void
 mono_trace_enter_method (MonoMethod *method, char *ebp)
 {
        int i, j;
-       MonoClass *class;
+       MonoClass *klass;
        MonoObject *o;
        MonoJitArgumentInfo *arg_info;
        MonoMethodSignature *sig;
@@ -456,16 +456,16 @@ mono_trace_enter_method (MonoMethod *method, char *ebp)
                        o = *arg_in_stack_slot(this, MonoObject *);
 
                        if (o) {
-                               class = o->vtable->klass;
+                               klass = o->vtable->klass;
 
-                               if (class == mono_defaults.string_class) {
+                               if (klass == mono_defaults.string_class) {
                                        MonoString *s = (MonoString*)o;
                                        char *as = string_to_utf8 (s);
 
                                        printf ("this:[STRING:%p:%s], ", o, as);
                                        g_free (as);
                                } else {
-                                       printf ("this:%p[%s.%s %s], ", o, class->name_space, class->name, o->vtable->domain->friendly_name);
+                                       printf ("this:%p[%s.%s %s], ", o, klass->name_space, klass->name, o->vtable->domain->friendly_name);
                                }
                        } else 
                                printf ("this:NULL, ");
@@ -518,19 +518,19 @@ mono_trace_enter_method (MonoMethod *method, char *ebp)
                case MONO_TYPE_OBJECT: {
                        o = *arg_in_stack_slot(cpos, MonoObject *);
                        if (o) {
-                               class = o->vtable->klass;
+                               klass = o->vtable->klass;
                    
-                               if (class == mono_defaults.string_class) {
+                               if (klass == mono_defaults.string_class) {
                                        char *as = string_to_utf8 ((MonoString*)o);
 
                                        printf ("[STRING:%p:%s], ", o, as);
                                        g_free (as);
-                               } else if (class == mono_defaults.int32_class) {
+                               } else if (klass == mono_defaults.int32_class) {
                                        printf ("[INT32:%p:%d], ", o, *(gint32 *)((char *)o + sizeof (MonoObject)));
-                               } else if (class == mono_defaults.monotype_class) {
+                               } else if (klass == mono_defaults.monotype_class) {
                                        printf ("[TYPE:%s], ", mono_type_full_name (((MonoReflectionType*)o)->type));
                                } else
-                                       printf ("[%s.%s:%p], ", class->name_space, class->name, o);
+                                       printf ("[%s.%s:%p], ", klass->name_space, klass->name, o);
                        } else {
                                printf ("%p, ", *arg_in_stack_slot(cpos, gpointer));
                        }