RFR: 8338658: New Object to ObjectMonitor mapping: s390x implementation [v2]

Axel Boldt-Christmas aboldtch at openjdk.org
Mon Sep 9 07:08:06 UTC 2024


On Sat, 7 Sep 2024 14:13:00 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> There are 8 cache entries, and a null sentinel at the end. All entries can be null. 
>> 
>> So the answer is no we can not be sure about that as one, two or three of the first three entries may be null. But I am not sure what the reason is for this question.
>> 
>> The non-empty/non-null entries always comes first, followed by the null entries if any, followed by a null sentinel. The unrolled entries do not check for null, only for a match. The loop will check the rest of the entries and go to a slow path when a null entry (or the null sentinel) is encountered.
>
> @xmas92: Can the 1st entry be 0 and the 2nd one contain garbage which matches the object by chance?

No, the oops in the cache are either valid entries or null. They may be stale, as in the monitor has been deflated, but that will cause the slow path to be taken and the cache entry is replaced inside the runtime call.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20740#discussion_r1749678277


More information about the hotspot-dev mailing list