[master] RFR: OMWorld: Cleanups [v2]

Axel Boldt-Christmas aboldtch at openjdk.org
Tue May 28 08:14:21 UTC 2024


On Fri, 24 May 2024 17:52:35 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Maybe I should say `valid ObjectMonitor* check` instead of `null check`. 
>> 
>> The reason that the check used to be against `2` is because some iterations of the code have signalled information in the lowest bit. 
>> 
>> Currently it could just be a check agains `1` which would check for `nullptr` while also setting Flags to NE. 
>> 
>> The check is simply that based on the fact that no valid ObjectMonitor* except nullptr can exist below `alignof(ObjectMonitor*)`.
>
> But in the current code now, the field should be either nullptr or a valid ObjectMonitor, right?  If you simply checked against nullptr, would it set the NE flags?  All the extra casting etc makes this a puzzler where testing against nullptr does what it says.

For `nullptr < A <= valid ObjectMonitor*` the only valid values of A are `{1,2,3,4,5,6,7,8}` for aarch64. And in general A is in `[1,  alignof(ObjectMonitor*)]`. 

For me it was more natural to compare with `alignof(ObjectMonitor*)` than comparing with `1` or some other arbitrary unnamed constant.

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

PR Review Comment: https://git.openjdk.org/lilliput/pull/178#discussion_r1616790585


More information about the lilliput-dev mailing list