RFR: 8370405: C2: mismatched store from MergeStores wrongly scalarized in allocation elimination

Emanuel Peter epeter at openjdk.org
Wed Oct 29 15:03:34 UTC 2025


On Wed, 29 Oct 2025 14:56:17 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Right, I follow you all the way up to your question. I would answer like this:
>> 
>> `tmp` knows that its elements (the fields) have type `java/lang/Object (java/util/Enumeration)`, so they must be `Object` of interface `Enumeration`. But the projection from the call does not trust the interface, and so it just knows that it produces an `Object`.
>> 
>> I'll try to strip interface information from both, and see if I get a match that way. Does that sound reasonable?
>
> @eme64 But `aastore` does a check cast before the store. Since `Object` is not a subtype of `Object(Enumeration)`, should we do a check cast and the value to store is a `CheckCastPP` with the appropriate type?

I'm not following. Can you spell it out with a bit more detail? I'm not very familiar with how we deal with oops and interfaces in general, so I still need to read up a bit more now.

Just to make clear: we are not talking about a regular store here, but rather capturing the value that would be stored, and instead pass it to the deopt SafePoint. But you probably are aware of that ;)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27997#discussion_r2473645592


More information about the hotspot-compiler-dev mailing list