RFR: 8276563: Undefined Behaviour in class Assembler

Andrew Haley aph at openjdk.java.net
Sun Nov 7 11:44:31 UTC 2021


On Sat, 6 Nov 2021 17:07:59 GMT, Thomas Stuefe <stuefe 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.

Ah. Oh well.

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

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


More information about the hotspot-compiler-dev mailing list