src/share/vm/oops/instanceKlass.hpp

changeset 4572
927a311d00f9
parent 4544
3c9bc17b9403
child 4693
872b3feace55
child 4712
3efdfd6ddbf2
     1.1 --- a/src/share/vm/oops/instanceKlass.hpp	Fri Feb 08 16:56:03 2013 -0800
     1.2 +++ b/src/share/vm/oops/instanceKlass.hpp	Mon Feb 11 14:06:22 2013 -0500
     1.3 @@ -155,8 +155,8 @@
     1.4                                            ReferenceType rt,
     1.5                                            AccessFlags access_flags,
     1.6                                            Symbol* name,
     1.7 -                                        Klass* super_klass,
     1.8 -                                          KlassHandle host_klass,
     1.9 +                                          Klass* super_klass,
    1.10 +                                          bool is_anonymous,
    1.11                                            TRAPS);
    1.12  
    1.13    InstanceKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
    1.14 @@ -679,19 +679,19 @@
    1.15    // annotations support
    1.16    Annotations* annotations() const          { return _annotations; }
    1.17    void set_annotations(Annotations* anno)   { _annotations = anno; }
    1.18 +
    1.19    AnnotationArray* class_annotations() const {
    1.20 -    if (annotations() == NULL) return NULL;
    1.21 -    return annotations()->class_annotations();
    1.22 +    return (_annotations != NULL) ? _annotations->class_annotations() : NULL;
    1.23    }
    1.24    Array<AnnotationArray*>* fields_annotations() const {
    1.25 -    if (annotations() == NULL) return NULL;
    1.26 -    return annotations()->fields_annotations();
    1.27 +    return (_annotations != NULL) ? _annotations->fields_annotations() : NULL;
    1.28    }
    1.29 -  Annotations* type_annotations() const {
    1.30 -    if (annotations() == NULL) return NULL;
    1.31 -    return annotations()->type_annotations();
    1.32 +  AnnotationArray* class_type_annotations() const {
    1.33 +    return (_annotations != NULL) ? _annotations->class_type_annotations() : NULL;
    1.34    }
    1.35 -
    1.36 +  Array<AnnotationArray*>* fields_type_annotations() const {
    1.37 +    return (_annotations != NULL) ? _annotations->fields_type_annotations() : NULL;
    1.38 +  }
    1.39    // allocation
    1.40    instanceOop allocate_instance(TRAPS);
    1.41  
    1.42 @@ -810,6 +810,7 @@
    1.43  
    1.44    // Sizing (in words)
    1.45    static int header_size()            { return align_object_offset(sizeof(InstanceKlass)/HeapWordSize); }
    1.46 +
    1.47    static int size(int vtable_length, int itable_length,
    1.48                    int nonstatic_oop_map_size,
    1.49                    bool is_interface, bool is_anonymous) {
    1.50 @@ -847,10 +848,14 @@
    1.51      return (OopMapBlock*)(start_of_itable() + align_object_offset(itable_length()));
    1.52    }
    1.53  
    1.54 +  Klass** end_of_nonstatic_oop_maps() const {
    1.55 +    return (Klass**)(start_of_nonstatic_oop_maps() +
    1.56 +                     nonstatic_oop_map_count());
    1.57 +  }
    1.58 +
    1.59    Klass** adr_implementor() const {
    1.60      if (is_interface()) {
    1.61 -      return (Klass**)(start_of_nonstatic_oop_maps() +
    1.62 -                    nonstatic_oop_map_count());
    1.63 +      return (Klass**)end_of_nonstatic_oop_maps();
    1.64      } else {
    1.65        return NULL;
    1.66      }
    1.67 @@ -862,8 +867,7 @@
    1.68        if (adr_impl != NULL) {
    1.69          return adr_impl + 1;
    1.70        } else {
    1.71 -        return (Klass**)(start_of_nonstatic_oop_maps() +
    1.72 -                      nonstatic_oop_map_count());
    1.73 +        return end_of_nonstatic_oop_maps();
    1.74        }
    1.75      } else {
    1.76        return NULL;

mercurial