< prev index next >

src/share/vm/services/classLoadingService.cpp

Print this page




 180   return class_size * oopSize;
 181 }
 182 
 183 bool ClassLoadingService::set_verbose(bool verbose) {
 184   MutexLocker m(Management_lock);
 185   // verbose will be set to the previous value
 186   LogLevelType level = verbose ? LogLevel::Info : LogLevel::Off;
 187   LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, load));
 188   reset_trace_class_unloading();
 189   return verbose;
 190 }
 191 
 192 // Caller to this function must own Management_lock
 193 void ClassLoadingService::reset_trace_class_unloading() {
 194   assert(Management_lock->owned_by_self(), "Must own the Management_lock");
 195   bool value = MemoryService::get_verbose() || ClassLoadingService::get_verbose();
 196   LogLevelType level = value ? LogLevel::Info : LogLevel::Off;
 197   LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, unload));
 198 }
 199 
 200 GrowableArray<KlassHandle>* LoadedClassesEnumerator::_loaded_classes = NULL;
 201 Thread* LoadedClassesEnumerator::_current_thread = NULL;
 202 
 203 LoadedClassesEnumerator::LoadedClassesEnumerator(Thread* cur_thread) {
 204   assert(cur_thread == Thread::current(), "Check current thread");
 205 
 206   int init_size = ClassLoadingService::loaded_class_count();
 207   _klass_handle_array = new GrowableArray<KlassHandle>(init_size);
 208 
 209   // For consistency of the loaded classes, grab the SystemDictionary lock
 210   MutexLocker sd_mutex(SystemDictionary_lock);
 211 
 212   // Set _loaded_classes and _current_thread and begin enumerating all classes.
 213   // Only one thread will do the enumeration at a time.
 214   // These static variables are needed and they are used by the static method
 215   // add_loaded_class called from classes_do().
 216   _loaded_classes = _klass_handle_array;
 217   _current_thread = cur_thread;
 218 
 219   SystemDictionary::classes_do(&add_loaded_class);
 220 
 221   // FIXME: Exclude array klasses for now
 222   // Universe::basic_type_classes_do(&add_loaded_class);
 223 }
 224 
 225 #endif // INCLUDE_MANAGEMENT


 180   return class_size * oopSize;
 181 }
 182 
 183 bool ClassLoadingService::set_verbose(bool verbose) {
 184   MutexLocker m(Management_lock);
 185   // verbose will be set to the previous value
 186   LogLevelType level = verbose ? LogLevel::Info : LogLevel::Off;
 187   LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, load));
 188   reset_trace_class_unloading();
 189   return verbose;
 190 }
 191 
 192 // Caller to this function must own Management_lock
 193 void ClassLoadingService::reset_trace_class_unloading() {
 194   assert(Management_lock->owned_by_self(), "Must own the Management_lock");
 195   bool value = MemoryService::get_verbose() || ClassLoadingService::get_verbose();
 196   LogLevelType level = value ? LogLevel::Info : LogLevel::Off;
 197   LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, unload));
 198 }
 199 
 200 GrowableArray<Klass*>* LoadedClassesEnumerator::_loaded_classes = NULL;
 201 Thread* LoadedClassesEnumerator::_current_thread = NULL;
 202 
 203 LoadedClassesEnumerator::LoadedClassesEnumerator(Thread* cur_thread) {
 204   assert(cur_thread == Thread::current(), "Check current thread");
 205 
 206   int init_size = ClassLoadingService::loaded_class_count();
 207   _klass_array = new GrowableArray<Klass*>(init_size);
 208 
 209   // For consistency of the loaded classes, grab the SystemDictionary lock
 210   MutexLocker sd_mutex(SystemDictionary_lock);
 211 
 212   // Set _loaded_classes and _current_thread and begin enumerating all classes.
 213   // Only one thread will do the enumeration at a time.
 214   // These static variables are needed and they are used by the static method
 215   // add_loaded_class called from classes_do().
 216   _loaded_classes = _klass_array;
 217   _current_thread = cur_thread;
 218 
 219   SystemDictionary::classes_do(&add_loaded_class);
 220 
 221   // FIXME: Exclude array klasses for now
 222   // Universe::basic_type_classes_do(&add_loaded_class);
 223 }
 224 
 225 #endif // INCLUDE_MANAGEMENT
< prev index next >