< prev index next >

src/hotspot/share/oops/compressedKlass.hpp

Print this page
*** 105,11 ***
    // We use a different narrow Klass pointer geometry depending on
    // whether we run in standard mode or in compact-object-header-mode.
  
    // Narrow klass pointer bits for an unshifted narrow Klass pointer.
    static constexpr int narrow_klass_pointer_bits_noncoh = 32;
!   static constexpr int narrow_klass_pointer_bits_coh = 22;
  
    // Bit size of a narrowKlass
    static int _narrow_klass_pointer_bits;
  
    // The maximum shift values we can use depending on UseCompactObjectHeaders
--- 105,11 ---
    // We use a different narrow Klass pointer geometry depending on
    // whether we run in standard mode or in compact-object-header-mode.
  
    // Narrow klass pointer bits for an unshifted narrow Klass pointer.
    static constexpr int narrow_klass_pointer_bits_noncoh = 32;
!   static constexpr int narrow_klass_pointer_bits_coh = 19;
  
    // Bit size of a narrowKlass
    static int _narrow_klass_pointer_bits;
  
    // The maximum shift values we can use depending on UseCompactObjectHeaders

*** 184,12 ***
    static int narrow_klass_pointer_bits() { check_init(_narrow_klass_pointer_bits); return _narrow_klass_pointer_bits; }
  
    // The maximum possible shift; the actual shift employed later can be smaller (see initialize())
    static int max_shift()                 { check_init(_max_shift); return _max_shift; }
  
!   // Returns the maximum allowed klass range size. It is calculated from the length of the encoding range
!   // resulting from the current encoding settings (base, shift), capped to a certain max. value.
    static size_t max_klass_range_size();
  
    // Reserve a range of memory that is to contain Klass strucutures which are referenced by narrow Klass IDs.
    // If optimize_for_zero_base is true, the implementation will attempt to reserve optimized for zero-based encoding.
    static char* reserve_address_space_for_compressed_classes(size_t size, bool aslr, bool optimize_for_zero_base);
--- 184,17 ---
    static int narrow_klass_pointer_bits() { check_init(_narrow_klass_pointer_bits); return _narrow_klass_pointer_bits; }
  
    // The maximum possible shift; the actual shift employed later can be smaller (see initialize())
    static int max_shift()                 { check_init(_max_shift); return _max_shift; }
  
!   // Returns the maximum encoding range, given the current geometry (narrow klass bit size and shift)
!   static size_t max_encoding_range_size() { return nth_bit(narrow_klass_pointer_bits() + max_shift()); }
+ 
+   // For use before pre-initialization
+   static constexpr size_t max_klass_range_size_coh = nth_bit(narrow_klass_pointer_bits_coh + max_shift_coh);
+ 
+   // Returns the maximum allowed klass range size.
    static size_t max_klass_range_size();
  
    // Reserve a range of memory that is to contain Klass strucutures which are referenced by narrow Klass IDs.
    // If optimize_for_zero_base is true, the implementation will attempt to reserve optimized for zero-based encoding.
    static char* reserve_address_space_for_compressed_classes(size_t size, bool aslr, bool optimize_for_zero_base);
< prev index next >