Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mono/metadata/sre-save.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,6 @@ mono_image_fill_export_table (MonoDomain *domain, MonoReflectionTypeBuilder *tb,
if (m_class_get_type_token (klass) != tb_token) {
g_error ("TypeBuilder token %08x does not match klass token %08x", tb_token, m_class_get_type_token (klass));
}
klass->type_token = tb_token; /* FIXME: shouldn't this already be set? Why is this assignment here? */

idx = mono_image_fill_export_table_from_class (domain, klass, module_index,
parent_index, assembly);
Expand Down
2 changes: 1 addition & 1 deletion mono/mini/interp/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ jit_call_supported (MonoMethod *method, MonoMethodSignature *sig)
if (method->string_ctor)
return FALSE;

if (mono_aot_only && method->klass->image->aot_module)
if (mono_aot_only && m_class_get_image (method->klass)->aot_module)
/* The AOTed version of the called method is assumed to be available in full-aot mode */
return TRUE;

Expand Down
2 changes: 1 addition & 1 deletion mono/mini/mini-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, gboolean jit_
use_interp = TRUE;
if (!use_interp && mono_interp_only_classes) {
for (GSList *l = mono_interp_only_classes; l; l = l->next) {
if (!strcmp (method->klass->name, (char*)l->data))
if (!strcmp (m_class_get_name (method->klass), (char*)l->data))
use_interp = TRUE;
}
}
Expand Down
4 changes: 2 additions & 2 deletions mono/mini/mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -3278,7 +3278,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
if (cfg->disable_llvm) {
if (cfg->verbose_level >= (cfg->llvm_only ? 0 : 1)) {
//nm = mono_method_full_name (cfg->method, TRUE);
printf ("LLVM failed for '%s.%s': %s\n", method->klass->name, method->name, cfg->exception_message);
printf ("LLVM failed for '%s.%s': %s\n", m_class_get_name (method->klass), method->name, cfg->exception_message);
//g_free (nm);
}
if (cfg->llvm_only) {
Expand Down Expand Up @@ -3813,7 +3813,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
if (cfg->disable_llvm) {
if (cfg->verbose_level >= (cfg->llvm_only ? 0 : 1)) {
//nm = mono_method_full_name (cfg->method, TRUE);
printf ("LLVM failed for '%s.%s': %s\n", method->klass->name, method->name, cfg->exception_message);
printf ("LLVM failed for '%s.%s': %s\n", m_class_get_name (method->klass), method->name, cfg->exception_message);
//g_free (nm);
}
if (cfg->llvm_only) {
Expand Down
30 changes: 15 additions & 15 deletions tools/monograph/monograph.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ void __nacl_suspend_thread_if_needed() {}
static void
output_type_edge (MonoClass *first, MonoClass *second) {
if (include_namespace)
fprintf (output, "\t\"%s.%s\" -> \"%s.%s\"\n", first->name_space, first->name, second->name_space, second->name);
fprintf (output, "\t\"%s.%s\" -> \"%s.%s\"\n", m_class_get_name_space (first), m_class_get_name (first), m_class_get_name_space (second), m_class_get_name (second));
else
fprintf (output, "\t\"%s\" -> \"%s\"\n", first->name, second->name);
fprintf (output, "\t\"%s\" -> \"%s\"\n", m_class_get_name (first), m_class_get_name (second));
}

static void
Expand All @@ -42,7 +42,7 @@ print_subtypes (MonoImage *image, MonoClass *class, int depth) {

t = mono_image_get_table_info (image, MONO_TABLE_TYPEDEF);

token = mono_metadata_token_index (class->type_token);
token = mono_metadata_token_index (m_class_get_type_token (class));
token <<= MONO_TYPEDEFORREF_BITS;
token |= MONO_TYPEDEFORREF_TYPEDEF;

Expand Down Expand Up @@ -83,7 +83,7 @@ type_graph (MonoImage *image, const char* cname) {
fprintf (output, "%s", graph_properties);
child = class;
/* go back and print the parents for the node as well: not sure it's a good idea */
for (parent = class->parent; parent; parent = parent->parent) {
for (parent = m_class_get_parent (class); parent; parent = m_class_get_parent (parent)) {
output_type_edge (parent, child);
child = parent;
}
Expand Down Expand Up @@ -119,7 +119,7 @@ interface_graph (MonoImage *image, const char* cname) {
fprintf (output, "digraph interface {\n");
fprintf (output, "%s", graph_properties);
/* TODO: handle inetrface defined in one image and class defined in another. */
token = mono_metadata_token_index (class->type_token);
token = mono_metadata_token_index (m_class_get_type_token (class));
token <<= MONO_TYPEDEFORREF_BITS;
token |= MONO_TYPEDEFORREF_TYPEDEF;
for (i = 0; i < mono_table_info_get_rows (intf); ++i) {
Expand All @@ -133,7 +133,7 @@ interface_graph (MonoImage *image, const char* cname) {
}
fprintf (output, "}\n");
if (verbose && !count)
g_print ("No class implements %s.%s\n", class->name_space, class->name);
g_print ("No class implements %s.%s\n", m_class_get_name_space (class), m_class_get_name (class));

}

Expand Down Expand Up @@ -259,7 +259,7 @@ method_stats (MonoMethod *method) {
case MonoInlineType:
if (i == MONO_CEE_CASTCLASS || i == MONO_CEE_ISINST) {
guint32 token = read32 (ip + 1);
MonoClass *k = mono_class_get (method->klass->image, token);
MonoClass *k = mono_class_get (m_class_get_image (method->klass), token);
if (k && mono_class_get_flags (k) & TYPE_ATTRIBUTE_SEALED)
cast_sealed++;
if (k && mono_class_get_flags (k) & TYPE_ATTRIBUTE_INTERFACE)
Expand Down Expand Up @@ -361,7 +361,7 @@ method_stats (MonoMethod *method) {
break;
case MonoInlineMethod:
if (i == MONO_CEE_CALLVIRT) {
MonoMethod *cm = mono_get_method (method->klass->image, read32 (ip + 1), NULL);
MonoMethod *cm = mono_get_method (m_class_get_image (method->klass), read32 (ip + 1), NULL);
if (cm && !(cm->flags & METHOD_ATTRIBUTE_VIRTUAL))
nonvirt_callvirt++;
if (cm && (mono_class_get_flags (cm->klass) & TYPE_ATTRIBUTE_INTERFACE))
Expand Down Expand Up @@ -434,10 +434,10 @@ type_stats (MonoClass *klass) {
num_ifaces++;
return;
}
parent = klass->parent;
parent = m_class_get_parent (klass);
while (parent) {
depth++;
parent = parent->parent;
parent = m_class_get_parent (parent);
}
if (pdepth_array_next >= pdepth_array_size) {
pdepth_array_size *= 2;
Expand Down Expand Up @@ -527,7 +527,7 @@ type_size_stats (MonoClass *klass)
mono_method_header_get_code (header, &size, &maxs);
code_size += size;
}
g_print ("%s.%s: code: %d\n", klass->name_space, klass->name, code_size);
g_print ("%s.%s: code: %d\n", m_class_get_name_space (klass), m_class_get_name (klass), code_size);
}

static void
Expand Down Expand Up @@ -555,10 +555,10 @@ get_signature (MonoMethod *method) {
return result;

res = g_string_new ("");
if (include_namespace && *(method->klass->name_space))
g_string_append_printf (res, "%s.", method->klass->name_space);
if (include_namespace && *m_class_get_name_space (method->klass))
g_string_append_printf (res, "%s.", m_class_get_name_space (method->klass));
result = mono_signature_get_desc (mono_method_signature (method), include_namespace);
g_string_append_printf (res, "%s:%s(%s)", method->klass->name, method->name, result);
g_string_append_printf (res, "%s:%s(%s)", m_class_get_name (method->klass), method->name, result);
g_free (result);
g_hash_table_insert (hash, method, res->str);

Expand Down Expand Up @@ -666,7 +666,7 @@ print_method (MonoMethod *method, int depth) {
ip++;
token = read32 (ip);
ip += 4;
called = mono_get_method (method->klass->image, token, NULL);
called = mono_get_method (m_class_get_image (method->klass), token, NULL);
if (!called)
break; /* warn? */
if (g_hash_table_lookup (hash, called))
Expand Down
6 changes: 3 additions & 3 deletions tools/pedump/pedump.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ dump_verify_info (MonoImage *image, int flags, gboolean valid_only)
errors = mono_method_verify (method, flags);
if (errors) {
MonoClass *klass = mono_method_get_class (method);
char *name = mono_type_full_name (&klass->byval_arg);
char *name = mono_type_full_name (m_class_get_byval_arg (klass));
if (mono_method_signature (method) == NULL) {
g_print ("In method: %s::%s(ERROR)\n", name, mono_method_get_name (method));
} else {
Expand Down Expand Up @@ -528,7 +528,7 @@ verify_image_file (const char *fname)
if (mono_class_has_failure (klass)) {
ERROR_DECL (type_load_error);
mono_error_set_for_class_failure (type_load_error, klass);
printf ("Could not initialize class(0x%08x) %s.%s due to %s\n", token, klass->name_space, klass->name, mono_error_get_message (type_load_error));
printf ("Could not initialize class(0x%08x) %s.%s due to %s\n", token, m_class_get_name_space (klass), m_class_get_name (klass), mono_error_get_message (type_load_error));
mono_error_cleanup (type_load_error);
++count;
}
Expand All @@ -537,7 +537,7 @@ verify_image_file (const char *fname)
if (mono_class_has_failure (klass)) {
ERROR_DECL (type_load_error);
mono_error_set_for_class_failure (type_load_error, klass);
printf ("Could not initialize vtable of class(0x%08x) %s.%s due to %s\n", token, klass->name_space, klass->name, mono_error_get_message (type_load_error));
printf ("Could not initialize vtable of class(0x%08x) %s.%s due to %s\n", token, m_class_get_name_space (klass), m_class_get_name (klass), mono_error_get_message (type_load_error));
mono_error_cleanup (type_load_error);
++count;
}
Expand Down