On Fri, 24 Mar 2023 23:57:07 GMT, Cesar Soares Lucas <cslu...@openjdk.org> 
wrote:

>> src/hotspot/share/opto/callnode.hpp line 511:
>> 
>>> 509: // by a SafePoint; 2) A scalar replaced object is participating in an 
>>> allocation
>>> 510: // merge (Phi) and the Phi is referenced by a SafePoint. The 
>>> schematics of how
>>> 511: // 'spobj' is used in both scenarios are described below.
>> 
>> I am not comfortable with reusing SafePointScalarObjectNode for 2) since it 
>> describes totally different information.
>> I think it should be separate Node which points to array of  SFSO  id (in 
>> addition to Phis) similar how we do now if SFSO is referenced in other 
>> SFSO's field.   SFSO could be created before the merge. Consider:
>> 
>>   Point p = new Point();
>>   Point q = foo();
>>   if (cond) {
>>       q = p;
>>   }
>>   trap(p, q);
>
> I had considered that but decided not to do it to prevent adding a new IR 
> node. I'll give that a shot and update this thread with how it goes.

It **will** complicate your DebugInfo code (packing/unpacking) information. But 
I think it is right thing to do to avoid duplicated re-allocations during 
deoptimization - you should have only one new object.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12897#discussion_r1148154060

Reply via email to