< prev index next >

src/hotspot/share/oops/arrayOop.hpp

Print this page
@@ -73,18 +73,20 @@
      // make sure it isn't called before UseCompressedOops is initialized.
      static int arrayoopdesc_hs = 0;
      if (arrayoopdesc_hs == 0) arrayoopdesc_hs = hs;
      assert(arrayoopdesc_hs == hs, "header size can't change");
  #endif // ASSERT
+     assert(!UseCompactObjectHeaders || hs == 8, "array header must be 8 bytes");
      return (int)hs;
    }
  
    // The _length field is not declared in C++.  It is allocated after the
    // mark-word when using compact headers (+UseCompactObjectHeaders), otherwise
    // after the compressed Klass* when running with compressed class-pointers
    // (+UseCompressedClassPointers), or else after the full Klass*.
    static int length_offset_in_bytes() {
+     assert(!UseCompactObjectHeaders || oopDesc::base_offset_in_bytes() == 4, "array length must be at 4 bytes");
      return oopDesc::base_offset_in_bytes();
    }
  
    // Returns the offset of the first element.
    static int base_offset_in_bytes(BasicType type) {
< prev index next >