RFR: 8319822: Use a linear-time algorithm for assert_different_registers() [v6]

Andrew Haley aph at openjdk.org
Fri May 10 14:29:01 UTC 2024


On Wed, 17 Jan 2024 07:32:44 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review feedback.
>
> src/hotspot/share/asm/register.hpp line 257:
> 
>> 255: 
>> 256: template<typename R, typename... Rx>
>> 257: inline constexpr bool different_registers(AbstractRegSet<R> allocated_regs, R first_register) {
> 
> different_registers is only used by debug-only code in assert_different_registers.  Shouldn't all the overloads
> for different_registers be within an `#ifdef ASSERT` block?

I could do so, but that would lose the ability to do `static_assert(different_registers(...`. I don't think that  `static_assert` depends on `ASSERT`. I'm happy to make this patch debug-only, though, if you prefer.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16617#discussion_r1596823414


More information about the hotspot-compiler-dev mailing list