-
Bug
-
Resolution: Unresolved
-
P4
-
21
The verification spec speaks of *classes*, which are loaded entities (without a precise specified representation, per 4.10.1), *class names*, which are strings acting as lookup keys used to find classes, and *types*, which sometimes mention class or interface names (of the form 'class(N, L)'), and at other times may be other structures like array types (of the form 'arrayOf(T)').
Unfortunately, the verification rules sometimes blur these three concepts. In particular:
- The type of a field or method reference may be an *array type*, and so must be encoded with a full type, not a name; this saves some effort later on (e.g., in the 'getfield' rules) to construct a class type using the name
- The 'classInterfaces' predicate should be renamed 'classInterfaceNames' to clarify that the result is a list of strings (it appears this doesn't actually get used anywhere currently)
- Use of 'superclassChain' is made unnecessarily complex by operating on a list of types rather than loaded classes
- 'currentClassLoader' unnecessarily creates, and then deconstructs, a type, rather than working directly with the current loaded class
- The 'thisClass' predicate is really 'thisType' and should be renamed; often, an actual 'thisClass' predicate (that produces a class) would be more useful
Unfortunately, the verification rules sometimes blur these three concepts. In particular:
- The type of a field or method reference may be an *array type*, and so must be encoded with a full type, not a name; this saves some effort later on (e.g., in the 'getfield' rules) to construct a class type using the name
- The 'classInterfaces' predicate should be renamed 'classInterfaceNames' to clarify that the result is a list of strings (it appears this doesn't actually get used anywhere currently)
- Use of 'superclassChain' is made unnecessarily complex by operating on a list of types rather than loaded classes
- 'currentClassLoader' unnecessarily creates, and then deconstructs, a type, rather than working directly with the current loaded class
- The 'thisClass' predicate is really 'thisType' and should be renamed; often, an actual 'thisClass' predicate (that produces a class) would be more useful
- relates to
-
JDK-8323626 4.10.1.2: improve verification typing rules
- Open
-
JDK-8122946 4.10.1.9: invoke{special,static} can invoke an interface method
- Open
-
JDK-8322507 5.3, 5.4: Better specify the treatment of array types
- Open