mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-20 20:00:28 +00:00
8176831: Dead code: function jmm_GetLoadedClasses is not used in jmm_interface
Remove the dead code Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
8838ae7b46
commit
6aa1dfbcf4
@ -197,26 +197,4 @@ void ClassLoadingService::reset_trace_class_unloading() {
|
||||
LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, unload));
|
||||
}
|
||||
|
||||
GrowableArray<Klass*>* LoadedClassesEnumerator::_loaded_classes = NULL;
|
||||
|
||||
LoadedClassesEnumerator::LoadedClassesEnumerator() {
|
||||
|
||||
int init_size = ClassLoadingService::loaded_class_count();
|
||||
_klass_array = new GrowableArray<Klass*>(init_size);
|
||||
|
||||
// For consistency of the loaded classes, grab the SystemDictionary lock
|
||||
MutexLocker sd_mutex(SystemDictionary_lock);
|
||||
|
||||
// Set _loaded_classes and begin enumerating all classes.
|
||||
// Only one thread will do the enumeration at a time.
|
||||
// These static variables are needed and they are used by the static method
|
||||
// add_loaded_class called from classes_do().
|
||||
_loaded_classes = _klass_array;
|
||||
|
||||
SystemDictionary::classes_do(&add_loaded_class);
|
||||
|
||||
// FIXME: Exclude array klasses for now
|
||||
// Universe::basic_type_classes_do(&add_loaded_class);
|
||||
}
|
||||
|
||||
#endif // INCLUDE_MANAGEMENT
|
||||
|
||||
@ -117,28 +117,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME: make this piece of code to be shared by M&M and JVMTI
|
||||
class LoadedClassesEnumerator : public StackObj {
|
||||
private:
|
||||
static GrowableArray<Klass*>* _loaded_classes;
|
||||
GrowableArray<Klass*>* _klass_array;
|
||||
|
||||
public:
|
||||
LoadedClassesEnumerator();
|
||||
|
||||
int num_loaded_classes() { return _klass_array->length(); }
|
||||
Klass* get_klass(int index) { return _klass_array->at(index); }
|
||||
|
||||
static void add_loaded_class(Klass* k) {
|
||||
// FIXME: For now - don't include array klasses
|
||||
// The spec is unclear at this point to count array klasses or not
|
||||
// and also indirect creation of array of super class and secondaries
|
||||
//
|
||||
// for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
|
||||
// _loaded_classes->append(l);
|
||||
// }
|
||||
_loaded_classes->append(k);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_SERVICES_CLASSLOADINGSERVICE_HPP
|
||||
|
||||
@ -1291,25 +1291,6 @@ JVM_ENTRY(jobjectArray, jmm_DumpThreads(JNIEnv *env, jlongArray thread_ids, jboo
|
||||
return (jobjectArray) JNIHandles::make_local(env, result_h());
|
||||
JVM_END
|
||||
|
||||
// Returns an array of Class objects.
|
||||
JVM_ENTRY(jobjectArray, jmm_GetLoadedClasses(JNIEnv *env))
|
||||
ResourceMark rm(THREAD);
|
||||
|
||||
LoadedClassesEnumerator lce;
|
||||
|
||||
int num_classes = lce.num_loaded_classes();
|
||||
objArrayOop r = oopFactory::new_objArray(SystemDictionary::Class_klass(), num_classes, CHECK_0);
|
||||
objArrayHandle classes_ah(THREAD, r);
|
||||
|
||||
for (int i = 0; i < num_classes; i++) {
|
||||
Klass* k = lce.get_klass(i);
|
||||
oop mirror = k->java_mirror();
|
||||
classes_ah->obj_at_put(i, mirror);
|
||||
}
|
||||
|
||||
return (jobjectArray) JNIHandles::make_local(env, classes_ah());
|
||||
JVM_END
|
||||
|
||||
// Reset statistic. Return true if the requested statistic is reset.
|
||||
// Otherwise, return false.
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user