< prev index next >

src/hotspot/share/gc/shared/space.cpp

Print this page




 444 }
 445 
 446 void ContiguousSpace::print_on(outputStream* st) const {
 447   print_short_on(st);
 448   st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
 449                 p2i(bottom()), p2i(top()), p2i(end()));
 450 }
 451 
 452 void OffsetTableContigSpace::print_on(outputStream* st) const {
 453   print_short_on(st);
 454   st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
 455                 INTPTR_FORMAT ", " INTPTR_FORMAT ")",
 456               p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end()));
 457 }
 458 
 459 void ContiguousSpace::verify() const {
 460   HeapWord* p = bottom();
 461   HeapWord* t = top();
 462   HeapWord* prev_p = NULL;
 463   while (p < t) {
 464     oop(p)->verify();
 465     prev_p = p;
 466     p += oop(p)->size();
 467   }
 468   guarantee(p == top(), "end of last object must match end of space");
 469   if (top() != end()) {
 470     guarantee(top() == block_start_const(end()-1) &&
 471               top() == block_start_const(top()),
 472               "top should be start of unallocated block, if it exists");
 473   }
 474 }
 475 
 476 void Space::oop_iterate(OopIterateClosure* blk) {
 477   ObjectToOopClosure blk2(blk);
 478   object_iterate(&blk2);
 479 }
 480 
 481 bool Space::obj_is_alive(const HeapWord* p) const {
 482   assert (block_is_obj(p), "The address should point to an object");
 483   return true;
 484 }


 691   int objs = 0;
 692   int blocks = 0;
 693 
 694   if (VerifyObjectStartArray) {
 695     _offsets.verify();
 696   }
 697 
 698   while (p < top()) {
 699     size_t size = oop(p)->size();
 700     // For a sampling of objects in the space, find it using the
 701     // block offset table.
 702     if (blocks == BLOCK_SAMPLE_INTERVAL) {
 703       guarantee(p == block_start_const(p + (size/2)),
 704                 "check offset computation");
 705       blocks = 0;
 706     } else {
 707       blocks++;
 708     }
 709 
 710     if (objs == OBJ_SAMPLE_INTERVAL) {
 711       oop(p)->verify();
 712       objs = 0;
 713     } else {
 714       objs++;
 715     }
 716     prev_p = p;
 717     p += size;
 718   }
 719   guarantee(p == top(), "end of last object must match end of space");
 720 }
 721 
 722 
 723 size_t TenuredSpace::allowed_dead_ratio() const {
 724   return MarkSweepDeadRatio;
 725 }


 444 }
 445 
 446 void ContiguousSpace::print_on(outputStream* st) const {
 447   print_short_on(st);
 448   st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
 449                 p2i(bottom()), p2i(top()), p2i(end()));
 450 }
 451 
 452 void OffsetTableContigSpace::print_on(outputStream* st) const {
 453   print_short_on(st);
 454   st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
 455                 INTPTR_FORMAT ", " INTPTR_FORMAT ")",
 456               p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end()));
 457 }
 458 
 459 void ContiguousSpace::verify() const {
 460   HeapWord* p = bottom();
 461   HeapWord* t = top();
 462   HeapWord* prev_p = NULL;
 463   while (p < t) {
 464     oopDesc::verify(oop(p));
 465     prev_p = p;
 466     p += oop(p)->size();
 467   }
 468   guarantee(p == top(), "end of last object must match end of space");
 469   if (top() != end()) {
 470     guarantee(top() == block_start_const(end()-1) &&
 471               top() == block_start_const(top()),
 472               "top should be start of unallocated block, if it exists");
 473   }
 474 }
 475 
 476 void Space::oop_iterate(OopIterateClosure* blk) {
 477   ObjectToOopClosure blk2(blk);
 478   object_iterate(&blk2);
 479 }
 480 
 481 bool Space::obj_is_alive(const HeapWord* p) const {
 482   assert (block_is_obj(p), "The address should point to an object");
 483   return true;
 484 }


 691   int objs = 0;
 692   int blocks = 0;
 693 
 694   if (VerifyObjectStartArray) {
 695     _offsets.verify();
 696   }
 697 
 698   while (p < top()) {
 699     size_t size = oop(p)->size();
 700     // For a sampling of objects in the space, find it using the
 701     // block offset table.
 702     if (blocks == BLOCK_SAMPLE_INTERVAL) {
 703       guarantee(p == block_start_const(p + (size/2)),
 704                 "check offset computation");
 705       blocks = 0;
 706     } else {
 707       blocks++;
 708     }
 709 
 710     if (objs == OBJ_SAMPLE_INTERVAL) {
 711       oopDesc::verify(oop(p));
 712       objs = 0;
 713     } else {
 714       objs++;
 715     }
 716     prev_p = p;
 717     p += size;
 718   }
 719   guarantee(p == top(), "end of last object must match end of space");
 720 }
 721 
 722 
 723 size_t TenuredSpace::allowed_dead_ratio() const {
 724   return MarkSweepDeadRatio;
 725 }
< prev index next >