< prev index next >

src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp

Print this page
rev 11483 : [mq]: webrev.01

@@ -7363,14 +7363,21 @@
 
 #ifdef ASSERT
       if (oop(addr)->klass_or_null() != NULL) {
         // Ignore mark word because we are running concurrent with mutators
         assert(oop(addr)->is_oop(true), "live block should be an oop");
+        Klass* k = oop(addr)->klass();
+
+        // It's not always safe to ask for the size of a j.l.Class object,
+        // if the Class's oop_size hasn't been set yet.
+        if (!k->is_instance_klass() ||
+            !InstanceKlass::cast(k)->is_mirror_instance_klass()) {
         assert(size ==
                CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()),
                "P-mark and computed size do not agree");
       }
+      }
 #endif
 
   } else {
     // This should be an initialized object that's alive.
     assert(oop(addr)->klass_or_null() != NULL,
< prev index next >