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

Andrew Haley aph at openjdk.java.net
Thu Jun 24 07:41:30 UTC 2021


On Wed, 23 Jun 2021 08:35:39 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> src/hotspot/share/asm/register.hpp line 50:
>> 
>>> 48: #define AS_REGISTER(type,name)         ((type)name##_##type##EnumValue)
>>> 49: 
>>> 50: #ifndef USE_EXTERN_CONST_FOR_REGISTER_DEFINITIONS
>> 
>> I can see this conditionalization being useful for development and testing of this change, but why keep it and the old, now dead, code?
>
> The old code was a workaround for compilers that don't handle inline constants well. There are ports that I don't know about or can't test, and there are some outside the main jdk/jdk tree. If this change breaks any of them, all they have to do is define USE_EXTERN_CONST_FOR_REGISTER_DEFINITIONS. If it turns out that no such systems still exist, we can take it out.

Are you satisfied with that, Kim? Thanks.

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

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


More information about the hotspot-compiler-dev mailing list