[sgen] Increase debug level of assertions in inner loops.
authorMark Probst <mark.probst@gmail.com>
Thu, 2 Oct 2014 23:55:39 +0000 (16:55 -0700)
committerMark Probst <mark.probst@gmail.com>
Wed, 26 Nov 2014 18:38:43 +0000 (10:38 -0800)
mono/metadata/sgen-descriptor.c
mono/metadata/sgen-gc.h
mono/metadata/sgen-marksweep.c

index 837e050074c511f49bb872b660aff03aa6fcfe80..d4ecd1d274e118a6cebb9af0a358edab8595b0c2 100644 (file)
@@ -153,7 +153,7 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size)
 
        g_assert (!(stored_size & 0x7));
 
-       SGEN_ASSERT (0, stored_size == SGEN_ALIGN_UP (stored_size), "Size is not aligned");
+       SGEN_ASSERT (5, stored_size == SGEN_ALIGN_UP (stored_size), "Size is not aligned");
 
        /* we know the 2-word header is ptr-free */
        if (last_set < LARGE_BITMAP_SIZE + OBJECT_HEADER_WORDS && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) {
index 10e2193f1b1709a31d086fb6815dd1159d981684..b365c4115f85700cc260130d712315297154762e 100644 (file)
@@ -784,7 +784,7 @@ static inline mword
 sgen_obj_get_descriptor (char *obj)
 {
        MonoVTable *vtable = ((MonoObject*)obj)->vtable;
-       SGEN_ASSERT (0, !SGEN_POINTER_IS_TAGGED_ANY (vtable), "Object can't be tagged");
+       SGEN_ASSERT (9, !SGEN_POINTER_IS_TAGGED_ANY (vtable), "Object can't be tagged");
        return sgen_vtable_get_descriptor (vtable);
 }
 
@@ -808,7 +808,7 @@ sgen_par_object_get_size (MonoVTable *vtable, MonoObject* o)
 
        if (type == DESC_TYPE_RUN_LENGTH || type == DESC_TYPE_SMALL_PTRFREE) {
                mword size = descr & 0xfff8;
-               SGEN_ASSERT (0, size >= sizeof (MonoObject), "Run length object size to small");
+               SGEN_ASSERT (9, size >= sizeof (MonoObject), "Run length object size to small");
                return size;
        } else if (descr == SGEN_DESC_STRING) {
                return offsetof (MonoString, chars) + 2 * mono_string_length_fast ((MonoString*) o) + 2;
index 9ee9fa4832498d347872cda4594c3f0a9b2088c4..646cca797dac01d3fa35a64d697459cac393699b 100644 (file)
@@ -879,7 +879,7 @@ major_dump_heap (FILE *heap_dump_file)
 #else
 #define MS_MARK_OBJECT_AND_ENQUEUE_CHECKED(obj,desc,block,queue) do {  \
                int __word, __bit;                                      \
-               SGEN_ASSERT (0, sgen_get_current_collection_generation () == GENERATION_OLD, "Can't majorly enqueue objects when doing minor collection"); \
+               SGEN_ASSERT (9, sgen_get_current_collection_generation () == GENERATION_OLD, "Can't majorly enqueue objects when doing minor collection"); \
                MS_CALC_MARK_BIT (__word, __bit, (obj));                \
                if (MS_OBJ_ALLOCED ((obj), (block))) { \
                        if (sgen_gc_descr_has_references (desc)) {                                              \
@@ -893,7 +893,7 @@ major_dump_heap (FILE *heap_dump_file)
        } while (0)
 #define MS_MARK_OBJECT_AND_ENQUEUE(obj,desc,block,queue) do {          \
                int __word, __bit;                                      \
-               SGEN_ASSERT (0, sgen_get_current_collection_generation () == GENERATION_OLD, "Can't majorly enqueue objects when doing minor collection"); \
+               SGEN_ASSERT (9, sgen_get_current_collection_generation () == GENERATION_OLD, "Can't majorly enqueue objects when doing minor collection"); \
                MS_CALC_MARK_BIT (__word, __bit, (obj));                \
                SGEN_ASSERT (9, MS_OBJ_ALLOCED ((obj), (block)), "object %p not allocated", obj);       \
                {               \