harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r526221 - in /harmony/enhanced/drlvm/trunk/vm/vmcore: include/Class.h include/classloader.h include/unloading.h src/class_support/Class.cpp src/class_support/classloader.cpp src/gc/stop_the_world_root_set_enum.cpp src/init/vm_shutdown.cpp
Date Fri, 06 Apr 2007 16:37:45 GMT
Author: gshimansky
Date: Fri Apr  6 09:37:43 2007
New Revision: 526221

URL: http://svn.apache.org/viewvc?view=rev&rev=526221
Log:
Applied HARMONY-3411 [drlvm][classloader] dead code cleanup in classloader


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/unloading.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h?view=diff&rev=526221&r1=526220&r2=526221
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h Fri Apr  6 09:37:43 2007
@@ -1021,9 +1021,6 @@
     // SourceDebugExtension class attribute support
     String* m_sourceDebugExtension;
 
-    // struct Class accessibility for unloading
-    unsigned m_markBit:1;
-
     // verifier private data pointer
     void* m_verify_data;
 
@@ -1749,20 +1746,6 @@
     const char* get_source_debug_extension() const {
         return m_sourceDebugExtension->bytes;
     }
-
-    // Class unloading support
-
-   /** Checks whether the given class is reachable through its loader
-    * or any live object.
-    * @return <code>true</code> if the given class is reachable, 
-    *         otherwise <code>false</code>.*/
-    bool is_reachable() { return m_markBit == 1; }
-
-    /** Clears a reachability mark.*/
-    void reset_reachable() { m_markBit = 0; }
-
-    /** Marks the given class as reachable.*/
-    void mark_reachable() { m_markBit = 1; }
 
     /** Stores a verifier specific pointer into the given class.
      * @param[in] data - a verifier specific data pointer*/

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h?view=diff&rev=526221&r1=526220&r2=526221
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h Fri Apr  6 09:37:43 2007
@@ -155,8 +155,7 @@
 public:
     ClassLoader() : m_loader(NULL), m_parent(NULL), m_name(NULL), m_package_table(NULL),

         m_loadedClasses(NULL), m_loadingClasses(NULL), m_reportedClasses(NULL),
-        m_javaTypes(NULL), m_nativeLibraries(NULL), m_markBit(0),
-        m_unloading(false), m_fullSize(0), m_verifyData(NULL)
+        m_javaTypes(NULL), m_nativeLibraries(NULL), m_verifyData(NULL)
     {
         apr_pool_create(&pool, 0);
     }
@@ -209,9 +208,6 @@
 
 public:
     bool IsBootstrap() { return m_loader == NULL; }
-    void Mark() { m_markBit = 1; }
-    bool NotMarked() { return (m_markBit == 0); }
-    unsigned GetFullSize();
     ManagedObject* GetLoader() { return m_loader; }
     const String* GetName() { return m_name; }
     ClassLoader* GetParent() { return m_parent; }
@@ -229,9 +225,6 @@
     VMEXPORT static ClassLoader* LookupLoader( ManagedObject* loader );
     static void UnloadClassLoader( ManagedObject* loader );
     static void gc_enumerate();
-    static void ClearMarkBits();
-    static void StartUnloading();
-    static void PrintUnloadingStats();
     static unsigned GetClassLoaderNumber() { return m_nextEntry; }
     static ClassLoader** GetClassLoaderTable() { return m_table; }
     static void DeleteClassLoaderTable(){
@@ -280,9 +273,6 @@
     NativeLibraryList m_nativeLibraries;
     Lock_Manager m_lock;
     Lock_Manager m_types_cache_lock;
-    unsigned m_markBit:1;
-    unsigned m_unloading;
-    unsigned m_fullSize;
     void* m_verifyData;
     apr_pool_t* pool;
     PoolManager *CodeMemoryManager;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/unloading.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/unloading.h?view=diff&rev=526221&r1=526220&r2=526221
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/unloading.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/unloading.h Fri Apr  6 09:37:43 2007
@@ -22,8 +22,5 @@
 #ifndef __UNLOADING_H__
 #define __UNLOADING_H__
 
-void class_unloading_clear_mark_bits();
-void class_unloading_start();
-
 #endif
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp?view=diff&rev=526221&r1=526220&r2=526221
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp Fri Apr  6 09:37:43
2007
@@ -141,7 +141,6 @@
 
     m_sourceDebugExtension = NULL;
     m_lock = new Lock_Manager();
-    m_markBit = 0;
     m_verify_data = 0;
 }
 
@@ -919,17 +918,6 @@
     }
     String* str = VM_Global_State::loader_env->string_pool.lookup(name);
     return str;
-}
-
-
-static void mark_classloader(ClassLoader* cl)
-{
-    if(cl->GetLoader() && cl->NotMarked()) {
-        TRACE2("classloader.unloading.markloader", "  Marking loader "
-            << cl << " (" << (void*)cl->GetLoader() << " : "
-            << cl->GetLoader()->vt()->clss->get_name()->bytes <<
")");
-        cl->Mark();
-    }
 }
 
 

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=526221&r1=526220&r2=526221
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Fri Apr  6 09:37:43
2007
@@ -488,104 +488,6 @@
 }
 
 
-void ClassLoader::ClearMarkBits()
-{
-    TRACE2("classloader.unloading.clear", "Clearing mark bits");
-    LMAutoUnlock aulock( &(ClassLoader::m_tableLock) );
-    ClassTable::iterator cti;
-    unsigned i;
-    for(i = 0; i < m_nextEntry; i++) {
-        if(m_table[i]->m_unloading) {
-            TRACE2("classloader.unloading.debug", "  Skipping \"unloaded\" classloader "
-                << m_table[i] << " (" << m_table[i]->m_loader <<
" : "
-                << ((VTable*)(*(unsigned**)(m_table[i]->m_loader)))->clss->get_name()->bytes
<< ")");
-            continue;
-        }
-        TRACE2("classloader.unloading.debug", "  Clearing mark bits in classloader "
-            << m_table[i] << " (" << m_table[i]->m_loader << "
: "
-            << ((VTable*)(*(unsigned**)(m_table[i]->m_loader)))->clss->get_name()->bytes
<< ") and its classes");
-        // clear mark bits in loader and classes
-        m_table[i]->m_markBit = 0;
-        for(cti = m_table[i]->m_loadedClasses->begin();
-            cti != m_table[i]->m_loadedClasses->end(); cti++)
-        {
-            if(cti->second->get_class_loader() == m_table[i]) {
-                cti->second->reset_reachable();
-             }
-         }
-     }
-    TRACE2("classloader.unloading.clear", "Finished clearing mark bits");
-    TRACE2("classloader.unloading.marking", "Starting mark loaders");
-}
-
-
-void ClassLoader::StartUnloading()
-{
-    TRACE2("classloader.unloading.marking", "Finished marking loaders");
-    TRACE2("classloader.unloading.do", "Start checking loaders ready to be unloaded");
-    LMAutoUnlock aulock( &(ClassLoader::m_tableLock) );
-    unsigned i;
-    for(i = 0; i < m_nextEntry; i++) {
-        if(m_table[i]->m_unloading) {
-            TRACE2("classloader.unloading.debug", "  Skipping \"unloaded\" classloader "
-                << m_table[i] << " (" << m_table[i]->m_loader <<
" : "
-                << ((VTable*)(*(unsigned**)(m_table[i]->m_loader)))->clss->get_name()->bytes
<< ")");
-            continue;
-        }
-        TRACE2("classloader.unloading.debug", "  Scanning loader "
-            << m_table[i] << " (" << m_table[i]->m_loader << "
: "
-            << ((VTable*)(*(unsigned**)(m_table[i]->m_loader)))->clss->get_name()->bytes
<< ")");
-        if(!m_table[i]->m_markBit) {
-            TRACE2("classloader.unloading.stats", "  (!) Ready to unload classloader "
-                << m_table[i] << " (" << m_table[i]->m_loader <<
" : "
-                << ((VTable*)(*(unsigned**)(m_table[i]->m_loader)))->clss->get_name()->bytes
<< ")");
-            TRACE2("classloader.unloading.stats", "  (!) This will free "
-                << m_table[i]->GetFullSize() << " bytes in C heap");
-            m_table[i]->m_unloading = true;
-            m_unloadedBytes += m_table[i]->GetFullSize();
-        }
-    }
-    TRACE2("classloader.unloading.do", "Finished checking loaders");
-}
-
-
-void ClassLoader::PrintUnloadingStats()
-{
-    unsigned i;
-    TRACE2("classloader.unloading.stats", "----------------------------------------------");
-    TRACE2("classloader.unloading.stats", "Class unloading statistics:");
-    hythread_suspend_disable();
-    for(i = 0; i < m_nextEntry; i++) {
-        if(m_table[i]->m_unloading) {
-            TRACE2("classloader.unloading.stats", "  Class loader "
-                << m_table[i] << " (" << m_table[i]->m_loader <<
" : "
-                << ((VTable*)(*(unsigned**)(m_table[i]->m_loader)))->clss->get_name()->bytes
-                << ") contains " << m_table[i]->GetFullSize() << " bytes
in C heap");
-        }
-    }
-    hythread_suspend_enable();
-    TRACE2("classloader.unloading.stats", "A total of "
-        << m_unloadedBytes << " bytes would be freed in C heap for this scenario");
-    TRACE2("classloader.unloading.stats", "----------------------------------------------");
-}
-
-
-void vm_classloader_iterate_objects(void *iterator) {
-
-    // skip the object iteration if it is not needed
-    // (logging is not enabled and 
-    // class unloading is not yet implemented).
-    if (!is_info_enabled("class_unload")) return;
-
-    Managed_Object_Handle obj;
-    int nobjects = 0;
-    while((obj = gc_get_next_live_object(iterator))) {
-        nobjects++;
-    }
-    INFO2("class_unload", "classloader_iterate_objects " << nobjects << " iterated");
-}
-
-
 ClassLoader* ClassLoader::AddClassLoader( ManagedObject* loader )
 {
     SuspendDisabledChecker sdc;
@@ -717,22 +619,6 @@
 }
 
 
-unsigned ClassLoader::GetFullSize() {
-    if(m_fullSize)
-        return m_fullSize;
-    m_fullSize = sizeof(ClassLoader);
-    ClassTable::iterator cti;
-    for(cti = m_loadedClasses->begin();
-        cti != m_loadedClasses->end(); cti++)
-    {
-        if(cti->second->get_class_loader() == this) {
-            m_fullSize += cti->second->calculate_size();
-        }
-    }
-    return m_fullSize;
-}
-
-
 Class* ClassLoader::WaitDefinition(Global_Env* env, const String* className)
 {
     VM_thread* cur_thread = get_thread_ptr();
@@ -1113,14 +999,6 @@
     exn_raise_object(exc_object);
 
     return NULL;
-}
-
-void class_unloading_clear_mark_bits() {
-    ClassLoader::ClearMarkBits();
-}
-
-void class_unloading_start() {
-    ClassLoader::StartUnloading();
 }
 
 inline void

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp?view=diff&rev=526221&r1=526220&r2=526221
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp Fri Apr
 6 09:37:43 2007
@@ -98,8 +98,6 @@
 
     jvmti_send_gc_start_event();
 
-    class_unloading_clear_mark_bits();
-
     current_vm_thread = p_TLS_vmthread;
     // Run through list of active threads and enumerate each one of them.
     hythread_t tm_thread = hythread_iterator_next(&iterator);    
@@ -162,8 +160,6 @@
     global_safepoint_status = nill;
     assert(p_the_safepoint_control_thread == p_TLS_vmthread);
     p_the_safepoint_control_thread = 0;
-
-    class_unloading_start();
 
     jvmti_send_gc_finish_event();
     jvmti_clean_reclaimed_object_tags();

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp?view=diff&rev=526221&r1=526220&r2=526221
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp Fri Apr  6 09:37:43 2007
@@ -172,7 +172,6 @@
 
     // Print out gathered data.
 #ifdef VM_STATS
-    ClassLoader::PrintUnloadingStats();
     VM_Statistics::get_vm_stats().print();
 #endif
 



Mime
View raw message