7348
7349 // This object is live: we'd normally expect this to be
7350 // an oop, and like to assert the following:
7351 // assert(oop(addr)->is_oop(), "live block should be an oop");
7352 // However, as we commented above, this may be an object whose
7353 // header hasn't yet been initialized.
7354 size_t size;
7355 assert(_bitMap->isMarked(addr), "Tautology for this control point");
7356 if (_bitMap->isMarked(addr + 1)) {
7357 // Determine the size from the bit map, rather than trying to
7358 // compute it from the object header.
7359 HeapWord* nextOneAddr = _bitMap->getNextMarkedWordAddress(addr + 2);
7360 size = pointer_delta(nextOneAddr + 1, addr);
7361 assert(size == CompactibleFreeListSpace::adjustObjectSize(size),
7362 "alignment problem");
7363
7364 #ifdef ASSERT
7365 if (oop(addr)->klass_or_null() != NULL) {
7366 // Ignore mark word because we are running concurrent with mutators
7367 assert(oop(addr)->is_oop(true), "live block should be an oop");
7368 assert(size ==
7369 CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()),
7370 "P-mark and computed size do not agree");
7371 }
7372 #endif
7373
7374 } else {
7375 // This should be an initialized object that's alive.
7376 assert(oop(addr)->klass_or_null() != NULL,
7377 "Should be an initialized object");
7378 // Ignore mark word because we are running concurrent with mutators
7379 assert(oop(addr)->is_oop(true), "live block should be an oop");
7380 // Verify that the bit map has no bits marked between
7381 // addr and purported end of this block.
7382 size = CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size());
7383 assert(size >= 3, "Necessary for Printezis marks to work");
7384 assert(!_bitMap->isMarked(addr+1), "Tautology for this control point");
7385 DEBUG_ONLY(_bitMap->verifyNoOneBitsInRange(addr+2, addr+size);)
7386 }
7387 return size;
7388 }
7389
7390 void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc,
|
7348
7349 // This object is live: we'd normally expect this to be
7350 // an oop, and like to assert the following:
7351 // assert(oop(addr)->is_oop(), "live block should be an oop");
7352 // However, as we commented above, this may be an object whose
7353 // header hasn't yet been initialized.
7354 size_t size;
7355 assert(_bitMap->isMarked(addr), "Tautology for this control point");
7356 if (_bitMap->isMarked(addr + 1)) {
7357 // Determine the size from the bit map, rather than trying to
7358 // compute it from the object header.
7359 HeapWord* nextOneAddr = _bitMap->getNextMarkedWordAddress(addr + 2);
7360 size = pointer_delta(nextOneAddr + 1, addr);
7361 assert(size == CompactibleFreeListSpace::adjustObjectSize(size),
7362 "alignment problem");
7363
7364 #ifdef ASSERT
7365 if (oop(addr)->klass_or_null() != NULL) {
7366 // Ignore mark word because we are running concurrent with mutators
7367 assert(oop(addr)->is_oop(true), "live block should be an oop");
7368 Klass* k = oop(addr)->klass();
7369
7370 // It's not always safe to ask for the size of a j.l.Class object,
7371 // if the Class's oop_size hasn't been set yet.
7372 if (!k->is_instance_klass() ||
7373 !InstanceKlass::cast(k)->is_mirror_instance_klass()) {
7374 assert(size ==
7375 CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()),
7376 "P-mark and computed size do not agree");
7377 }
7378 }
7379 #endif
7380
7381 } else {
7382 // This should be an initialized object that's alive.
7383 assert(oop(addr)->klass_or_null() != NULL,
7384 "Should be an initialized object");
7385 // Ignore mark word because we are running concurrent with mutators
7386 assert(oop(addr)->is_oop(true), "live block should be an oop");
7387 // Verify that the bit map has no bits marked between
7388 // addr and purported end of this block.
7389 size = CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size());
7390 assert(size >= 3, "Necessary for Printezis marks to work");
7391 assert(!_bitMap->isMarked(addr+1), "Tautology for this control point");
7392 DEBUG_ONLY(_bitMap->verifyNoOneBitsInRange(addr+2, addr+size);)
7393 }
7394 return size;
7395 }
7396
7397 void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc,
|