RFR: 8373595: A new ObjectMonitorTable implementation [v2]

Fredrik Bredberg fbredberg at openjdk.org
Wed Feb 4 14:57:46 UTC 2026


On Wed, 28 Jan 2026 09:13:35 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:

>> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated all platforms after review comments
>
> src/hotspot/cpu/s390/macroAssembler_s390.cpp line 6394:
> 
>> 6392:         z_bre(monitor_found);
>> 6393:         add2reg(cache_addr, in_bytes(OMCache::oop_to_oop_difference()));
>> 6394:       }
> 
> This would be an alternative for the above loop:
> 
>       ByteSize cache_offset   = JavaThread::om_cache_oops_offset();
>       ByteSize monitor_offset = OMCache::oop_to_monitor_difference();
>       const unsigned int num_unrolled = 2;
>       
>       for (unsigned int i = 0; i < num_unrolled; i++) {
>         z_lg(tmp1_monitor, Address(Z_thread, cache_offset + monitor_offset));
>         z_cg(obj, Address(Z_thread, cache_offset));
>         z_bre(monitor_found);
>         cache_offset += in_bytes(OMCache::oop_to_oop_difference());
>       }

Nice suggestion! It's now been added to all platforms.

> src/hotspot/cpu/s390/macroAssembler_s390.cpp line 6403:
> 
>> 6401:       z_lg(tmp2, Address(tmp2));
>> 6402:       z_lg(tmp1, Address(tmp2, ObjectMonitorTable::table_capacity_mask_offset()));
>> 6403:       z_ngr(hash, tmp1);
> 
> The above two instructions could be combined:
> `    z_ng(hash, Address(tmp2, ObjectMonitorTable::table_capacity_mask_offset()));`

Fixed

> src/hotspot/cpu/s390/macroAssembler_s390.cpp line 6404:
> 
>> 6402:       z_lg(tmp1, Address(tmp2, ObjectMonitorTable::table_capacity_mask_offset()));
>> 6403:       z_ngr(hash, tmp1);
>> 6404:       z_lg(tmp1, Address(tmp2, ObjectMonitorTable::table_buckets_offset()));
> 
> Wouldn't it be clearer to use `tmp1_bucket` here?

Fixed

> src/hotspot/cpu/s390/macroAssembler_s390.cpp line 6412:
> 
>> 6410: 
>> 6411:       // Check if the monitor in the bucket is special (empty, tombstone or removed).
>> 6412:       z_cghi(tmp1_monitor, ObjectMonitorTable::SpecialPointerValues::below_is_special);
> 
> Address comparison should be unsigned. Please use `clgfi` instead.

Fixed

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29383#discussion_r2764429795
PR Review Comment: https://git.openjdk.org/jdk/pull/29383#discussion_r2764432547
PR Review Comment: https://git.openjdk.org/jdk/pull/29383#discussion_r2764431016
PR Review Comment: https://git.openjdk.org/jdk/pull/29383#discussion_r2764422747


More information about the shenandoah-dev mailing list