RFR: JDK-8316756: C2 EA fails with "missing memory path" when encountering unsafe_arraycopy stub call [v3]

Vladimir Kozlov kvn at openjdk.org
Tue Jan 16 17:05:21 UTC 2024


On Tue, 16 Jan 2024 13:59:29 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:

>> Okay, it does not always need to be raw memory. But maybe we still want to assert that we have an unsafe arraycopy in this case? If we ever have more valid cases, the assert could easily be adjusted to allow them. 
>> 
>> But given how close we are to RDP 2, I suggest to go with this general fix and follow up with an RFE to add that assert if you all agree with that.
>
>> Could we somehow assert here that we have a call with an intended narrow memory input? Directly asserting that this is an unsafe arraycopy might be too specific. But maybe we can add the following sanity check?
>> 
>> ```
>> n->as_CallLeaf()->adr_type()->is_rawptr()
>> ```
> 
> @vnkozlov what do you think?

If it is not Narrow memory you will get `MergeMem` node as Call's memory input which we put on`mergemem_worklist` and not processing it or its users in this part of code. We have `assert(mergemem_worklist.contains(m->as_MergeMem())` instead here.

You can add `assert(!n->in(TypeFunc::Memory)->as_MergeMem(), "only narrow memory expected here");` if you want.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17347#discussion_r1453718235


More information about the hotspot-compiler-dev mailing list