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

Roland Westrelin roland at openjdk.org
Fri Jun 14 13:53:13 UTC 2024


On Fri, 14 Jun 2024 09:50:15 GMT, Tobias Hartmann <thartmann 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.
>
> All green.

@TobiHartmann thanks for the review & tests.
Anyone else for a review?

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

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


More information about the hotspot-compiler-dev mailing list