RFR: 8373495: C2: Aggressively fold loads from objects that have not escaped [v16]

Quan Anh Mai qamai at openjdk.org
Mon Jan 12 15:05:31 UTC 2026


On Mon, 12 Jan 2026 14:41:30 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix escape at store
>
> src/hotspot/share/opto/memnode.cpp line 708:
> 
>> 706: 
>> 707:   Node* mem = in(MemNode::Memory);   // start searching here...
>> 708: 
> 
> Would it make sense to check and bail out early for some trivial non-candidates here? It feels a bit wasteful e.g. to run the LocalEA machinery for loads from `ThreadLocal`.

That seems reasonable. I added an early return case when the base that is accessed is not an oop.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28812#discussion_r2682643157


More information about the hotspot-compiler-dev mailing list