src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
changeset 54890 f2f11d7f7f4e
parent 54882 b99e97bc5040
child 54924 ba1eccda5450
equal deleted inserted replaced
54889:53d51822f287 54890:f2f11d7f7f4e
    52 #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
    52 #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
    53 #include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
    53 #include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
    54 #include "gc/shenandoah/shenandoahPacer.inline.hpp"
    54 #include "gc/shenandoah/shenandoahPacer.inline.hpp"
    55 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
    55 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
    56 #include "gc/shenandoah/shenandoahStringDedup.hpp"
    56 #include "gc/shenandoah/shenandoahStringDedup.hpp"
       
    57 #include "gc/shenandoah/shenandoahTaskqueue.hpp"
    57 #include "gc/shenandoah/shenandoahUtils.hpp"
    58 #include "gc/shenandoah/shenandoahUtils.hpp"
    58 #include "gc/shenandoah/shenandoahVerifier.hpp"
    59 #include "gc/shenandoah/shenandoahVerifier.hpp"
    59 #include "gc/shenandoah/shenandoahCodeRoots.hpp"
    60 #include "gc/shenandoah/shenandoahCodeRoots.hpp"
    60 #include "gc/shenandoah/shenandoahVMOperations.hpp"
    61 #include "gc/shenandoah/shenandoahVMOperations.hpp"
    61 #include "gc/shenandoah/shenandoahWorkGroup.hpp"
    62 #include "gc/shenandoah/shenandoahWorkGroup.hpp"
   183   _heap_region = MemRegion((HeapWord*)heap_rs.base(), heap_rs.size() / HeapWordSize);
   184   _heap_region = MemRegion((HeapWord*)heap_rs.base(), heap_rs.size() / HeapWordSize);
   184   _heap_region_special = heap_rs.special();
   185   _heap_region_special = heap_rs.special();
   185 
   186 
   186   assert((((size_t) base()) & ShenandoahHeapRegion::region_size_bytes_mask()) == 0,
   187   assert((((size_t) base()) & ShenandoahHeapRegion::region_size_bytes_mask()) == 0,
   187          "Misaligned heap: " PTR_FORMAT, p2i(base()));
   188          "Misaligned heap: " PTR_FORMAT, p2i(base()));
       
   189 
       
   190 #if SHENANDOAH_OPTIMIZED_OBJTASK
       
   191   // The optimized ObjArrayChunkedTask takes some bits away from the full object bits.
       
   192   // Fail if we ever attempt to address more than we can.
       
   193   if ((uintptr_t)heap_rs.end() >= ObjArrayChunkedTask::max_addressable()) {
       
   194     FormatBuffer<512> buf("Shenandoah reserved [" PTR_FORMAT ", " PTR_FORMAT") for the heap, \n"
       
   195                           "but max object address is " PTR_FORMAT ". Try to reduce heap size, or try other \n"
       
   196                           "VM options that allocate heap at lower addresses (HeapBaseMinAddress, AllocateHeapAt, etc).",
       
   197                 p2i(heap_rs.base()), p2i(heap_rs.end()), ObjArrayChunkedTask::max_addressable());
       
   198     vm_exit_during_initialization("Fatal Error", buf);
       
   199   }
       
   200 #endif
   188 
   201 
   189   ReservedSpace sh_rs = heap_rs.first_part(max_byte_size);
   202   ReservedSpace sh_rs = heap_rs.first_part(max_byte_size);
   190   if (!_heap_region_special) {
   203   if (!_heap_region_special) {
   191     os::commit_memory_or_exit(sh_rs.base(), _initial_size, heap_alignment, false,
   204     os::commit_memory_or_exit(sh_rs.base(), _initial_size, heap_alignment, false,
   192                               "Cannot commit heap memory");
   205                               "Cannot commit heap memory");