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

Andrew Haley aph at openjdk.java.net
Thu Nov 18 09:48:42 UTC 2021


On Thu, 18 Nov 2021 06:08:21 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Tweako stuff.
>
> 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.

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

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


More information about the hotspot-compiler-dev mailing list