2003-09-29 Bryce McKinlay * boehm.cc (_Jv_BuildGCDescr): Put first word of object in most significant bit of descriptor. Include the vtable and sync_info fields. Index: boehm.cc =================================================================== RCS file: /cvs/gcc/gcc/libjava/boehm.cc,v retrieving revision 1.39 diff -u -r1.39 boehm.cc --- boehm.cc 23 Jul 2003 15:08:07 -0000 1.39 +++ boehm.cc 29 Sep 2003 07:09:55 -0000 @@ -331,12 +331,20 @@ _Jv_BuildGCDescr(jclass self) { jlong desc = 0; + jint bits_per_word = CHAR_BIT * sizeof (void *); // Note: for now we only consider a bitmap mark descriptor. We // could also handle the case where the first N fields of a type are // references. However, this is not very likely to be used by many // classes, and it is easier to compute things this way. + // The vtable pointer. + desc |= 1ULL << (bits_per_word - 1); +#ifndef JV_HASH_SYNCHRONIZATION + // The sync_info field. + desc |= 1ULL << (bits_per_word - 2); +#endif + for (jclass klass = self; klass != NULL; klass = klass->getSuperclass()) { jfieldID field = JvGetFirstInstanceField(klass); @@ -351,13 +359,12 @@ if (off % sizeof (void *) != 0) return (void *) (GCJ_DEFAULT_DESCR); off /= sizeof (void *); - // Bottom 2 bits are reserved. - off += 2; // If we find a field outside the range of our bitmap, - // fall back to procedure marker. - if (off > CHAR_BIT * sizeof (void *)) + // fall back to procedure marker. The bottom 2 bits are + // reserved. + if (off >= bits_per_word - 2) return (void *) (GCJ_DEFAULT_DESCR); - desc |= 1ULL << off; + desc |= 1ULL << (bits_per_word - off - 1); } field = field->getNextField();