comparison src/share/vm/runtime/fieldDescriptor.cpp @ 6940:18fb7da42534

8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass Summary: Change types of above methods and field to InstanceKlass and remove unneeded casts from the source files. Reviewed-by: dholmes, coleenp, zgu Contributed-by: harold.seigel@oracle.com
author coleenp
date Tue, 06 Nov 2012 15:09:37 -0500
parents da91efe96a93
children 35431a769282
comparison
equal deleted inserted replaced
6939:c284cf4781f0 6940:18fb7da42534
34 #include "runtime/handles.inline.hpp" 34 #include "runtime/handles.inline.hpp"
35 #include "runtime/signature.hpp" 35 #include "runtime/signature.hpp"
36 36
37 37
38 oop fieldDescriptor::loader() const { 38 oop fieldDescriptor::loader() const {
39 return InstanceKlass::cast(_cp->pool_holder())->class_loader(); 39 return _cp->pool_holder()->class_loader();
40 } 40 }
41 41
42 Symbol* fieldDescriptor::generic_signature() const { 42 Symbol* fieldDescriptor::generic_signature() const {
43 if (!has_generic_signature()) { 43 if (!has_generic_signature()) {
44 return NULL; 44 return NULL;
45 } 45 }
46 46
47 int idx = 0; 47 int idx = 0;
48 InstanceKlass* ik = InstanceKlass::cast(field_holder()); 48 InstanceKlass* ik = field_holder();
49 for (AllFieldStream fs(ik); !fs.done(); fs.next()) { 49 for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
50 if (idx == _index) { 50 if (idx == _index) {
51 return fs.generic_signature(); 51 return fs.generic_signature();
52 } else { 52 } else {
53 idx ++; 53 idx ++;
56 assert(false, "should never happen"); 56 assert(false, "should never happen");
57 return NULL; 57 return NULL;
58 } 58 }
59 59
60 AnnotationArray* fieldDescriptor::annotations() const { 60 AnnotationArray* fieldDescriptor::annotations() const {
61 InstanceKlass* ik = InstanceKlass::cast(field_holder()); 61 InstanceKlass* ik = field_holder();
62 Array<AnnotationArray*>* md = ik->fields_annotations(); 62 Array<AnnotationArray*>* md = ik->fields_annotations();
63 if (md == NULL) 63 if (md == NULL)
64 return NULL; 64 return NULL;
65 return md->at(index()); 65 return md->at(index());
66 } 66 }