-
Bug
-
Resolution: Fixed
-
P5
-
24
-
b23
After JDK-8338526 it is no longer legal to encode compressed class pointers for interfaces or abstract classes as they are not stored in the compressed class space any longer.
However, in C2 final graph reshaping, it seems like we perform the following transformation (in pseudo code):
decode(dynamic_narrow_klass) == static_klass
=>
dynamic_narrow_klass == encode(static_klass)
This transformation is no longer valid if static_klass is an interface or abstract class. I can't see that there are any guards for that. I guess the result of the expression should typically be false. Encoding a not encodable klass pointer will result in garbage bits. Most of the time comparing a real compressed class to garbage bits will result in false. But I suppose sometimes you win the garbage lottery and get the wrong result.
However, in C2 final graph reshaping, it seems like we perform the following transformation (in pseudo code):
decode(dynamic_narrow_klass) == static_klass
=>
dynamic_narrow_klass == encode(static_klass)
This transformation is no longer valid if static_klass is an interface or abstract class. I can't see that there are any guards for that. I guess the result of the expression should typically be false. Encoding a not encodable klass pointer will result in garbage bits. Most of the time comparing a real compressed class to garbage bits will result in false. But I suppose sometimes you win the garbage lottery and get the wrong result.
- relates to
-
JDK-8338526 Don't store abstract and interface Klasses in class metaspace
- Resolved
- links to
-
Commit(master) openjdk/jdk/2432c4f8
-
Review(master) openjdk/jdk/21784