Add NoData as valid return state for Statements with params
[mono.git] / mono / metadata / sgen-fin-weak-hash.c
index 996394326835ae6a6316c95d0076a595de8cee00..5c9143622881d0981ff8cefc9688e28fe2b6da0a 100644 (file)
@@ -422,12 +422,12 @@ process_stage_entries (int num_entries, volatile gint32 *next_entry, StageEntry
 }
 
 #ifdef HEAVY_STATISTICS
-static long long stat_overflow_abort = 0;
-static long long stat_wait_for_processing = 0;
-static long long stat_increment_other_thread = 0;
-static long long stat_index_decremented = 0;
-static long long stat_entry_invalidated = 0;
-static long long stat_success = 0;
+static guint64 stat_overflow_abort = 0;
+static guint64 stat_wait_for_processing = 0;
+static guint64 stat_increment_other_thread = 0;
+static guint64 stat_index_decremented = 0;
+static guint64 stat_entry_invalidated = 0;
+static guint64 stat_success = 0;
 #endif
 
 static int
@@ -756,21 +756,23 @@ sgen_null_links_for_domain (MonoDomain *domain, int generation)
        SgenHashTable *hash = get_dislink_hash_table (generation);
        SGEN_HASH_TABLE_FOREACH (hash, link, dummy) {
                char *object = DISLINK_OBJECT (link);
-               if (*link && object && !((MonoObject*)object)->vtable) {
-                       gboolean free = TRUE;
 
-                       if (*link) {
-                               *link = NULL;
-                               binary_protocol_dislink_update (link, NULL, 0, 0);
-                               free = FALSE;
-                               /*
-                                * This can happen if finalizers are not ran, i.e. Environment.Exit ()
-                                * is called from finalizer like in finalizer-abort.cs.
-                                */
-                               SGEN_LOG (5, "Disappearing link %p not freed", link);
-                       }
+               if (object)
+                       SGEN_ASSERT (0, ((MonoObject*)object)->vtable, "Can't have objects without vtables.");
+
+               if (*link && object && ((MonoObject*)object)->vtable->domain == domain) {
+                       *link = NULL;
+                       binary_protocol_dislink_update (link, NULL, 0, 0);
+                       /*
+                        * This can happen if finalizers are not ran, i.e. Environment.Exit ()
+                        * is called from finalizer like in finalizer-abort.cs.
+                        */
+                       SGEN_LOG (5, "Disappearing link %p not freed", link);
 
-                       SGEN_HASH_TABLE_FOREACH_REMOVE (free);
+                       /*
+                        * FIXME: Why don't we free the entry here?
+                        */
+                       SGEN_HASH_TABLE_FOREACH_REMOVE (FALSE);
 
                        continue;
                }
@@ -905,12 +907,12 @@ void
 sgen_init_fin_weak_hash (void)
 {
 #ifdef HEAVY_STATISTICS
-       mono_counters_register ("FinWeak Successes", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_success);
-       mono_counters_register ("FinWeak Overflow aborts", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_overflow_abort);
-       mono_counters_register ("FinWeak Wait for processing", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_wait_for_processing);
-       mono_counters_register ("FinWeak Increment other thread", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_increment_other_thread);
-       mono_counters_register ("FinWeak Index decremented", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_index_decremented);
-       mono_counters_register ("FinWeak Entry invalidated", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_entry_invalidated);
+       mono_counters_register ("FinWeak Successes", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_success);
+       mono_counters_register ("FinWeak Overflow aborts", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_overflow_abort);
+       mono_counters_register ("FinWeak Wait for processing", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_wait_for_processing);
+       mono_counters_register ("FinWeak Increment other thread", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_increment_other_thread);
+       mono_counters_register ("FinWeak Index decremented", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_index_decremented);
+       mono_counters_register ("FinWeak Entry invalidated", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_entry_invalidated);
 #endif
 }