[lworld] RFR: 8247299: [lworld] Disable UseBiasedLocking by default

Sergey Kuksenko skuksenko at openjdk.java.net
Thu Oct 22 17:22:25 UTC 2020


On Tue, 20 Oct 2020 18:30:33 GMT, Frederic Parain <fparain at openjdk.org> wrote:

>> Disabled UseBiasedLocking, and reorganized markWord to serve Valhalla requirements (see also JDK-8247298 for motivation).
>> 
>> Actual UseBiasedLocking code remains simply to avoid future conflicts. Since static constants have changed and UseBiasedLocking is deprecated, Valhalla assumes it will be removed, and it is not only disabled "by default", but now unusable.
>> 
>> Tier1-3 testing clean
>
> Looks good to me.
> 
> Fred

Comment. It won't work for arrays properly.
file: oop.inline.hpp  line 207
-  bool oopDesc::is_flatArray() const { return klass()->is_flatArray_klass(); }
+ bool oopDesc::is_flatArray()     const { return mark().is_flat_array(); }

Array maybe locked. So is_flatArray should be like this:
bool oopDesc::is_flatArray()     const { 
  if(mark().is_unlocked()) {
     return mark().is_flat_array(); 
  } else {
     return klass()->is_flatArray_klass();
  }
}

-------------

PR: https://git.openjdk.java.net/valhalla/pull/234



More information about the valhalla-dev mailing list