< prev index next >

src/hotspot/share/oops/oop.inline.hpp

Print this page
rev 48545 : Value-based classes (vbc) / Oop value test via metadata ptr

@@ -93,10 +93,20 @@
 narrowKlass* oopDesc::compressed_klass_addr() {
   assert(UseCompressedClassPointers, "only called by compressed klass pointers");
   return &_metadata._compressed_klass;
 }
 
+#if INCLUDE_VBC // fast oop only test (does not load klass)
+bool oopDesc::klass_is_value_based() {
+        if (UseCompressedClassPointers) {
+                return Klass::decode_ptr_is_value_based(_metadata._compressed_klass);
+        } else {
+                return Klass::ptr_is_value_based(_metadata._klass);
+        }
+}
+#endif
+
 #define CHECK_SET_KLASS(k)                                                \
   do {                                                                    \
     assert(Universe::is_bootstrapping() || k != NULL, "NULL Klass");      \
     assert(Universe::is_bootstrapping() || k->is_klass(), "not a Klass"); \
   } while (0)
< prev index next >