X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fmini-runtime.c;h=a3f4883f74d5fc7ffc43c20047a7f5d254dcbc37;hb=e64e3dbaca04061854aa9b3764fd415d6e7119a9;hp=b839e49f09637e9d1314e10c13815ced0435d885;hpb=9d0b1967c0566f18faa9993d33e61f66ccb95783;p=mono.git diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index b839e49f096..a3f4883f74d 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -2621,6 +2622,8 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec #endif error_init (error); + if (exc) + *exc = NULL; if (obj == NULL && !(method->flags & METHOD_ATTRIBUTE_STATIC) && !method->string_ctor && (method->wrapper_type == 0)) { g_warning ("Ignoring invocation of an instance method on a NULL instance.\n"); @@ -4045,7 +4048,7 @@ register_icalls (void) mono_add_internal_call ("Mono.Runtime::mono_runtime_cleanup_handlers", mono_runtime_cleanup_handlers); -#if defined(PLATFORM_ANDROID) || defined(TARGET_ANDROID) +#if defined(HOST_ANDROID) || defined(TARGET_ANDROID) mono_add_internal_call ("System.Diagnostics.Debugger::Mono_UnhandledException_internal", mono_debugger_agent_unhandled_exception); #endif @@ -4305,6 +4308,11 @@ register_icalls (void) MonoJitStats mono_jit_stats = {0}; +/** + * Counters of mono_stats can be read without locking here. + * MONO_NO_SANITIZE_THREAD tells Clang's ThreadSanitizer to hide all reports of these (known) races. + */ +MONO_NO_SANITIZE_THREAD static void print_jit_stats (void) { @@ -4315,36 +4323,36 @@ print_jit_stats (void) g_print ("Biggest method: %ld (%s)\n", mono_jit_stats.biggest_method_size, mono_jit_stats.biggest_method); - g_print ("Delegates created: %ld\n", mono_stats.delegate_creations); - g_print ("Initialized classes: %ld\n", mono_stats.initialized_class_count); - g_print ("Used classes: %ld\n", mono_stats.used_class_count); - g_print ("Generic vtables: %ld\n", mono_stats.generic_vtable_count); - g_print ("Methods: %ld\n", mono_stats.method_count); - g_print ("Static data size: %ld\n", mono_stats.class_static_data_size); - g_print ("VTable data size: %ld\n", mono_stats.class_vtable_size); + g_print ("Delegates created: %" G_GINT32_FORMAT "\n", mono_stats.delegate_creations); + g_print ("Initialized classes: %" G_GINT32_FORMAT "\n", mono_stats.initialized_class_count); + g_print ("Used classes: %" G_GINT32_FORMAT "\n", mono_stats.used_class_count); + g_print ("Generic vtables: %" G_GINT32_FORMAT "\n", mono_stats.generic_vtable_count); + g_print ("Methods: %" G_GINT32_FORMAT "\n", mono_stats.method_count); + g_print ("Static data size: %" G_GINT32_FORMAT "\n", mono_stats.class_static_data_size); + g_print ("VTable data size: %" G_GINT32_FORMAT "\n", mono_stats.class_vtable_size); g_print ("Mscorlib mempool size: %d\n", mono_mempool_get_allocated (mono_defaults.corlib->mempool)); - g_print ("\nInitialized classes: %ld\n", mono_stats.generic_class_count); - g_print ("Inflated types: %ld\n", mono_stats.inflated_type_count); + g_print ("\nInitialized classes: %" G_GINT32_FORMAT "\n", mono_stats.generic_class_count); + g_print ("Inflated types: %" G_GINT32_FORMAT "\n", mono_stats.inflated_type_count); g_print ("Generics virtual invokes: %ld\n", mono_jit_stats.generic_virtual_invocations); - g_print ("Sharable generic methods: %ld\n", mono_stats.generics_sharable_methods); - g_print ("Unsharable generic methods: %ld\n", mono_stats.generics_unsharable_methods); - g_print ("Shared generic methods: %ld\n", mono_stats.generics_shared_methods); - g_print ("Shared vtype generic methods: %ld\n", mono_stats.gsharedvt_methods); - - g_print ("IMT tables size: %ld\n", mono_stats.imt_tables_size); - g_print ("IMT number of tables: %ld\n", mono_stats.imt_number_of_tables); - g_print ("IMT number of methods: %ld\n", mono_stats.imt_number_of_methods); - g_print ("IMT used slots: %ld\n", mono_stats.imt_used_slots); - g_print ("IMT colliding slots: %ld\n", mono_stats.imt_slots_with_collisions); - g_print ("IMT max collisions: %ld\n", mono_stats.imt_max_collisions_in_slot); - g_print ("IMT methods at max col: %ld\n", mono_stats.imt_method_count_when_max_collisions); - g_print ("IMT trampolines size: %ld\n", mono_stats.imt_trampolines_size); - - g_print ("JIT info table inserts: %ld\n", mono_stats.jit_info_table_insert_count); - g_print ("JIT info table removes: %ld\n", mono_stats.jit_info_table_remove_count); - g_print ("JIT info table lookups: %ld\n", mono_stats.jit_info_table_lookup_count); + g_print ("Sharable generic methods: %" G_GINT32_FORMAT "\n", mono_stats.generics_sharable_methods); + g_print ("Unsharable generic methods: %" G_GINT32_FORMAT "\n", mono_stats.generics_unsharable_methods); + g_print ("Shared generic methods: %" G_GINT32_FORMAT "\n", mono_stats.generics_shared_methods); + g_print ("Shared vtype generic methods: %" G_GINT32_FORMAT "\n", mono_stats.gsharedvt_methods); + + g_print ("IMT tables size: %" G_GINT32_FORMAT "\n", mono_stats.imt_tables_size); + g_print ("IMT number of tables: %" G_GINT32_FORMAT "\n", mono_stats.imt_number_of_tables); + g_print ("IMT number of methods: %" G_GINT32_FORMAT "\n", mono_stats.imt_number_of_methods); + g_print ("IMT used slots: %" G_GINT32_FORMAT "\n", mono_stats.imt_used_slots); + g_print ("IMT colliding slots: %" G_GINT32_FORMAT "\n", mono_stats.imt_slots_with_collisions); + g_print ("IMT max collisions: %" G_GINT32_FORMAT "\n", mono_stats.imt_max_collisions_in_slot); + g_print ("IMT methods at max col: %" G_GINT32_FORMAT "\n", mono_stats.imt_method_count_when_max_collisions); + g_print ("IMT trampolines size: %" G_GINT32_FORMAT "\n", mono_stats.imt_trampolines_size); + + g_print ("JIT info table inserts: %" G_GINT32_FORMAT "\n", mono_stats.jit_info_table_insert_count); + g_print ("JIT info table removes: %" G_GINT32_FORMAT "\n", mono_stats.jit_info_table_remove_count); + g_print ("JIT info table lookups: %" G_GINT32_FORMAT "\n", mono_stats.jit_info_table_lookup_count); g_free (mono_jit_stats.max_ratio_method); mono_jit_stats.max_ratio_method = NULL;