RFR: 8297445: PPC64: Represent Registers as values [v2]

Richard Reingruber rrich at openjdk.org
Wed Nov 23 20:24:59 UTC 2022


On Wed, 23 Nov 2022 12:09:15 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> The recent Register implementation uses wild pointer (including null pointer) dereferences which exhibit undefined behavior. We should migrate away from pointer-based representation of Register values as it was done for x86 ([JDK-8292153](https://bugs.openjdk.org/browse/JDK-8292153)). Problems exist when trying to build with GCC 11 ([JDK-8297426](https://bugs.openjdk.org/browse/JDK-8297426)).
>> Note: Implicit conversion from `intptr_t` to `RegisterOrConstant` is no longer supported. That's why I had to replace some `add` instructions.
>
> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update Copyright years.

Clean as a whistle :)
Thanks, Richard.

src/hotspot/cpu/ppc/register_ppc.hpp line 89:

> 87:   bool operator==(const Register rhs) const { return _encoding == rhs._encoding; }
> 88:   bool operator!=(const Register rhs) const { return _encoding != rhs._encoding; }
> 89:   const Register* operator->() const { return this; }

This is clever! Personally I'd be in favor of removing it in a cleanup change for simplicity.

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

Marked as reviewed by rrich (Reviewer).

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


More information about the hotspot-dev mailing list