X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fsgen-scan-object.h;h=48490d781e227d7f58179e5b49e8521ad27923ce;hb=f6c4420d096e238f1e861edbe7483b2ee9167709;hp=fda42b364f6ce107c50cb6f50f0e8d042bde14d7;hpb=790f9864d300d7e42ac3d6e3ce3362f3df8c1f3e;p=mono.git diff --git a/mono/metadata/sgen-scan-object.h b/mono/metadata/sgen-scan-object.h index fda42b364f6..48490d781e2 100644 --- a/mono/metadata/sgen-scan-object.h +++ b/mono/metadata/sgen-scan-object.h @@ -38,6 +38,9 @@ * padding at the end) is "skip_size". "desc" is the object's GC * descriptor. The action can use the macro * "SCAN" to scan the object. + * + * SCAN_OBJECT_NOVTABLE - desc is provided by the includer, instead of + * vt. Complex arrays cannot not be scanned. */ #ifndef SCAN_OBJECT_ACTION @@ -45,87 +48,72 @@ #endif { +#ifndef SCAN_OBJECT_NOVTABLE GCVTable *vt; - size_t skip_size; mword desc; - vt = (GCVTable*)LOAD_VTABLE (start); + vt = (GCVTable*)SGEN_LOAD_VTABLE (start); //type = vt->desc & 0x7; /* gcc should be smart enough to remove the bounds check, but it isn't:( */ desc = vt->desc; +#endif switch (desc & 0x7) { case DESC_TYPE_RUN_LENGTH: - OBJ_RUN_LEN_SIZE (skip_size, desc, start); #define SCAN OBJ_RUN_LEN_FOREACH_PTR (desc, start) #ifndef SCAN_OBJECT_NOSCAN SCAN; #endif SCAN_OBJECT_ACTION; #undef SCAN - start += skip_size; break; - case DESC_TYPE_ARRAY: - case DESC_TYPE_VECTOR: - skip_size = safe_object_get_size ((MonoObject*)start); - skip_size += (ALLOC_ALIGN - 1); - skip_size &= ~(ALLOC_ALIGN - 1); -#define SCAN OBJ_VECTOR_FOREACH_PTR (vt, start) + case DESC_TYPE_SMALL_BITMAP: +#define SCAN OBJ_BITMAP_FOREACH_PTR (desc, start) #ifndef SCAN_OBJECT_NOSCAN SCAN; #endif SCAN_OBJECT_ACTION; #undef SCAN - start += skip_size; break; - case DESC_TYPE_SMALL_BITMAP: - OBJ_BITMAP_SIZE (skip_size, desc, start); - g_assert (skip_size); -#define SCAN OBJ_BITMAP_FOREACH_PTR (desc, start) + case DESC_TYPE_VECTOR: +#define SCAN OBJ_VECTOR_FOREACH_PTR (desc, start) #ifndef SCAN_OBJECT_NOSCAN SCAN; #endif SCAN_OBJECT_ACTION; #undef SCAN - start += skip_size; break; case DESC_TYPE_LARGE_BITMAP: - skip_size = safe_object_get_size ((MonoObject*)start); - skip_size += (ALLOC_ALIGN - 1); - skip_size &= ~(ALLOC_ALIGN - 1); -#define SCAN OBJ_LARGE_BITMAP_FOREACH_PTR (vt,start) +#define SCAN OBJ_LARGE_BITMAP_FOREACH_PTR (desc, start) #ifndef SCAN_OBJECT_NOSCAN SCAN; #endif SCAN_OBJECT_ACTION; #undef SCAN - start += skip_size; break; case DESC_TYPE_COMPLEX: /* this is a complex object */ - skip_size = safe_object_get_size ((MonoObject*)start); - skip_size += (ALLOC_ALIGN - 1); - skip_size &= ~(ALLOC_ALIGN - 1); -#define SCAN OBJ_COMPLEX_FOREACH_PTR (vt, start) +#define SCAN OBJ_COMPLEX_FOREACH_PTR (desc, start) #ifndef SCAN_OBJECT_NOSCAN SCAN; #endif SCAN_OBJECT_ACTION; #undef SCAN - start += skip_size; break; +#ifndef SCAN_OBJECT_NOVTABLE case DESC_TYPE_COMPLEX_ARR: /* this is an array of complex structs */ - skip_size = safe_object_get_size ((MonoObject*)start); - skip_size += (ALLOC_ALIGN - 1); - skip_size &= ~(ALLOC_ALIGN - 1); #define SCAN OBJ_COMPLEX_ARR_FOREACH_PTR (vt, start) #ifndef SCAN_OBJECT_NOSCAN SCAN; #endif SCAN_OBJECT_ACTION; #undef SCAN - start += skip_size; + break; +#endif + case DESC_TYPE_COMPLEX_PTRFREE: + /*Nothing to do*/ + SCAN_OBJECT_ACTION; break; default: g_assert_not_reached (); @@ -134,3 +122,4 @@ #undef SCAN_OBJECT_NOSCAN #undef SCAN_OBJECT_ACTION +#undef SCAN_OBJECT_NOVTABLE