changeset 16575:adafceb4da4a

improved name and documentation for method implementing fast-path check for type resolution
author Doug Simon <doug.simon@oracle.com>
date Sun, 20 Jul 2014 17:10:04 +0200
parents 042b5e9aeb76
children a01fe4b301a8
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSignature.java
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Fri Jul 18 14:28:43 2014 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Sun Jul 20 17:10:04 2014 +0200
@@ -712,13 +712,13 @@
     }
 
     /**
-     * Determines if this type is resolved in the context of a given accessing class. This is a
-     * conservative check based on this type's class loader being identical to
-     * {@code accessingClass}'s loader. This type may still be the correct resolved type in the
-     * context of {@code accessingClass} if its loader is an ancestor of {@code accessingClass}'s
-     * loader.
+     * Performs a fast-path check that this type is resolved in the context of a given accessing
+     * class. A negative result does not mean this type is not resolved with respect to
+     * {@code accessingClass}. That can only be determined by
+     * {@linkplain HotSpotGraalRuntime#lookupType(String, HotSpotResolvedObjectType, boolean)
+     * re-resolving} the type.
      */
-    public boolean isResolvedWithRespectTo(ResolvedJavaType accessingClass) {
+    public boolean isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass) {
         assert accessingClass != null;
         ResolvedJavaType elementType = getElementalType();
         if (elementType.isPrimitive()) {
@@ -738,7 +738,7 @@
 
     @Override
     public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
-        if (isResolvedWithRespectTo(requireNonNull(accessingClass))) {
+        if (isDefinitelyResolvedWithRespectTo(requireNonNull(accessingClass))) {
             return this;
         }
         HotSpotResolvedObjectType accessingType = (HotSpotResolvedObjectType) accessingClass;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSignature.java	Fri Jul 18 14:28:43 2014 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSignature.java	Sun Jul 20 17:10:04 2014 +0200
@@ -134,7 +134,7 @@
         }
 
         if (type instanceof HotSpotResolvedObjectType) {
-            return ((HotSpotResolvedObjectType) type).isResolvedWithRespectTo(accessingClass);
+            return ((HotSpotResolvedObjectType) type).isDefinitelyResolvedWithRespectTo(accessingClass);
         }
         return true;
     }