hotspot/src/share/vm/ci/ciField.cpp
changeset 33483 5b7dd5bd7c5c
parent 31519 bb26c50aadd0
child 35758 6109e2e1e1de
equal deleted inserted replaced
33480:e4cef6796874 33483:5b7dd5bd7c5c
   188     return true;
   188     return true;
   189   // Trust VM anonymous classes. They are private API (sun.misc.Unsafe) and can't be serialized,
   189   // Trust VM anonymous classes. They are private API (sun.misc.Unsafe) and can't be serialized,
   190   // so there is no hacking of finals going on with them.
   190   // so there is no hacking of finals going on with them.
   191   if (holder->is_anonymous())
   191   if (holder->is_anonymous())
   192     return true;
   192     return true;
       
   193   // Trust Atomic*FieldUpdaters: they are very important for performance, and make up one
       
   194   // more reason not to use Unsafe, if their final fields are trusted. See more in JDK-8140483.
       
   195   if (holder->name() == ciSymbol::java_util_concurrent_atomic_AtomicIntegerFieldUpdater_Impl() ||
       
   196       holder->name() == ciSymbol::java_util_concurrent_atomic_AtomicLongFieldUpdater_CASUpdater() ||
       
   197       holder->name() == ciSymbol::java_util_concurrent_atomic_AtomicLongFieldUpdater_LockedUpdater() ||
       
   198       holder->name() == ciSymbol::java_util_concurrent_atomic_AtomicReferenceFieldUpdater_Impl()) {
       
   199     return true;
       
   200   }
   193   return TrustFinalNonStaticFields;
   201   return TrustFinalNonStaticFields;
   194 }
   202 }
   195 
   203 
   196 void ciField::initialize_from(fieldDescriptor* fd) {
   204 void ciField::initialize_from(fieldDescriptor* fd) {
   197   // Get the flags, offset, and canonical holder of the field.
   205   // Get the flags, offset, and canonical holder of the field.