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

[JVMCI] CompilerToVM::getConstantPool method does not work according to javadoc

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • hotspot
    • Verified

      CompilerToVM::getConstantPool method does not work according to javadoc.

      Javadoc says: "If the base object is a MetaspaceWrapperObject then the metaspace pointer is fetched from that object and used as the base. Otherwise the object itself is used as the base."

      If we look in the native code of this method (http://hg.openjdk.java.net/graal/graal-jvmci-9/hotspot/file/d511f93727fc/src/share/vm/jvmci/jvmciCompilerToVM.cpp#l301), we see that no other Objects except three (HotSpotResolvedJavaMethodImpl, HotSpotConstantPool, HotSpotResolvedObjectTypeImpl) may be used for input.

      So we cannot use a custom implementation of MetaspaceWrapperObject interface.

      Javadoc should be corrected.

      Javadoc should say that no other object except instances of (HotSpotResolvedJavaMethodImpl, HotSpotConstantPool, HotSpotResolvedObjectTypeImpl) and null can be used as input, or java.lang.IllegalArgumentException will be thrown.

            never Tom Rodriguez
            kshefov Konstantin Shefov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: