< prev index next >

src/hotspot/share/oops/instanceOop.hpp

Print this page
@@ -31,19 +31,19 @@
  // An instanceOop is an instance of a Java Class
  // Evaluating "new HashTable()" will create an instanceOop.
  
  class instanceOopDesc : public oopDesc {
   public:
-   // aligned header size.
-   static int header_size() { return sizeof(instanceOopDesc)/HeapWordSize; }
- 
    // If compressed, the offset of the fields of the instance may not be aligned.
    static int base_offset_in_bytes() {
-     return (UseCompressedClassPointers) ?
-             klass_gap_offset_in_bytes() :
-             sizeof(instanceOopDesc);
- 
+     if (UseCompactObjectHeaders) {
+       return oopDesc::base_offset_in_bytes();
+     } else if (UseCompressedClassPointers) {
+       return klass_gap_offset_in_bytes();
+     } else {
+       return sizeof(instanceOopDesc);
+     }
    }
  };
  
  // See similar requirement for oopDesc.
  static_assert(std::is_trivially_default_constructible<instanceOopDesc>::value, "required");
< prev index next >