RFR: 8276563: Undefined Behaviour in class Assembler

Andrew Haley aph at openjdk.java.net
Sun Nov 7 11:49:34 UTC 2021


On Sat, 6 Nov 2021 17:38:49 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> I believe the point is to encode the register number in the `this` pointer. If it were a member, you'd have to dereference the pointer to access the member value, so one more load instruction.

That's exactly the point. We have two alternatives, either a subtraction or a load, and it's hard to do much better than that. However, there is one idea, but it's rather hacky: 64-align the array of `Register`s then use an AND operation to get the encoding. The trouble with that is that it's not really portable, just portable-ish.

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

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


More information about the hotspot-compiler-dev mailing list