< prev index next >

src/share/vm/gc_implementation/g1/heapRegionSet.cpp

Print this page
rev 7746 : 8058354: SPECjvm2008-Derby -2.7% performance regression on Solaris-X64 starting with 9-b29
Summary: Allow partial use of large pages for auxiliary data structures in G1.
Reviewed-by:


 403   } else {
 404     guarantee(Heap_lock->owned_by_self(),
 405               "master humongous set MT safety protocol outside a safepoint");
 406   }
 407 }
 408 
 409 void FreeRegionList_test() {
 410   FreeRegionList l("test");
 411 
 412   const uint num_regions_in_test = 5;
 413   // Create a fake heap. It does not need to be valid, as the HeapRegion constructor
 414   // does not access it.
 415   MemRegion heap(NULL, num_regions_in_test * HeapRegion::GrainWords);
 416   // Allocate a fake BOT because the HeapRegion constructor initializes
 417   // the BOT.
 418   size_t bot_size = G1BlockOffsetSharedArray::compute_size(heap.word_size());
 419   HeapWord* bot_data = NEW_C_HEAP_ARRAY(HeapWord, bot_size, mtGC);
 420   ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(heap.word_size()));
 421   G1RegionToSpaceMapper* bot_storage =
 422     G1RegionToSpaceMapper::create_mapper(bot_rs,

 423                                          os::vm_page_size(),
 424                                          HeapRegion::GrainBytes,
 425                                          G1BlockOffsetSharedArray::N_bytes,
 426                                          mtGC);
 427   G1BlockOffsetSharedArray oa(heap, bot_storage);
 428   bot_storage->commit_regions(0, num_regions_in_test);
 429 
 430   // Set up memory regions for the heap regions.
 431   MemRegion mr0(heap.start(), HeapRegion::GrainWords);
 432   MemRegion mr1(mr0.end(), HeapRegion::GrainWords);
 433   MemRegion mr2(mr1.end(), HeapRegion::GrainWords);
 434   MemRegion mr3(mr2.end(), HeapRegion::GrainWords);
 435   MemRegion mr4(mr3.end(), HeapRegion::GrainWords);
 436 
 437   HeapRegion hr0(0, &oa, mr0);
 438   HeapRegion hr1(1, &oa, mr1);
 439   HeapRegion hr2(2, &oa, mr2);
 440   HeapRegion hr3(3, &oa, mr3);
 441   HeapRegion hr4(4, &oa, mr4);
 442   l.add_ordered(&hr1);


 403   } else {
 404     guarantee(Heap_lock->owned_by_self(),
 405               "master humongous set MT safety protocol outside a safepoint");
 406   }
 407 }
 408 
 409 void FreeRegionList_test() {
 410   FreeRegionList l("test");
 411 
 412   const uint num_regions_in_test = 5;
 413   // Create a fake heap. It does not need to be valid, as the HeapRegion constructor
 414   // does not access it.
 415   MemRegion heap(NULL, num_regions_in_test * HeapRegion::GrainWords);
 416   // Allocate a fake BOT because the HeapRegion constructor initializes
 417   // the BOT.
 418   size_t bot_size = G1BlockOffsetSharedArray::compute_size(heap.word_size());
 419   HeapWord* bot_data = NEW_C_HEAP_ARRAY(HeapWord, bot_size, mtGC);
 420   ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(heap.word_size()));
 421   G1RegionToSpaceMapper* bot_storage =
 422     G1RegionToSpaceMapper::create_mapper(bot_rs,
 423                                          bot_rs.size(),
 424                                          os::vm_page_size(),
 425                                          HeapRegion::GrainBytes,
 426                                          G1BlockOffsetSharedArray::N_bytes,
 427                                          mtGC);
 428   G1BlockOffsetSharedArray oa(heap, bot_storage);
 429   bot_storage->commit_regions(0, num_regions_in_test);
 430 
 431   // Set up memory regions for the heap regions.
 432   MemRegion mr0(heap.start(), HeapRegion::GrainWords);
 433   MemRegion mr1(mr0.end(), HeapRegion::GrainWords);
 434   MemRegion mr2(mr1.end(), HeapRegion::GrainWords);
 435   MemRegion mr3(mr2.end(), HeapRegion::GrainWords);
 436   MemRegion mr4(mr3.end(), HeapRegion::GrainWords);
 437 
 438   HeapRegion hr0(0, &oa, mr0);
 439   HeapRegion hr1(1, &oa, mr1);
 440   HeapRegion hr2(2, &oa, mr2);
 441   HeapRegion hr3(3, &oa, mr3);
 442   HeapRegion hr4(4, &oa, mr4);
 443   l.add_ordered(&hr1);
< prev index next >