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

Thomas Stuefe stuefe at openjdk.org
Sat Jun 1 06:04:03 UTC 2024


On Fri, 31 May 2024 16:59:02 GMT, Andrew Haley <aph 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);
}

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

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


More information about the hotspot-compiler-dev mailing list