RFR: JDK-8323497: On x64, use 32-bit immediate moves for narrow klass base if possible [v3]

Quan Anh Mai qamai at openjdk.org
Wed Feb 21 12:54:55 UTC 2024


On Wed, 21 Feb 2024 07:42:45 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/cpu/x86/macroAssembler_x86.cpp line 5596:
>> 
>>> 5594:   if (CompressedKlassPointers::base() != nullptr) {
>>> 5595:     // Uses 32-bit mov if base is small enough
>>> 5596:     movptr(tmp, (intptr_t)CompressedKlassPointers::base());
>> 
>> If we can reserve the base in the low 2G then this could be optimized further to `addq(r, CompressedKlassPointers::base())` and if `LogKlassAlignmentInBytes` is 8 (as asserted in `decode_and_move_klass_not_null` below), we can shorten the whole sequence into `leaq(r, Address(noreg, r, Address::times_8, CompressedKlassPointers::base())`
>
> Nice! But could we do this in a follow-up RFE? I don't have any more time to spend on this atm, and I would like to get this PR at least integrated. It has been sitting in review for 7 weeks now.
> 
> I opened a follow-up RFE: https://bugs.openjdk.org/browse/JDK-8326383
> 
> (about the leaq, we may move to a different encoding scheme with a different shift value with Lilliput, so I am hesitant to put in too much work that relies on a 8-byte shift)

I agree with that.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17340#discussion_r1497489620


More information about the hotspot-dev mailing list