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

Dean Long dlong at openjdk.org
Fri Jun 14 20:30:16 UTC 2024


On Fri, 7 Jun 2024 15:25:38 GMT, Roland Westrelin <roland 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.

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

Marked as reviewed by dlong (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19601#pullrequestreview-2119238746


More information about the hotspot-compiler-dev mailing list