-
Enhancement
-
Resolution: Delivered
-
P2
-
None
From JVM's point of view, a hidden class is a normal class except the following:
1. A hidden class has no initiating class loader and is not registered in any dictionary.
2. A hidden class has a name containing an illegal character
`Class::getName` returns `p.Foo/0x1234` whereas `GetClassSignature` returns "Lp/Foo.0x1234;".
3. A hidden class is not modifiable, i.e. cannot be redefined or retransformed.
JVM TI (IsModifableClass)[https://download.java.net/java/early_access/jdk15/docs/specs/jvmti.html#IsModifiableClass] returns false on a hidden class and VM anonymous class.
VM anonymous class vs Hidden class
- VM anonymous class is not registered in any dictionary and is also not modifiable.
- There is no specification for VM anonymous class and hence never specified
it has or does not have an initiating loader.
- GetClassSignature returns "Lp/Foo/0x1234;" on a VM anonymous class with no illegal character
whereas GetClassSignature returns "Lp/Foo.0x1234;" for a hidden class.
VM anonymous class might be incorrectly interpreted as a normal class and
`p.Foo` as the package name.
The proposal is that hidden classes are deemed as "loaded" classes, i.e. essentially all derived classes. Hidden classes are not "treated" specially.
1. A hidden class has no initiating class loader and is not registered in any dictionary.
2. A hidden class has a name containing an illegal character
`Class::getName` returns `p.Foo/0x1234` whereas `GetClassSignature` returns "Lp/Foo.0x1234;".
3. A hidden class is not modifiable, i.e. cannot be redefined or retransformed.
JVM TI (IsModifableClass)[https://download.java.net/java/early_access/jdk15/docs/specs/jvmti.html#IsModifiableClass] returns false on a hidden class and VM anonymous class.
VM anonymous class vs Hidden class
- VM anonymous class is not registered in any dictionary and is also not modifiable.
- There is no specification for VM anonymous class and hence never specified
it has or does not have an initiating loader.
- GetClassSignature returns "Lp/Foo/0x1234;" on a VM anonymous class with no illegal character
whereas GetClassSignature returns "Lp/Foo.0x1234;" for a hidden class.
VM anonymous class might be incorrectly interpreted as a normal class and
`p.Foo` as the package name.
The proposal is that hidden classes are deemed as "loaded" classes, i.e. essentially all derived classes. Hidden classes are not "treated" specially.
- relates to
-
JDK-8239818 [nestmates] problems with debugging hidden classes with jdb
- Closed
-
JDK-8238358 Implementation of JEP 371: Hidden Classes
- Resolved
-
JDK-8171335 MethodHandle.Lookup functionality to define a nestmate class
- Closed
-
JDK-8235690 [nestmates] InstanceKlass::signature_name returns incorrect hidden class name
- Resolved
-
JDK-8238663 [nestmates] array type of hidden class returns incorrect name
- Closed
There are no Sub-Tasks for this issue.