RFR: 8276563: Undefined Behaviour in class Assembler

Thomas Stuefe stuefe at openjdk.java.net
Sat Nov 6 17:10:33 UTC 2021


On Sat, 6 Nov 2021 09:04:07 GMT, Andrew Haley <aph at openjdk.org> wrote:

> > Just an idea, but could you make the register number a constant template argument?
> 
> OK, I'll kick that around.

Hmm, I realize my proposal works well if a specific register is used, but not if it is hidden behind a generic `Register*` pointer. In the former case, the compiler inlines the constant into the code. In the latter case, it calls `virtual RegisterImpl::encoding()`, so you get one vtable access and one subroutine call.

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

PR: https://git.openjdk.java.net/jdk/pull/6280


More information about the hotspot-compiler-dev mailing list