hotspot/src/share/vm/runtime/fieldDescriptor.cpp
changeset 14391 df0a1573d5bd
parent 13728 882756847a04
child 15097 9db149412e0e
equal deleted inserted replaced
14390:bd0d881cf1c5 14391:df0a1573d5bd
    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 }