harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r540977 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src: class_support/classloader.cpp gc/root_set_enum_common.cpp kernel_classes/javasrc/java/lang/Class.java kernel_classes/javasrc/java/lang/ClassLoader.java
Date Wed, 23 May 2007 15:39:09 GMT
Author: gshimansky
Date: Wed May 23 08:39:08 2007
New Revision: 540977

URL: http://svn.apache.org/viewvc?view=rev&rev=540977
Log:
Reverted commit 540942 for HARMONY-3462 because it breaks VM so that it doesn't even start


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp?view=diff&rev=540977&r1=540976&r2=540977
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Wed May 23 08:39:08
2007
@@ -1595,15 +1595,6 @@
     return clss;
 } // UserDefinedClassLoader::DoLoadClass
 
-static jmethodID getClassRegistryMethod(Global_Env* env) {
-    String* acr_func_name = env->string_pool.lookup("addToLoadedClasses");
-    String* acr_func_desc = env->string_pool.lookup("(Ljava/lang/String;Ljava/lang/Class;)V");
-    Class* clss = env->LoadCoreClass("java/lang/ClassLoader");
-    Method* m = clss->lookup_method(acr_func_name, acr_func_desc);
-    assert(m);
-    return (jmethodID)m;
-}
-
 bool ClassLoader::InsertClass(Class* clss) {
     tmn_suspend_disable();
     if (!IsBootstrap()) // skip BS classes
@@ -1642,10 +1633,14 @@
         chl->object = *clss->get_class_handle();
         args[2].l = chl;
 
-        static jmethodID registryMethod = getClassRegistryMethod(env);
+        static String* acr_func_name = env->string_pool.lookup("addToLoadedClasses");
+        static String* acr_func_desc = env->string_pool.lookup("(Ljava/lang/String;Ljava/lang/Class;)V");
+
+        Method* method = class_lookup_method_recursive(m_loader->vt()->clss, acr_func_name,
acr_func_desc);
+        assert(method);
 
         jvalue res;
-        vm_execute_java_method_array(registryMethod, &res, args);
+        vm_execute_java_method_array((jmethodID) method, &res, args);
 
         if(exn_raised()) {
             tmn_suspend_enable();

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp?view=diff&rev=540977&r1=540976&r2=540977
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp Wed May 23 08:39:08
2007
@@ -139,9 +139,10 @@
  } //vm_enumerate_static_fields
 
 
+// This is the main function used to enumerate Java references by the VM and the JITs.  
+// It is part of the JIT-VM interface.
 // 20030405 Note: When compressing references, vm_enumerate_root_reference() expects to be
called with slots
 // containing *managed* refs (represented by heap_base if null, not 0/NULL), so those refs
must not be NULL. 
-#if _DEBUG
 static void check_ref(void** ref)
 {
     if (VM_Global_State::loader_env->compress_references) {
@@ -155,7 +156,6 @@
         } 
     }
 }
-#endif // _DEBUG
 
 void 
 vm_enumerate_root_reference(void **ref, Boolean is_pinned)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java?view=diff&rev=540977&r1=540976&r2=540977
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
Wed May 23 08:39:08 2007
@@ -1160,12 +1160,7 @@
         return VMClassRegistry.getSimpleName(this);
     }
 
-    /**
-     * Provides strong referencing between the classloader 
-     * and it's defined classes. Intended for class unloading implementation.
-     * @see java.lang.ClassLoader#loadedClasses
-     */
-    ClassLoader definingLoader;
+    protected ClassLoader definingLoader;
 
     private final class ReflectionData {
         

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java?view=diff&rev=540977&r1=540976&r2=540977
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
Wed May 23 08:39:08 2007
@@ -106,13 +106,11 @@
      */
     private final HashMap<String, Package> definedPackages;
 
-    /**
-     * The class registry, provides strong referencing between the classloader 
-     * and it's defined classes. Intended for class unloading implementation.
-     * Maps binary class name to the class.
-     * @see java.lang.Class#definingLoader
-     */
-    private HashMap<String, Class> loadedClasses = new HashMap<String, Class>();

+    /*
+    * The following mapping is used <String binaryClassName, Class clazz>, where binaryClassName
- class name,
+    * clazz - corresponding class.
+    */
+    Hashtable<String, Class> loadedClasses = new Hashtable<String, Class>();

 
     /**
      * package private to access from the java.lang.Class class. The following
@@ -379,14 +377,12 @@
     }
 
     /**
-     * Registers the defined class, invoked by VM.
-     * Intended for class unloading implementation.
+     * @com.intel.drl.spec_ref
      */
-    @SuppressWarnings("unused") 
-    private void addToLoadedClasses(String name, Class clazz) {
+    public void addToLoadedClasses(String name, Class clazz) {
         synchronized (loadedClasses){
             loadedClasses.put(name, clazz); 
-        }
+    	}
     }
 
     /**
@@ -394,7 +390,7 @@
      */
     protected final Class<?> defineClass(String name, ByteBuffer b, ProtectionDomain
protectionDomain)
         throws ClassFormatError {
-        byte[] data = b.array();
+		byte[] data = b.array();
         return defineClass(name, data, 0, data.length, protectionDomain);
     }
 



Mime
View raw message