< prev index next >

src/hotspot/share/gc/z/zHeap.cpp

Print this page




 523   print_on(st);
 524   st->cr();
 525 
 526   // Do not allow pages to be deleted
 527   _page_allocator.enable_deferred_delete();
 528 
 529   // Print all pages
 530   ZPageTableIterator iter(&_page_table);
 531   for (ZPage* page; iter.next(&page);) {
 532     page->print_on(st);
 533   }
 534 
 535   // Allow pages to be deleted
 536   _page_allocator.enable_deferred_delete();
 537 
 538   st->cr();
 539 }
 540 
 541 class ZVerifyRootsTask : public ZTask {
 542 private:

 543   ZRootsIterator     _strong_roots;
 544   ZWeakRootsIterator _weak_roots;
 545 
 546 public:
 547   ZVerifyRootsTask() :
 548       ZTask("ZVerifyRootsTask"),

 549       _strong_roots(),
 550       _weak_roots() {}
 551 
 552   virtual void work() {

 553     ZVerifyOopClosure cl;
 554     _strong_roots.oops_do(&cl);
 555     _weak_roots.oops_do(&cl);
 556   }
 557 };
 558 
 559 void ZHeap::verify() {
 560   // Heap verification can only be done between mark end and
 561   // relocate start. This is the only window where all oop are
 562   // good and the whole heap is in a consistent state.
 563   guarantee(ZGlobalPhase == ZPhaseMarkCompleted, "Invalid phase");
 564 
 565   {
 566     ZVerifyRootsTask task;
 567     _workers.run_parallel(&task);
 568   }
 569 
 570   {
 571     ZVerifyObjectClosure cl;
 572     object_iterate(&cl, false /* visit_referents */);


 523   print_on(st);
 524   st->cr();
 525 
 526   // Do not allow pages to be deleted
 527   _page_allocator.enable_deferred_delete();
 528 
 529   // Print all pages
 530   ZPageTableIterator iter(&_page_table);
 531   for (ZPage* page; iter.next(&page);) {
 532     page->print_on(st);
 533   }
 534 
 535   // Allow pages to be deleted
 536   _page_allocator.enable_deferred_delete();
 537 
 538   st->cr();
 539 }
 540 
 541 class ZVerifyRootsTask : public ZTask {
 542 private:
 543   ZStatTimerDisable  _disable;
 544   ZRootsIterator     _strong_roots;
 545   ZWeakRootsIterator _weak_roots;
 546 
 547 public:
 548   ZVerifyRootsTask() :
 549       ZTask("ZVerifyRootsTask"),
 550       _disable(),
 551       _strong_roots(),
 552       _weak_roots() {}
 553 
 554   virtual void work() {
 555     ZStatTimerDisable disable;
 556     ZVerifyOopClosure cl;
 557     _strong_roots.oops_do(&cl);
 558     _weak_roots.oops_do(&cl);
 559   }
 560 };
 561 
 562 void ZHeap::verify() {
 563   // Heap verification can only be done between mark end and
 564   // relocate start. This is the only window where all oop are
 565   // good and the whole heap is in a consistent state.
 566   guarantee(ZGlobalPhase == ZPhaseMarkCompleted, "Invalid phase");
 567 
 568   {
 569     ZVerifyRootsTask task;
 570     _workers.run_parallel(&task);
 571   }
 572 
 573   {
 574     ZVerifyObjectClosure cl;
 575     object_iterate(&cl, false /* visit_referents */);
< prev index next >