Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272315

Improve assert_different_registers

    XMLWordPrintable

Details

    • b11

    Backports

      Description

        assert_different_registers (hotspot/share/asm/register.hpp) is defined using a bunch of different overloads for different arities, with large amounts of code duplication, and with relatively poor error reporting.

        The error reporting just prints the "values" of the registers, because this is all done with AbstractRegister parameters. By instead using a deduced template parameter for the type of the arguments, the names of the registers become available for use in the error message. All concrete register types provide such a function, and this function is always called with all the arguments being the type.

        The code duplication could be reduced by having a an overload call the next smaller arity overload as a helper function. But better would be to use a single variadic function template.

        Attachments

          Issue Links

            Activity

              People

                kbarrett Kim Barrett
                kbarrett Kim Barrett
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: