RFR: 8276563: Undefined Behaviour in class Assembler [v3]
Thomas Stuefe
stuefe at openjdk.java.net
Sat Nov 13 10:15:34 UTC 2021
On Sat, 13 Nov 2021 09:50:04 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> src/hotspot/cpu/aarch64/register_aarch64.cpp line 56:
>>
>>> 54:
>>> 55: const char* FloatRegisterImpl::name() const {
>>> 56: static const char *const names[number_of_registers] = {
>>
>> While reading this code I noticed that this method is sensitive to changes to is_valid, therefore care has to be taken when changing its semantics. Or, maybe just extend the array to number_of_declared_registers and add strings for ZR and SP, just to be safe.
>>
>> Update: my comment is in the wrong place, I meant to comment RegisterImpl::name().
>
> Great catch! I'll have a look at how this function is used. It's a little bit awkward that there is not a simple 1-to-1 mapping between register numbers and register names.
I understood the function as "return the functional name of the register, if there is one, otherwise return "r number".
-------------
PR: https://git.openjdk.java.net/jdk/pull/6280
More information about the hotspot-compiler-dev
mailing list