RFR: 8319773: Avoid inflating monitors when installing hash codes for LM_LIGHTWEIGHT [v4]

David Holmes dholmes at openjdk.org
Mon Nov 20 05:57:53 UTC 2023


On Fri, 17 Nov 2023 08:00:07 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> There probably is some history here I am unaware of. But to me only one should exist, or the neutral property's meaning needs to be explained in the markWord.hpp file so it is clear what makes it distinct from unlocked.

There is no distinction and there never has been. The `is_neutral` came in with some backend performance enhancements related to adaptive spinning, around the same time that biased-locking was introduced. The work was done by two different engineers. The code in synchronizer.cpp only used `is_neutral` not `is_unlocked`. But the two functions have always had identical definitions. We should get rid of `is_neutral`, but probably not in this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16603#discussion_r1398691377


More information about the hotspot-dev mailing list