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 817356b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 46 deletions.
1 change: 0 additions & 1 deletion src/mono/mono/metadata/marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -5237,7 +5237,6 @@ mono_marshal_get_unsafe_accessor_wrapper (MonoMethod *accessor_method, MonoUnsaf
if (accessor_method->is_generic) {
/* got a generic method definition. need to make a generic method definition wrapper */
g_assert (!accessor_method->is_inflated);
printf ("accessor method is generic: %s\n", mono_method_full_name (accessor_method, TRUE));
is_generic = TRUE;
}

Expand Down
32 changes: 6 additions & 26 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 Expand Up @@ -7953,12 +7939,6 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg, gboolean stor
*/
buf2 = (guint8 *)g_malloc (4096);
p2 = buf2;
if (cfg->method->wrapper_type && cfg->method->is_generic) {
printf ("barf\n");
}
if (jinfo->d.method->wrapper_type && jinfo->d.method->is_generic) {
printf ("barf2\n");
}
encode_method_ref (acfg, jinfo->d.method, p2, &p2);
len = GPTRDIFF_TO_INT (p2 - buf2);
g_assert (len < 4096);
Expand Down Expand Up @@ -9552,7 +9532,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
(method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
(method->flags & METHOD_ATTRIBUTE_ABSTRACT)) {
printf ("Skip (impossible): %s\n", mono_method_full_name (method, TRUE));
//printf ("Skip (impossible): %s\n", mono_method_full_name (method, TRUE));
return;
}

Expand Down
24 changes: 5 additions & 19 deletions src/mono/mono/mini/mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -3196,9 +3196,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
cfg->jit_mm = jit_mm_for_method (cfg->method);
cfg->mem_manager = m_method_get_mem_manager (cfg->method);

char *method_name = mono_method_get_full_name (cfg->method);

if (cfg->method->wrapper_type == MONO_WRAPPER_ALLOC || cfg->method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
if (cfg->method->wrapper_type == MONO_WRAPPER_ALLOC || cfg->method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
/* We can't have seq points inside gc critical regions or native-to-managed wrapper */
cfg->gen_seq_points = FALSE;
cfg->gen_sdb_seq_points = FALSE;
Expand Down Expand Up @@ -3310,26 +3308,14 @@ 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;
}


if (cfg->llvm_only && cfg->interp && !cfg->interp_entry_only && header->num_clauses) {
gboolean can_deopt = TRUE;
/*
Expand Down Expand Up @@ -3474,10 +3460,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 +3474,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 817356b

Please sign in to comment.