RFR: 8294729: [s390] Implement nmethod entry barriers [v14]

Lutz Schmidt lucy at openjdk.org
Fri Oct 28 14:38:53 UTC 2022


On Thu, 27 Oct 2022 23:46:43 GMT, Tyler Steele <tsteele at openjdk.org> wrote:

>> This draft PR implements native method barriers on s390. When complete, this will fix the build, and bring the other benefits of [JDK-8290025](https://bugs.openjdk.org/browse/JDK-8290025) to that platform.
>
> Tyler Steele has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Changes
>   
>   - Adds labels to registers used in c2i_entry_barrier
>   - Removes use of R2
>   - Removes erroneous uses of R0
>   - Adds nm->c2i_entry_barrier in gen_i2c2i_adapters

Changes requested by lucy (Reviewer).

src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp line 170:

> 168:   // Fast path: If no method is given, the call is definitely bad.
> 169:   __ z_cfi(Z_method, 0);
> 170:   __ z_bre(bad_call);

Why don't you use 

__ z_ltgr(Z_method, Z_method);
__ z_brz(bad_call);

The use of CFI is incorrect anyway. It compares the low-order 32 bits only, but Z_method is a 64-bit address. CGFI would be correct. And CGHI would be correct and save two instruction bytes.

src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp line 179:

> 177:   __ z_llgf(Rtmp2, in_bytes(ClassLoaderData::keep_alive_offset()), Rtmp1);
> 178:   __ z_cfi(Rtmp2, 0);
> 179:   __ z_brne(skip_barrier);

If I get it correctly, the value (4 bytes) is only loaded into Rtmp2 to test it for zero. Why don't you use 

__ z_ltr(Rtmp2, Rtmp2);
__ z_brnz(skip_barrier);

or, even better

__ z_lt(Rtmp2, in_bytes(ClassLoaderData::keep_alive_offset()), Rtmp1);
__ z_brnz(skip_barrier);

src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp line 185:

> 183:   __ resolve_weak_handle(Address(Rtmp2), Rtmp2, Rtmp1, Rtmp3);
> 184:   __ z_cfi(Rtmp2, 0);
> 185:   __ z_brne(skip_barrier);

Why don't you use 

__ z_ltr(Rtmp2, Rtmp2);
__ z_brnz(skip_barrier);

if the value in Rtmp2 is 4 significant bytes only, LTGR otherwise.

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

PR: https://git.openjdk.org/jdk/pull/10558


More information about the hotspot-dev mailing list