comparison src/share/vm/runtime/reflection.cpp @ 5967:f7c4174b33ba

7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field. Summary: Fold instanceKlass::_enclosing_method_class_index and instanceKlass::_enclosing_method_method_index into the instanceKlass::_inner_classes array. Reviewed-by: never, coleenp Contributed-by: Jiangli Zhou <jiangli.zhou@oracle.com>
author jiangli
date Tue, 13 Mar 2012 13:50:48 -0400
parents 19241ae0d839
children 634b8615a6ba
comparison
equal deleted inserted replaced
5933:fde683df4c27 5967:f7c4174b33ba
589 // If inner_is_member, require the inner to be a member of the outer. 589 // If inner_is_member, require the inner to be a member of the outer.
590 // If !inner_is_member, require the inner to be anonymous (a non-member). 590 // If !inner_is_member, require the inner to be anonymous (a non-member).
591 // Caller is responsible for figuring out in advance which case must be true. 591 // Caller is responsible for figuring out in advance which case must be true.
592 void Reflection::check_for_inner_class(instanceKlassHandle outer, instanceKlassHandle inner, 592 void Reflection::check_for_inner_class(instanceKlassHandle outer, instanceKlassHandle inner,
593 bool inner_is_member, TRAPS) { 593 bool inner_is_member, TRAPS) {
594 const int inner_class_info_index = 0; 594 InnerClassesIterator iter(outer);
595 const int outer_class_info_index = 1;
596
597 typeArrayHandle icls (THREAD, outer->inner_classes());
598 constantPoolHandle cp (THREAD, outer->constants()); 595 constantPoolHandle cp (THREAD, outer->constants());
599 for(int i = 0; i < icls->length(); i += 4) { 596 for (; !iter.done(); iter.next()) {
600 int ioff = icls->ushort_at(i + inner_class_info_index); 597 int ioff = iter.inner_class_info_index();
601 int ooff = icls->ushort_at(i + outer_class_info_index); 598 int ooff = iter.outer_class_info_index();
602 599
603 if (inner_is_member && ioff != 0 && ooff != 0) { 600 if (inner_is_member && ioff != 0 && ooff != 0) {
604 klassOop o = cp->klass_at(ooff, CHECK); 601 klassOop o = cp->klass_at(ooff, CHECK);
605 if (o == outer()) { 602 if (o == outer()) {
606 klassOop i = cp->klass_at(ioff, CHECK); 603 klassOop i = cp->klass_at(ioff, CHECK);