< prev index next >

src/hotspot/share/oops/markWord.cpp

Print this page
@@ -70,10 +70,11 @@
  void markWord::print_on(outputStream* st, bool print_monitor_info) const {
    if (is_marked()) {  // last bits = 11
      st->print(" marked(" INTPTR_FORMAT ")", value());
    } else if (has_monitor()) {  // last bits = 10
      // have to check has_monitor() before is_locked()
+     // Valhalla: inline types/arrays can't be monitored
      st->print(" monitor(" INTPTR_FORMAT ")=", value());
      if (print_monitor_info && !UseObjectMonitorTable) {
        ObjectMonitor* mon = monitor();
        if (mon == nullptr) {
          st->print("null (this should never be seen!)");

@@ -81,21 +82,54 @@
          mon->print_on(st);
        }
      }
    } else if (is_locked()) {  // last bits != 01 => 00
      // thin locked
+     // Valhalla: inline types can not possess an object monitor
      st->print(" locked(" INTPTR_FORMAT ")", value());
    } else {
      st->print(" mark(");
      if (is_unlocked()) {   // last bits = 01
        st->print("is_unlocked");
+       if (is_inline_type()) {
+         st->print(" inline_type");
+         if (is_larval_state()) {
+           st->print("=larval");
+         }
+       }
        if (has_no_hash()) {
          st->print(" no_hash");
        } else {
          st->print(" hash=" INTPTR_FORMAT, hash());
        }
+ #ifdef _LP64 // 64 bit encodings have array information
+       // flat or null-free do not imply each other
+       bool flat = is_flat_array();
+       bool null_free = is_null_free_array();
+       if (flat && !null_free) {
+         st->print(" flat_array");
+       } else if (!flat && null_free) {
+         st->print(" null_free_array");
+       } else if (flat && null_free) {
+         st->print(" flat_null_free_array");
+       }
+ #endif
      } else {
        st->print("??");
      }
      st->print(" age=%d)", age());
    }
  }
+ 
+ markWord markWord::flat_array_prototype(LayoutKind lk) {
+   switch(lk) {
+     case LayoutKind::ATOMIC_FLAT:
+     case LayoutKind::NON_ATOMIC_FLAT:
+       return markWord(null_free_flat_array_pattern);
+       break;
+     case LayoutKind::NULLABLE_ATOMIC_FLAT:
+       return markWord(nullable_flat_array_pattern);
+       break;
+     default:
+       ShouldNotReachHere();
+   }
+ }
< prev index next >