RFR: 8276563: Undefined Behaviour in class Assembler
Andrew Haley
aph at openjdk.java.net
Mon Nov 8 14:21:37 UTC 2021
On Sun, 7 Nov 2021 11:49:36 GMT, Andrew Haley <aph at openjdk.org> wrote:
> > In other words: in the current scheme we pass around an integer disguised as a pointer, and then have to cast it to an integer to use it. That seems silly. Let's just pass around the integer instead, wrapped in a value-object, which the compiler should treat the same as if it were just the integer.
>
> That's worth exploring, but I'm reluctant to start overloading `->`. I'll have a look.
So I had a good look, and I think this idea is not going to fly without substantial changes elsewhere. The trickiest problem I've found so far is `GrowableArray<Register>`, which assumes that `Register` is a pointer type. None of these problems is insurmountable, of course, but it does mean that a change like this spills into many more places in shared code.
Oh, the other problem is that variables of type `Register` may be assigned, which means that the field containing the encoding can no longer be `const`, and there are `const` problems elsewhere too.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6280
More information about the hotspot-compiler-dev
mailing list