< prev index next >

src/share/vm/prims/jvmtiGetLoadedClasses.cpp

Print this page




 196       _count = 0;
 197     }
 198   }
 199 
 200   void extract(JvmtiEnv *env, jclass* result) {
 201     for (int index = 0; index < _count; index += 1) {
 202       result[index] = (jclass) env->jni_reference(get_element(index));
 203     }
 204   }
 205 
 206   static void increment_with_loader(Klass* k, ClassLoaderData* loader_data) {
 207     JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
 208     oop class_loader = loader_data->class_loader();
 209     if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
 210       for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
 211         that->set_count(that->get_count() + 1);
 212       }
 213     }
 214   }
 215 
 216   static void prim_array_increment_with_loader(Klass* array, ClassLoaderData* loader_data) {
 217     JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
 218     oop class_loader = loader_data->class_loader();
 219     if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
 220       that->set_count(that->get_count() + 1);
 221     }
 222   }
 223 
 224   static void add_with_loader(Klass* k, ClassLoaderData* loader_data) {
 225     JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
 226     if (that->available()) {
 227       oop class_loader = loader_data->class_loader();
 228       if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
 229         Thread *thread = Thread::current();
 230         for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
 231           Handle mirror(thread, l->java_mirror());
 232           that->set_element(that->get_index(), mirror);
 233           that->set_index(that->get_index() + 1);
 234         }
 235       }
 236     }
 237   }
 238 
 239   // increment the count for the given basic type array class (and any
 240   // multi-dimensional arrays). For example, for [B we check for
 241   // [[B, [[[B, .. and the count is incremented for each one that exists.
 242   static void increment_for_basic_type_arrays(Klass* k) {
 243     JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();




 196       _count = 0;
 197     }
 198   }
 199 
 200   void extract(JvmtiEnv *env, jclass* result) {
 201     for (int index = 0; index < _count; index += 1) {
 202       result[index] = (jclass) env->jni_reference(get_element(index));
 203     }
 204   }
 205 
 206   static void increment_with_loader(Klass* k, ClassLoaderData* loader_data) {
 207     JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
 208     oop class_loader = loader_data->class_loader();
 209     if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
 210       for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
 211         that->set_count(that->get_count() + 1);
 212       }
 213     }
 214   }
 215 








 216   static void add_with_loader(Klass* k, ClassLoaderData* loader_data) {
 217     JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
 218     if (that->available()) {
 219       oop class_loader = loader_data->class_loader();
 220       if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
 221         Thread *thread = Thread::current();
 222         for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
 223           Handle mirror(thread, l->java_mirror());
 224           that->set_element(that->get_index(), mirror);
 225           that->set_index(that->get_index() + 1);
 226         }
 227       }
 228     }
 229   }
 230 
 231   // increment the count for the given basic type array class (and any
 232   // multi-dimensional arrays). For example, for [B we check for
 233   // [[B, [[[B, .. and the count is incremented for each one that exists.
 234   static void increment_for_basic_type_arrays(Klass* k) {
 235     JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();


< prev index next >