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
/*
* 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 ();
}
}
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);
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) {
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 {
};
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) {
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;
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;
#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;
}
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*
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);
} 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);
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;
}
}
*/
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 */
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;
}
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;
}
* 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;
}
* 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;
}
* 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);
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
}
if (new_list)
- g_hash_table_insert (generic_subclass_hash, class, new_list);
+ g_hash_table_insert (generic_subclass_hash, klass, new_list);
}
/*
}
static MonoRuntimeGenericContextTemplate*
-alloc_template (MonoClass *class)
+alloc_template (MonoClass *klass)
{
static gboolean inited = FALSE;
static int num_allocted = 0;
num_allocted++;
num_bytes += size;
- return mono_image_alloc0 (class->image, size);
+ return mono_image_alloc0 (klass->image, size);
}
static MonoRuntimeGenericContextInfoTemplate*
}
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;
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;
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;
}
}
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;
}
/*
* 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);
}
/*
* 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)
//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) {
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 ();
* 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);
}
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);
}
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);
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)
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
static gpointer
instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti,
- MonoGenericContext *context, MonoClass *class)
+ MonoGenericContext *context, MonoClass *klass)
{
gpointer data;
gboolean temporary;
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:
offset += size;
break;
default:
- res->entries [i] = instantiate_info (domain, template, context, class);
+ res->entries [i] = instantiate_info (domain, template, context, klass);
break;
}
}
* 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;
* 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;
/* 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;
/* 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;
}
}
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 ();
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);
}
/* 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 ();
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) {
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);
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;
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)
* 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;
* 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;
}
/*
* 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;
}
/*