RFR: 8269122: The use of "extern const" for Register definitions generates poor code [v4]

Kim Barrett kbarrett at openjdk.java.net
Fri Jun 25 16:10:07 UTC 2021


On Fri, 25 Jun 2021 15:31:28 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Register definitions in HotSpot are declared as "extern const"
>> for ancient-historical reasons. We should stop doing that: it would
>> make the assembler significantly faster and smaller, improving both
>> bootstrap time and compilation speed.
>> 
>> This change shaves 2% off the size of the text section of libjvm.so on AArch64.
>
> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove dead code

This looks good.

I think there are further cleanups to do, though they can be done in
followup RFEs.

(1) With REGISTER_DEFINITION now empty, it and uses of it can be removed.

(2) While looking at this I stumbled across the DONT_USE_REGISTER_DEFINES
blocks for s390 and ppc. Those are defining shadowing macros for the various
register constants, which is pointless after the changes being made here.
And I think these are very nearly the only use of the xxxEnumValue
enumerators; on a quick scan I spotted only two others that seem like they
could easily be fixed.

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

Marked as reviewed by kbarrett (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/4554


More information about the hotspot-compiler-dev mailing list