changeset 18195:62d3440228b8

Improve javadoc for ResolvedJavaType.getSingleImplementor() and CompilerToVM.getKlassImplementor().
author Josef Eisl <josef.eisl@jku.at>
date Thu, 30 Oct 2014 17:52:18 +0100
parents b7226cb963c3
children ff1f1481b367
files graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Thu Oct 30 16:52:13 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Thu Oct 30 17:52:18 2014 +0100
@@ -181,6 +181,10 @@
     /**
      * Gets the single implementor of this type. Calling this method on a non-interface type causes
      * an exception.
+     * <p>
+     * If the compiler uses the result of this method for its compilation, the usage must be guarded
+     * because the verifier can not guarantee that the assigned type really implements this
+     * interface. Additionally, class loading can invalidate the result of this method.
      *
      * @return {@code null} if there is no implementor, the implementor if there is only one, or
      *         {@code this} if there are more than one.
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Thu Oct 30 16:52:13 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Thu Oct 30 17:52:18 2014 +0100
@@ -90,10 +90,12 @@
     long findUniqueConcreteMethod(long actualHolderMetaspaceKlass, long metaspaceMethod);
 
     /**
-     * Returns the implementor for the given interface class.
+     * Returns the implementor for the given interface class, if there is a single implementor.
      *
      * @param metaspaceKlass the metaspace klass to get the implementor for
-     * @return the implementor as metaspace klass pointer or null if there is no implementor
+     * @return the implementor as metaspace klass pointer if there is a single implementor, null if
+     *         there is no implementor, or the input metaspace klass pointer ({@code metaspaceKlass}
+     *         ) itself if there is more than one implementor.
      */
     long getKlassImplementor(long metaspaceKlass);