Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
17, 18
-
b11
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8331938 | 17.0.12 | Martin Doerr | P4 | Resolved | Fixed | b03 |
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.
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
- backported by
-
JDK-8331938 Improve assert_different_registers
- Resolved
- relates to
-
JDK-8270140 Improve Register class implementation
- Open
- links to
-
Commit openjdk/jdk17u-dev/5a3c6686
-
Commit openjdk/jdk/93cab7d0
-
Review openjdk/jdk17u-dev/2448
-
Review openjdk/jdk/5083
(1 links to)