C2 will fold the layout helper load if it can determine that the object is not an array. Currently, this does not work for an object that implements a "non-array" interface, i.e. an interface that is not 'Serializable' and not 'Cloneable':
https://github.com/openjdk/jdk/blob/c33c1cfe7349ac657cd7bf54861227709d3c8f1b/src/hotspot/share/opto/memnode.cpp#L2215-L2223
This is probably an oversight fromJDK-8297933 that now causes issues like the one described in JDK-8348631 where data is folded but control is not.
The fix should also undo the change to 'LibraryCallKit::generate_array_guard_common':
https://github.com/openjdk/jdk/pull/23331
https://github.com/openjdk/jdk/blob/c33c1cfe7349ac657cd7bf54861227709d3c8f1b/src/hotspot/share/opto/memnode.cpp#L2215-L2223
This is probably an oversight from
The fix should also undo the change to 'LibraryCallKit::generate_array_guard_common':
https://github.com/openjdk/jdk/pull/23331
- relates to
-
JDK-8348631 Crash in PredictedCallGenerator::generate after JDK-8347006
-
- Resolved
-
-
JDK-8297933 [REDO] Compiler should only use verified interface types for optimization
-
- Resolved
-