RFR: 8276563: Undefined Behaviour in class Assembler [v9]

Andrew Haley aph at openjdk.java.net
Fri Nov 19 14:03:25 UTC 2021


On Thu, 18 Nov 2021 09:45:51 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> src/hotspot/cpu/aarch64/register_aarch64.hpp line 63:
>> 
>>> 61:   int encoding() const             { assert(is_valid(), "invalid register"); return encoding_nocheck(); }
>>> 62:   bool is_valid() const            { return (unsigned)encoding_nocheck() < number_of_registers; }
>>> 63:   bool has_byte_register() const   { return this >= first() && this - first() < number_of_byte_registers; }
>> 
>> Why not relegate to encoding_nocheck() too: `return encoding_nocheck() >= 0 && encoding_nocheck() < num_byte_regs` ?
>
> x86 changes are for later.
> As far as I can tell, `has_byte_register()` isn't used by anything, so I guess I'll take it out.
> I was trying to minimize the scope of this patch.

Done.

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

PR: https://git.openjdk.java.net/jdk/pull/6280


More information about the hotspot-compiler-dev mailing list