harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r565303 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363: tpool.cpp tpool.h vf_resolve.cpp
Date Mon, 13 Aug 2007 10:34:12 GMT
Author: mloenko
Date: Mon Aug 13 03:34:11 2007
New Revision: 565303

URL: http://svn.apache.org/viewvc?view=rev&rev=565303
Log:
fix reg.test failures in debug mode

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/vf_resolve.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp?view=diff&rev=565303&r1=565302&r2=565303
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp Mon Aug 13 03:34:11
2007
@@ -242,15 +242,13 @@
             }
 
             //check whether FROM class is loaded
-
-
             if( !from_type->cls ) {
                 from_type->cls = vf_resolve_class(k_class, from_type->name, false);
                 if( !from_type->cls ) from_type->cls = CLASS_NOT_LOADED;
             }
 
             if( from_type->cls && from_type->cls != CLASS_NOT_LOADED ) {
-                return vf_is_valid(from_type->cls, to_type->cls);
+                return vf_is_extending(from_type->cls, to_type->cls);
             } else {
                 NewConstraint(from_type->name, to_type->name);
                 return 1;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.h?view=diff&rev=565303&r1=565302&r2=565303
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.h Mon Aug 13 03:34:11 2007
@@ -284,7 +284,6 @@
     };
 
     class_handler vf_resolve_class( class_handler k_class, const char *name, bool need_load);
-    int vf_is_valid(class_handler from, class_handler to);
     int vf_is_extending(class_handler from, class_handler to);
 
 } // namespace CPVerifier

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/vf_resolve.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/vf_resolve.cpp?view=diff&rev=565303&r1=565302&r2=565303
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/vf_resolve.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/vf_resolve.cpp Mon Aug 13 03:34:11
2007
@@ -38,6 +38,12 @@
             return VF_ErrorLoadClass;
         }
 
+        //no need to load the source
+        if( class_is_interface_(target) ){
+            return VF_OK;
+        }
+
+
         // get stack reference class
         class_handler source = vf_resolve_class( klass, constraint->source, true );
         if( !source ) {
@@ -45,7 +51,7 @@
         }
 
         // check restriction
-        if( !vf_is_valid( source, target ) ) {
+        if( !vf_is_extending( source, target ) ) {
             return VF_ErrorIncompatibleArgument;
         }
         return VF_OK;
@@ -53,18 +59,6 @@
 
 
     /**
-    * Returns true if 'from' is assignable to 'to' in terms of verifier, namely:
-    * if 'to' is an interface or a (not necessarily direct) super class of 'to'
-    */
-    int vf_is_valid(class_handler from, class_handler to) {
-        if( class_is_interface_(to) ){
-            return true;
-        }
-
-        return vf_is_extending(from, to);
-    }
-
-    /**
     * Returns true if 'from' is (not necessarily directly) extending 'to'
     */
     int vf_is_extending(class_handler from, class_handler to) {
@@ -83,24 +77,26 @@
         const char *name,         // resolved class name
         bool need_load)      // load flag
     {
-        // get class loader
-        classloader_handler class_loader = 0;
-        class_handler sup = k_class;
-
-        while( sup ) {
-            classloader_handler class_loader2 = class_get_class_loader( sup );
-            if( class_loader != class_loader2 ) {
-                class_loader = class_loader2;
-
-                class_handler result = need_load ? cl_load_class( class_loader, name ) :
cl_get_class( class_loader, name );
-
-                if( result ) {
-                    return result;
+        if( need_load ) {
+            return cl_load_class( class_get_class_loader( k_class ), name );
+        } else {
+            // get class loader
+            classloader_handler class_loader = 0;
+            class_handler sup = k_class;
+
+            while( sup ) {
+                classloader_handler class_loader2 = class_get_class_loader( sup );
+                if( class_loader != class_loader2 ) {
+                    class_loader = class_loader2;
+                    class_handler result = cl_get_class( class_loader, name );
+                    if( result ) {
+                        return result;
+                    }
                 }
+                sup = class_get_super_class(sup);
             }
-            sup = class_get_super_class(sup);
+            return 0;
         }
-        return 0;
     } // vf_resolve_class
 
 } // namespace CPVerifier



Mime
View raw message