RFR: 8307423: [s390x] Represent Registers as values [v2]
Lutz Schmidt
lucy at openjdk.org
Fri May 5 10:47:21 UTC 2023
On Fri, 5 May 2023 01:56:27 GMT, Amit Kumar <amitkumar 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.3.0 ([JDK-8307093](https://bugs.openjdk.org/browse/JDK-8307093)).
>>
>> Tested `fastdebug, slowdebug, optimized, release build` , `tier1-test` on fastdebug build and build with GCC-9.5.0 as well.
>
> Amit Kumar has updated the pull request incrementally with one additional commit since the last revision:
>
> formatting & suggestions from @TheRealMDoerr
Your changes look good to me.
There is one fact I do not like. It was not introduced by this PR, but could easily be fixed now.
The value to indicate "this is not a register" is "-1", used as a literal in multiple places. I would rather see
`#define NOREG_ENCODING -1`
and then
`constexpr Register(int encoding = NOREG_ENCODING) : _encoding(encoding) {}`
Searching for "-1" in register_s390.hpp will reveal all affected locations.
-------------
Changes requested by lucy (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13805#pullrequestreview-1414560684
More information about the hotspot-dev
mailing list