RFR: 8276563: Undefined Behaviour in class Assembler
Thomas Stuefe
stuefe at openjdk.java.net
Sun Nov 7 06:52:40 UTC 2021
On Sat, 6 Nov 2021 17:38:49 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> Or, perhaps even better: I've seen compiler constant folding be perturbed in the past by integer <-> pointer casts (I guess it just bails out in some cases), and also, using an `int` would halve the footprint of arrays of registers on platforms where pointers are 64-bits.
Now I get it. I like your proposal, it's way simpler. I did a small test on x64:
https://gist.github.com/tstuefe/c97dff7624a1469a7295dda51ed9a265
As you say, compiler passes encoding value directly, using - in my example - just the 16-bit portion of RDI since I used a short. The only odd thing was that when using a constant object know at the use site (case B), I would have expected an immediate, but the constant encoding gets loaded from the text segment instead.
Wrt `->` to `.`, I dislike operator overloading so I would just do the changes instead. But that's up to Andrew.
Cheers, Thomas
-------------
PR: https://git.openjdk.java.net/jdk/pull/6280
More information about the hotspot-compiler-dev
mailing list