src/share/vm/prims/jvm.cpp

Print this page




1394   Thread* thread = THREAD;
1395   const int inner_class_info_index = inner_class_inner_class_info_offset;
1396   const int outer_class_info_index = inner_class_outer_class_info_offset;
1397 
1398   if (k->inner_classes()->length() == 0) {
1399     // No inner class info => no declaring class
1400     return NULL;
1401   }
1402 
1403   typeArrayHandle i_icls(thread, k->inner_classes());
1404   constantPoolHandle i_cp(thread, k->constants());
1405   int i_length = i_icls->length();
1406 
1407   bool found = false;
1408   klassOop ok;
1409   instanceKlassHandle outer_klass;
1410   *inner_is_member = false;
1411 
1412   // Find inner_klass attribute
1413   for (int i = 0; i < i_length && !found; i += inner_class_next_offset) {



1414     int ioff = i_icls->ushort_at(i + inner_class_info_index);
1415     int ooff = i_icls->ushort_at(i + outer_class_info_index);
1416     int noff = i_icls->ushort_at(i + inner_class_inner_name_offset);
1417     if (ioff != 0) {
1418       // Check to see if the name matches the class we're looking for
1419       // before attempting to find the class.
1420       if (i_cp->klass_name_at_matches(k, ioff)) {
1421         klassOop inner_klass = i_cp->klass_at(ioff, CHECK_NULL);
1422         found = (k() == inner_klass);
1423         if (found && ooff != 0) {
1424           ok = i_cp->klass_at(ooff, CHECK_NULL);
1425           outer_klass = instanceKlassHandle(thread, ok);
1426           *inner_is_member = true;
1427         }
1428       }
1429     }
1430   }
1431 
1432   if (found && outer_klass.is_null()) {
1433     // It may be anonymous; try for that.




1394   Thread* thread = THREAD;
1395   const int inner_class_info_index = inner_class_inner_class_info_offset;
1396   const int outer_class_info_index = inner_class_outer_class_info_offset;
1397 
1398   if (k->inner_classes()->length() == 0) {
1399     // No inner class info => no declaring class
1400     return NULL;
1401   }
1402 
1403   typeArrayHandle i_icls(thread, k->inner_classes());
1404   constantPoolHandle i_cp(thread, k->constants());
1405   int i_length = i_icls->length();
1406 
1407   bool found = false;
1408   klassOop ok;
1409   instanceKlassHandle outer_klass;
1410   *inner_is_member = false;
1411 
1412   // Find inner_klass attribute
1413   for (int i = 0; i < i_length && !found; i += inner_class_next_offset) {
1414     if (i == i_length - instanceKlass::enclosing_method_attribute_size) {
1415       break;
1416     }
1417     int ioff = i_icls->ushort_at(i + inner_class_info_index);
1418     int ooff = i_icls->ushort_at(i + outer_class_info_index);
1419     int noff = i_icls->ushort_at(i + inner_class_inner_name_offset);
1420     if (ioff != 0) {
1421       // Check to see if the name matches the class we're looking for
1422       // before attempting to find the class.
1423       if (i_cp->klass_name_at_matches(k, ioff)) {
1424         klassOop inner_klass = i_cp->klass_at(ioff, CHECK_NULL);
1425         found = (k() == inner_klass);
1426         if (found && ooff != 0) {
1427           ok = i_cp->klass_at(ooff, CHECK_NULL);
1428           outer_klass = instanceKlassHandle(thread, ok);
1429           *inner_is_member = true;
1430         }
1431       }
1432     }
1433   }
1434 
1435   if (found && outer_klass.is_null()) {
1436     // It may be anonymous; try for that.