RFR: 8339983: [s390x] secondary_super_cache does not scale well: C1 and interpreter

Andrew Haley aph at openjdk.org
Mon Nov 25 10:22:15 UTC 2024


On Sat, 23 Nov 2024 12:24:31 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

> s390x Port for : [JDK-8331341](https://bugs.openjdk.org/browse/JDK-8331341)
> 
> Tier1 test: 
> 1. `-XX:+UseSecondarySupersTable  -XX:+VerifySecondarySupers -XX:+VerifySecondarySupers -XX:-UseSecondarySupersCache`
> 2.  No flag turn on. i.e. used `UseSecondarySupersCache` by default. 
> 3. `-XX:+UseSecondarySupersTable  -XX:+VerifySecondarySupers -XX:+VerifySecondarySupers -XX:-UseSecondarySupersCache` with C1 compiler

src/hotspot/cpu/s390/macroAssembler_s390.cpp line 3178:

> 3176:   int slots = 0;
> 3177:   constexpr int NumRegs = 5;
> 3178:   Register* regs[NumRegs] = {&temp_reg, &temp2_reg, &temp3_reg, &temp4_reg, &result_reg};

You don't need this array. It contains information that is in `pushed_regs`. Use `pushed_regs.begin()` to create an iterator, which you use like this:


    int i = 0;
    for (auto it = pushed_regs.begin(); *it != noreg; ++it, i++) {
     z_stg(*it++, i * BytesPerWord + frame::z_abi_160_size, Z_SP);
    }

src/hotspot/cpu/s390/macroAssembler_s390.cpp line 3196:

> 3194: 
> 3195: #ifdef ASSERT
> 3196:   assert(temp_reg   != noreg, "temp_reg: sanity");

Suggestion:

  assert(temp_reg.is_valid(), "temp_reg: sanity");

src/hotspot/cpu/s390/macroAssembler_s390.cpp line 3477:

> 3475:   z_xilf(slot, (u1)(Klass::SECONDARY_SUPERS_TABLE_SIZE - 1)); // slot ^ 63 === 63 - slot (mod 64)
> 3476:   z_sllg(r_array_index, r_bitmap, /*d2 = */ 0, /* b2 = */ slot);
> 3477: 

Can you not use` slot xor 63` here?

src/hotspot/cpu/s390/macroAssembler_s390.cpp line 3521:

> 3519:   // So, negate slot and add 64 to it. i.e. 64 + (-slot)
> 3520:   z_lngr(slot, slot); // slot = -slot
> 3521:   z_aghi(slot, 64); // slot = slot + 64

And here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22341#discussion_r1856308683
PR Review Comment: https://git.openjdk.org/jdk/pull/22341#discussion_r1856314506
PR Review Comment: https://git.openjdk.org/jdk/pull/22341#discussion_r1856311453
PR Review Comment: https://git.openjdk.org/jdk/pull/22341#discussion_r1856312178


More information about the hotspot-dev mailing list