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

[JVMCI] a javadoc for CompilerToVM::getResolvedJavaMethod doesn't match method logic

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • 9
    • hotspot

      Currently, a CompilerToVM::getResolvedJavaMethod javadoc states:

          /**
           * Read a value representing a metaspace Method* and return the
           * {@link HotSpotResolvedJavaMethodImpl} wrapping it. This method does no checking that the
           * location actually contains a valid Method*. If the {@code base} object is a
           * {@link HotSpotResolvedJavaMethodImpl}, {@link HotSpotConstantPool} or
           * {@link HotSpotResolvedObjectTypeImpl} then the metaspace pointer is fetched from that object
           * and used as the base. Otherwise the object itself is used as the base.
           *
           * @param base an object to read from or null
           * @param displacement
           * @return null or the resolved method for this location
           */

      however, in fact, only MemberName(it's long field at provided offset) and HotSpotResolvedJavaMethodImpl(a metaspaceMethod field) are supported by c++ code, throwing IllegalArgumentException for other non-null base parameters(but javadoc states that an object itself is used as a base in that case)

            never Tom Rodriguez
            dpochepk Dmitrij Pochepko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: