< prev index next >

src/hotspot/share/memory/universe.cpp

Print this page
rev 48019 : 8191821: Finer granularity for GC verification
Reviewed-by:


 751 // Unscaled  - Use 32-bits oops without encoding when
 752 //     NarrowOopHeapBaseMin + heap_size < 4Gb
 753 // ZeroBased - Use zero based compressed oops with encoding when
 754 //     NarrowOopHeapBaseMin + heap_size < 32Gb
 755 // HeapBased - Use compressed oops with heap base + encoding.
 756 
 757 jint Universe::initialize_heap() {
 758   jint status = JNI_ERR;
 759 
 760   _collectedHeap = create_heap_ext();
 761   if (_collectedHeap == NULL) {
 762     _collectedHeap = create_heap();
 763   }
 764 
 765   status = _collectedHeap->initialize();
 766   if (status != JNI_OK) {
 767     return status;
 768   }
 769   log_info(gc)("Using %s", _collectedHeap->name());
 770 

 771   ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size());
 772 
 773 #ifdef _LP64
 774   if (UseCompressedOops) {
 775     // Subtract a page because something can get allocated at heap base.
 776     // This also makes implicit null checking work, because the
 777     // memory+1 page below heap_base needs to cause a signal.
 778     // See needs_explicit_null_check.
 779     // Only set the heap base for compressed oops because it indicates
 780     // compressed oops for pstack code.
 781     if ((uint64_t)Universe::heap()->reserved_region().end() > UnscaledOopHeapMax) {
 782       // Didn't reserve heap below 4Gb.  Must shift.
 783       Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
 784     }
 785     if ((uint64_t)Universe::heap()->reserved_region().end() <= OopEncodingHeapMax) {
 786       // Did reserve heap below 32Gb. Can use base == 0;
 787       Universe::set_narrow_oop_base(0);
 788     }
 789 
 790     Universe::set_narrow_ptrs_base(Universe::narrow_oop_base());




 751 // Unscaled  - Use 32-bits oops without encoding when
 752 //     NarrowOopHeapBaseMin + heap_size < 4Gb
 753 // ZeroBased - Use zero based compressed oops with encoding when
 754 //     NarrowOopHeapBaseMin + heap_size < 32Gb
 755 // HeapBased - Use compressed oops with heap base + encoding.
 756 
 757 jint Universe::initialize_heap() {
 758   jint status = JNI_ERR;
 759 
 760   _collectedHeap = create_heap_ext();
 761   if (_collectedHeap == NULL) {
 762     _collectedHeap = create_heap();
 763   }
 764 
 765   status = _collectedHeap->initialize();
 766   if (status != JNI_OK) {
 767     return status;
 768   }
 769   log_info(gc)("Using %s", _collectedHeap->name());
 770 
 771   GCArguments::arguments()->post_heap_initialize();
 772   ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size());
 773 
 774 #ifdef _LP64
 775   if (UseCompressedOops) {
 776     // Subtract a page because something can get allocated at heap base.
 777     // This also makes implicit null checking work, because the
 778     // memory+1 page below heap_base needs to cause a signal.
 779     // See needs_explicit_null_check.
 780     // Only set the heap base for compressed oops because it indicates
 781     // compressed oops for pstack code.
 782     if ((uint64_t)Universe::heap()->reserved_region().end() > UnscaledOopHeapMax) {
 783       // Didn't reserve heap below 4Gb.  Must shift.
 784       Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
 785     }
 786     if ((uint64_t)Universe::heap()->reserved_region().end() <= OopEncodingHeapMax) {
 787       // Did reserve heap below 32Gb. Can use base == 0;
 788       Universe::set_narrow_oop_base(0);
 789     }
 790 
 791     Universe::set_narrow_ptrs_base(Universe::narrow_oop_base());


< prev index next >