[lworld] RFR: 8255396: [lworld] locking breaks oopDesc is_flatArray/is_nullfreeArray type checks
Sergey Kuksenko
sergey.kuksenko at oracle.com
Mon Oct 26 16:53:28 UTC 2020
I have a question about the following methods from markWord.hpp:
bool is_locked()const {
return (mask_bits(value(),lock_mask_in_place) !=unlocked_value);
}
bool is_unlocked()const {
return (mask_bits(value(),biased_lock_mask_in_place) ==unlocked_value);
}
First of all these methods are not symmetrical. "lock_mask_in_place"==0x011 when "biased_lock_mask_in_place"==0x111.
The second. If we invoke is_unlocked() on inline/primitive object we get "false". is_locked() on inline also gives "false".
I am not sure if may cause an error, maybe all such checks are preguarded with is_inline_type().
The third. Valhalla can't work with BiasedLocking. I think it would be better to remove all usage of BiasedLocking constant in Valhalla to avoid errors. As far as I understand, BiasedLocking has became "obsolete" in jdk16.
That means:
// When the JDK version reaches 'obsolete_in' limit, the JVM will
continue accepting this flag on // the command-line, while issuing a
warning and ignoring the flag value.
So, now BasedLocking can't be turn on in mainline jdk. To simplify
merging, maybe make sense to remove biased locking constants and masks
in mainline jdk.
On 10/26/20 7:23 AM, David Simms wrote:
> Added unlocked test and fallback to klass
>
> -------------
>
> Commit messages:
> - 8255396: [lworld] locking breaks oopDesc is_flatArray/is_nullfreeArray type checks
>
> Changes: https://git.openjdk.java.net/valhalla/pull/238/files
> Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=238&range=00
> Issue: https://bugs.openjdk.java.net/browse/JDK-8255396
> Stats: 36 lines in 2 files changed: 33 ins; 1 del; 2 mod
> Patch: https://git.openjdk.java.net/valhalla/pull/238.diff
> Fetch: git fetch https://git.openjdk.java.net/valhalla pull/238/head:pull/238
>
> PR: https://git.openjdk.java.net/valhalla/pull/238
More information about the valhalla-dev
mailing list