Integrated: 8333805: Replaying compilation with null static final fields results in a crash
Roland Westrelin
roland at openjdk.org
Tue Jun 18 12:11:22 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.
This pull request has now been integrated.
Changeset: fa401f37
Author: Roland Westrelin <roland at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/fa401f37dffe7bde27e562065dfd24381d5237cc
Stats: 156 lines in 3 files changed: 112 ins; 21 del; 23 mod
8333805: Replaying compilation with null static final fields results in a crash
Reviewed-by: thartmann, dlong
-------------
PR: https://git.openjdk.org/jdk/pull/19601
More information about the hotspot-compiler-dev
mailing list