Skip to content

Commit

Permalink
clean WIP printfs
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdageek committed May 1, 2024
1 parent 29e664f commit 0149584
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 34 deletions.
24 changes: 5 additions & 19 deletions src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -4325,14 +4325,6 @@ add_method_with_index (MonoAotCompile *acfg, MonoMethod *method, int index, gboo
{
g_assert (method);
if (!g_hash_table_lookup (acfg->method_indexes, method)) {
{
char * method_name = mono_method_get_full_name (method);
g_print ("inserting %s into acfg\n", method_name);
if (strstr(method_name, "W_REF& Program:AccessBox<W_REF") == method_name) {
printf ("haraa\n");
}
g_free (method_name);
}
g_ptr_array_add (acfg->methods, method);
g_hash_table_insert (acfg->method_indexes, method, GUINT_TO_POINTER (index + 1));
acfg->nmethods = acfg->methods->len + 1;
Expand Down Expand Up @@ -4866,14 +4858,6 @@ replace_generated_method (MonoAotCompile *acfg, MonoMethod *method, MonoError *e
if (G_LIKELY (mono_method_metadata_has_header (method)))
return NULL;

{
char * method_name = mono_method_get_full_name (method);
g_print ("ADDING no header %s generic instances\n", method_name);
if (strstr (method_name, "!!0") != NULL)
g_print("anon\n");
g_free (method_name);
}

/* Unsafe accessors methods. Replace attempts to compile the accessor method by
* its wrapper.
*/
Expand All @@ -4887,17 +4871,19 @@ replace_generated_method (MonoAotCompile *acfg, MonoMethod *method, MonoError *e
wrapper = mono_marshal_get_unsafe_accessor_wrapper (method, (MonoUnsafeAccessorKind)accessor_kind, member_name);
}
if (is_ok (error)) {
{
if (mono_trace_is_traced (G_LOG_LEVEL_INFO, MONO_TRACE_AOT)) {
char * method_name = mono_method_get_full_name (wrapper);
g_print ("REPLACED by %s in generic instances\n", method_name);
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "Replacing generated method by %s", method_name);
g_free (method_name);
}
return wrapper;
}
}

if (!is_ok (error)) {
aot_printerrf (acfg, "Could not get unsafe accessor wrapper due to %s ", mono_error_get_message (error));
char *method_name = mono_method_get_full_name (method);
aot_printerrf (acfg, "Could not get generated wrapper for %s due to %s", method_name, mono_error_get_message (error));
g_free (method_name);
}

return NULL;
Expand Down
19 changes: 4 additions & 15 deletions src/mono/mono/mini/mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -3310,22 +3310,11 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
return cfg;
}

{
g_print ("START converting %s%s%s%smethod %s\n", COMPILE_LLVM (cfg) ? "llvm " : "", cfg->gsharedvt ? "gsharedvt " : "", (cfg->gshared && !cfg->gsharedvt) ? "gshared " : "", cfg->interp_entry_only ? "interp only " : "", method_name);
if (strstr(method_name, "W& Program:AccessBox") != NULL) {
printf ("blaps\n");
}
}

header = cfg->header = mono_method_get_header_checked (cfg->method, cfg->error);
if (!header) {
mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, FALSE);
g_print ("NO HEADER, returning, %s\n", method_name);
if (strstr(method_name, "AccessBox<W_REF>") != 0) {
printf ("oops\n");
}
return cfg;
}

Expand Down Expand Up @@ -3474,10 +3463,10 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
cfg->intvars = (guint16 *)mono_mempool_alloc0 (cfg->mempool, sizeof (guint16) * STACK_MAX * header->max_stack);

if (cfg->verbose_level > 0) {
char *v_method_name;
char *method_name;

v_method_name = mono_method_get_full_name (method);
g_print ("converting %s%s%s%smethod %s\n", COMPILE_LLVM (cfg) ? "llvm " : "", cfg->gsharedvt ? "gsharedvt " : "", (cfg->gshared && !cfg->gsharedvt) ? "gshared " : "", cfg->interp_entry_only ? "interp only " : "", v_method_name);
method_name = mono_method_get_full_name (method);
g_print ("converting %s%s%s%smethod %s\n", COMPILE_LLVM (cfg) ? "llvm " : "", cfg->gsharedvt ? "gsharedvt " : "", (cfg->gshared && !cfg->gsharedvt) ? "gshared " : "", cfg->interp_entry_only ? "interp only " : "", method_name);
/*
if (COMPILE_LLVM (cfg))
g_print ("converting llvm method %s\n", method_name = mono_method_full_name (method, TRUE));
Expand All @@ -3488,7 +3477,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
else
g_print ("converting method %s\n", method_name = mono_method_full_name (method, TRUE));
*/
g_free (v_method_name);
g_free (method_name);
}

if (cfg->opt & MONO_OPT_ABCREM)
Expand Down

0 comments on commit 0149584

Please sign in to comment.