Integrated: 8292153: x86: Represent Registers as values
Vladimir Ivanov
vlivanov at openjdk.org
Thu Aug 11 21:19:58 UTC 2022
On Tue, 9 Aug 2022 23:25:27 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.
This pull request has now been integrated.
Changeset: 755ecf6b
Author: Vladimir Ivanov <vlivanov at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/755ecf6b7384e67ccb51c4498f94336631db690d
Stats: 575 lines in 28 files changed: 152 ins; 103 del; 320 mod
8292153: x86: Represent Registers as values
Reviewed-by: kvn, aph
-------------
PR: https://git.openjdk.org/jdk/pull/9815
More information about the hotspot-dev
mailing list