Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8130089

5.4.3.5: Avoid unnecessary resolution steps for CONSTANT_MethodType

XMLWordPrintable

    • vm

      Resolution of a CONSTANT_MethodType occurs by resolving each mentioned class. This, in turn, requires loading each class and testing that it is accessible to the caller.

      Compared to the process for resolving a field or method reference (5.4.3.2, 5.4.3.3), this carries additional overhead and can prompt unwanted errors. Method descriptors need not name accessible classes -- in fact, they need not name classes that exist at all (as long as the verification rules are still satisfied).

      It might be better to avoid checking the classes named by a MethodType for accessibility; further, if the MethodType API can be enhanced to avoid requiring Class objects (JDK-8130087), it would be possible to construct a MethodType with the referenced descriptor directly, rather than resolving the named classes first.

            jrose John Rose
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: