RFR: 8292153: x86: Represent Registers as values [v2]

Vladimir Kozlov kvn at openjdk.org
Thu Aug 11 02:00:39 UTC 2022


On Wed, 10 Aug 2022 21:10:51 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> As of now, Registers of all sorts use pointer-based representation. It's error-prone, because compilers perform implicit conversions between pointers and integral values. Also, it constraints `MacroAssembler` API where it may introduce ambiguity between overloads.
>> 
>> Proposed change hides pointer representation behind value class.
>> 
>> Pointer-based representation is kept to avoid massive migration of users (from `->` to `.`) and to enable incremental migration on per-platform basis (pointer-based representation is assumed in shared code).
>> 
>> Code quality doesn't suffer (and even slightly improves):
>>   https://godbolt.org/z/d8dGM1eY1
>> 
>> (I noticed one downside: slowdebug builds become slower, because `operator->` isn't inlined there. If it becomes a problem, migrating performance-sensitive places from `->` to `.` should solve the problem.)
>> 
>> Testing: hs-tier1 - hs-tier5
>> 
>> PS: a number of cleanups are incorporated. In particular, I decided to expand all macros from `register.hpp` because IMO they add confusion rather than improve readability.
>
> Vladimir Ivanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   cleanups

Looks good to me.

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

Marked as reviewed by kvn (Reviewer).

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


More information about the shenandoah-dev mailing list