RFR: 8292203: AArch64: Represent Registers as values [v3]

Vladimir Ivanov vlivanov at openjdk.org
Wed Aug 17 18:18:36 UTC 2022


> (It's a PR dependent on #9815.)
> 
> Along with x86 ([JDK-8292153](https://bugs.openjdk.org/browse/JDK-8292153)), I propose to refactor Register classes on AArch64 and migrate away from pointer-based representation.
> 
> The motivation is the same: improve compile-time checks and avoid ambiguities between overloads due to implicit conversions between pointers and integral types.
> 
> 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 improves:
>   GCC:   https://godbolt.org/z/r6G36facj
>   Clang: https://godbolt.org/z/x5oPdYEPM
> 
> (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:

  explicit constructors

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/9826/files
  - new: https://git.openjdk.org/jdk/pull/9826/files/a139bc03..d0ae344d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=9826&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9826&range=01-02

  Stats: 6 lines in 1 file changed: 0 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/9826.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9826/head:pull/9826

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


More information about the hotspot-dev mailing list