diff -r 88c1272e94d3 -r 28c707fe71ce hotspot/src/share/vm/oops/oop.inline.hpp --- a/hotspot/src/share/vm/oops/oop.inline.hpp Fri Sep 23 13:44:01 2016 -0700 +++ b/hotspot/src/share/vm/oops/oop.inline.hpp Fri Sep 23 18:23:12 2016 -0400 @@ -109,7 +109,6 @@ } Klass* oopDesc::klass_or_null() const volatile { - // can be NULL in CMS if (UseCompressedClassPointers) { return Klass::decode_klass(_metadata._compressed_klass); } else { @@ -117,6 +116,17 @@ } } +Klass* oopDesc::klass_or_null_acquire() const volatile { + if (UseCompressedClassPointers) { + // Workaround for non-const load_acquire parameter. + const volatile narrowKlass* addr = &_metadata._compressed_klass; + volatile narrowKlass* xaddr = const_cast(addr); + return Klass::decode_klass(OrderAccess::load_acquire(xaddr)); + } else { + return (Klass*)OrderAccess::load_ptr_acquire(&_metadata._klass); + } +} + Klass** oopDesc::klass_addr() { // Only used internally and with CMS and will not work with // UseCompressedOops