< prev index next >

src/hotspot/share/oops/arrayOop.hpp

Print this page
@@ -24,10 +24,11 @@
  
  #ifndef SHARE_OOPS_ARRAYOOP_HPP
  #define SHARE_OOPS_ARRAYOOP_HPP
  
  #include "oops/oop.hpp"
+ #include "runtime/globals.hpp"
  #include "utilities/align.hpp"
  #include "utilities/globalDefinitions.hpp"
  
  // arrayOopDesc is the abstract baseclass for all arrays.  It doesn't
  // declare pure virtual to enforce this because that would allocate a vtbl

@@ -53,10 +54,13 @@
      return reinterpret_cast<int*>(ptr + length_offset_in_bytes());
    }
  
    // Given a type, return true if elements of that type must be aligned to 64-bit.
    static bool element_type_should_be_aligned(BasicType type) {
+     if (type == T_FLAT_ELEMENT) {
+       return true; //CMH: tighten the alignment when removing T_FLAT_ELEMENT
+     }
  #ifdef _LP64
      if (type == T_OBJECT || type == T_ARRAY) {
        return !UseCompressedOops;
      }
  #endif

@@ -129,10 +133,11 @@
    // to typeArrayOop::object_size(scale, length, header_size) without causing an
    // overflow. We also need to make sure that this will not overflow a size_t on
    // 32 bit platforms when we convert it to a byte size.
    static int32_t max_array_length(BasicType type) {
      assert(type < T_CONFLICT, "wrong type");
+     assert(type != T_FLAT_ELEMENT, "wrong type");
      assert(type2aelembytes(type) != 0, "wrong type");
  
      int hdr_size_in_bytes = base_offset_in_bytes(type);
      // This is rounded-up and may overlap with the first array elements.
      int hdr_size_in_words = align_up(hdr_size_in_bytes, HeapWordSize) / HeapWordSize;

@@ -149,8 +154,9 @@
        return align_down(max_jint - hdr_size_in_words, MinObjAlignment);
      }
      return (int32_t)max_elements_per_size_t;
    }
  
+   inline bool is_null_free_array() const;
  };
  
  #endif // SHARE_OOPS_ARRAYOOP_HPP
< prev index next >