RFR: 8373591: C2: Fix the memory around some intrinsics nodes [v2]

Roland Westrelin roland at openjdk.org
Mon Dec 15 15:25:44 UTC 2025


On Fri, 12 Dec 2025 14:47:34 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> src/hotspot/share/opto/graphKit.cpp line 4191:
>> 
>>> 4189:   Node* res_mem = _gvn.transform(new SCMemProjNode(_gvn.transform(str)));
>>> 4190:   if (adr_type == TypePtr::BOTTOM) {
>>> 4191:     set_all_memory(res_mem);
>> 
>> I'm confused by this. Doesn't `StrCompressedCopyNode` only write to dst? So the only part of the memory state that it updates is the one for `TypeAryPtr::BYTES`?
>
> It is because if a node consumes more memory than it produces, we need to compute its anti-dependencies. And since we do not compute anti-dependencies of these nodes, it is safer to make them kill all the memory they consume. What do you think?

Could this be fixed by appending a `MemBarCPUOrderNode` on the slice of src?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28789#discussion_r2619864649


More information about the shenandoah-dev mailing list