< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.cpp

Print this page




 728 
 729     }
 730 
 731     // Mark each G1 region touched by the range as archive, add it to
 732     // the old set, and set the allocation context and top.
 733     HeapRegion* curr_region = _hrm.addr_to_region(start_address);
 734     HeapRegion* last_region = _hrm.addr_to_region(last_address);
 735     prev_last_region = last_region;
 736 
 737     while (curr_region != NULL) {
 738       assert(curr_region->is_empty() && !curr_region->is_pinned(),
 739              "Region already in use (index %u)", curr_region->hrm_index());
 740       curr_region->set_allocation_context(AllocationContext::system());
 741       if (open) {
 742         curr_region->set_open_archive();
 743       } else {
 744         curr_region->set_closed_archive();
 745       }
 746       _hr_printer.alloc(curr_region);
 747       _old_set.add(curr_region);


 748       if (curr_region != last_region) {
 749         HeapWord* top = curr_region->end();
 750         curr_region->set_top(top);
 751         curr_region->set_first_dead(top);
 752         curr_region->set_end_of_live(top);
 753         curr_region = _hrm.next_region_in_heap(curr_region);
 754       } else {
 755         HeapWord* top = last_address + 1;


 756         curr_region->set_top(top);
 757         curr_region->set_first_dead(top);
 758         curr_region->set_end_of_live(top);
 759         curr_region = NULL;
 760       }
 761     }
 762 
 763     // Notify mark-sweep of the archive
 764     G1ArchiveAllocator::set_range_archive(curr_range, open);
 765   }
 766   return true;
 767 }
 768 
 769 void G1CollectedHeap::fill_archive_regions(MemRegion* ranges, size_t count) {
 770   assert(!is_init_completed(), "Expect to be called at JVM init time");
 771   assert(ranges != NULL, "MemRegion array NULL");
 772   assert(count != 0, "No MemRegions provided");
 773   MemRegion reserved = _hrm.reserved();
 774   HeapWord *prev_last_addr = NULL;
 775   HeapRegion* prev_last_region = NULL;
 776 
 777   // For each MemRegion, create filler objects, if needed, in the G1 regions
 778   // that contain the address range. The address range actually within the
 779   // MemRegion will not be modified. That is assumed to have been initialized
 780   // elsewhere, probably via an mmap of archived heap data.




 728 
 729     }
 730 
 731     // Mark each G1 region touched by the range as archive, add it to
 732     // the old set, and set the allocation context and top.
 733     HeapRegion* curr_region = _hrm.addr_to_region(start_address);
 734     HeapRegion* last_region = _hrm.addr_to_region(last_address);
 735     prev_last_region = last_region;
 736 
 737     while (curr_region != NULL) {
 738       assert(curr_region->is_empty() && !curr_region->is_pinned(),
 739              "Region already in use (index %u)", curr_region->hrm_index());
 740       curr_region->set_allocation_context(AllocationContext::system());
 741       if (open) {
 742         curr_region->set_open_archive();
 743       } else {
 744         curr_region->set_closed_archive();
 745       }
 746       _hr_printer.alloc(curr_region);
 747       _old_set.add(curr_region);
 748       HeapWord* top;
 749       HeapRegion* next_region;
 750       if (curr_region != last_region) {
 751         top = curr_region->end();
 752         next_region = _hrm.next_region_in_heap(curr_region);



 753       } else {
 754         top = last_address + 1;
 755         next_region = NULL;
 756       }
 757       curr_region->set_top(top);
 758       curr_region->set_first_dead(top);
 759       curr_region->set_end_of_live(top);
 760       curr_region = next_region;

 761     }
 762 
 763     // Notify mark-sweep of the archive
 764     G1ArchiveAllocator::set_range_archive(curr_range, open);
 765   }
 766   return true;
 767 }
 768 
 769 void G1CollectedHeap::fill_archive_regions(MemRegion* ranges, size_t count) {
 770   assert(!is_init_completed(), "Expect to be called at JVM init time");
 771   assert(ranges != NULL, "MemRegion array NULL");
 772   assert(count != 0, "No MemRegions provided");
 773   MemRegion reserved = _hrm.reserved();
 774   HeapWord *prev_last_addr = NULL;
 775   HeapRegion* prev_last_region = NULL;
 776 
 777   // For each MemRegion, create filler objects, if needed, in the G1 regions
 778   // that contain the address range. The address range actually within the
 779   // MemRegion will not be modified. That is assumed to have been initialized
 780   // elsewhere, probably via an mmap of archived heap data.


< prev index next >