< prev index next >

src/hotspot/share/memory/universe.cpp

Print this page
@@ -317,12 +317,17 @@
  void Universe::genesis(TRAPS) {
    ResourceMark rm(THREAD);
    HandleMark   hm(THREAD);
  
    // Explicit null checks are needed if these offsets are not smaller than the page size
-   assert(oopDesc::klass_offset_in_bytes() < static_cast<intptr_t>(os::vm_page_size()),
-          "Klass offset is expected to be less than the page size");
+   if (UseCompactObjectHeaders) {
+     assert(oopDesc::mark_offset_in_bytes() < static_cast<intptr_t>(os::vm_page_size()),
+            "Mark offset is expected to be less than the page size");
+   } else {
+     assert(oopDesc::klass_offset_in_bytes() < static_cast<intptr_t>(os::vm_page_size()),
+            "Klass offset is expected to be less than the page size");
+   }
    assert(arrayOopDesc::length_offset_in_bytes() < static_cast<intptr_t>(os::vm_page_size()),
           "Array length offset is expected to be less than the page size");
  
    { AutoModifyRestore<bool> temporarily(_bootstrapping, true);
  
< prev index next >