Пример #1
0
 // add the basic type array class and its multi-dimensional array classes to the list
 static void add_for_basic_type_arrays(Klass* k) {
   JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
   assert(that != NULL, "no JvmtiGetLoadedClassesClosure");
   assert(that->available(), "no list");
   for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
     oop mirror = l->java_mirror();
     that->set_element(that->get_index(), mirror);
     that->set_index(that->get_index() + 1);
   }
 }
Пример #2
0
 static void add_with_loader(klassOop k, oop loader) {
   JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
   if (that->available()) {
     if (loader == JNIHandles::resolve(that->get_initiatingLoader())) {
       for (klassOop l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
         oop mirror = Klass::cast(l)->java_mirror();
         that->set_element(that->get_index(), mirror);
         that->set_index(that->get_index() + 1);
       }
     }
   }
 }
Пример #3
0
 static void add_with_loader(Klass* k, ClassLoaderData* loader_data) {
   JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
   if (that->available()) {
     oop class_loader = loader_data->class_loader();
     if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
       for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
         oop mirror = l->java_mirror();
         that->set_element(that->get_index(), mirror);
         that->set_index(that->get_index() + 1);
       }
     }
   }
 }
Пример #4
0
 static void add(klassOop k) {
   JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
   if (that->available()) {
     if (that->get_initiatingLoader() == NULL) {
       for (klassOop l = k; l != NULL; l = Klass::cast(l)->array_klass_or_null()) {
         oop mirror = Klass::cast(l)->java_mirror();
         that->set_element(that->get_index(), mirror);
         that->set_index(that->get_index() + 1);
       }
     } else if (k != NULL) {
       // if initiating loader not null, just include the instance with 1 dimension
       oop mirror = Klass::cast(k)->java_mirror();
       that->set_element(that->get_index(), mirror);
       that->set_index(that->get_index() + 1);
     }
   }
 }