RFR: 8333805: Replaying compilation with null static final fields results in a crash

Roland Westrelin roland at openjdk.org
Tue Jun 18 12:11:20 UTC 2024


On Fri, 14 Jun 2024 20:27:15 GMT, Dean Long <dlong at openjdk.org> wrote:

>> When dumping a replay file, if a static field is null the "null"
>> string is appended to the line for the field. When replaying the
>> compilation, this breaks for:
>> 
>> - string fields: instead of null, the field is initialized with a
>>   "null" string
>>   
>> - object fields: the jvm crashes because it treats "null" as a class
>>   name.
>>   
>> - array fields: the jvm crashes because it expects an array length
>>   where the "null" string is.
>>   
>> This patch fixes it by:
>> 
>> - leaving out the "null" string when the field is null. When the
>>   compilation is replayed, the missing field value is taken as meaning
>>   the field is null.
>>   
>> - setting the length to -1 for a null array which on the replay side
>>   is used as an indication that the field is null.
>>   
>> I also noticed, for object arrays, that the actual type of the array
>> (for a non null field) is included in the replay file (given it can
>> differ from the field type) but not used when replaying. I changed
>> that.
>
> LGTM.

@dean-long thanks for the review

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

PR Comment: https://git.openjdk.org/jdk/pull/19601#issuecomment-2175943201


More information about the hotspot-compiler-dev mailing list