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

Andrew Haley aph at openjdk.org
Mon Jun 3 08:34:07 UTC 2024


On Sat, 1 Jun 2024 06:00:55 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> > > Just a code-style review.
> > > Question: could there be some sort of regression test for this, with different examples and edge cases?
> > 
> > 
> > I have no idea, really. assert_different_registers is used all over the place, and I'm going for bootcycle and tier1.
> 
> You could write a death test gtest. Like this:
> 
> ```
> TEST_VM_ASSERT_MSG(AssemblerAArch64, assert_different_regs, ".*Multiple uses of register: c_rarg0.*") {
>   Register reg1 = r0;
>   Register reg2 = r0;
>   assert_different_registers(reg1, reg2);
> }
> ```

I could, but I don't think there's much point. `assert_different_registers()` is used so much that it'll get thoroughly tested in the positive cases, at least. Do you think this is important?

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

PR Comment: https://git.openjdk.org/jdk/pull/16617#issuecomment-2144597901


More information about the hotspot-compiler-dev mailing list