src/hotspot/share/oops/instanceKlass.hpp
changeset 50735 2f2af62dfac7
parent 50634 c349d409262a
child 50746 85789fb05154
equal deleted inserted replaced
50734:0828a0f6676b 50735:2f2af62dfac7
   163   // number_of_inner_classes * 4. If the class has both InnerClasses
   163   // number_of_inner_classes * 4. If the class has both InnerClasses
   164   // and EnclosingMethod attributes the _inner_classes array length is
   164   // and EnclosingMethod attributes the _inner_classes array length is
   165   // number_of_inner_classes * 4 + enclosing_method_attribute_size.
   165   // number_of_inner_classes * 4 + enclosing_method_attribute_size.
   166   Array<jushort>* _inner_classes;
   166   Array<jushort>* _inner_classes;
   167 
   167 
       
   168   // The NestMembers attribute. An array of shorts, where each is a
       
   169   // class info index for the class that is a nest member. This data
       
   170   // has not been validated.
       
   171   Array<jushort>* _nest_members;
       
   172 
       
   173   // The NestHost attribute. The class info index for the class
       
   174   // that is the nest-host of this class. This data has not been validated.
       
   175   jushort _nest_host_index;
       
   176 
       
   177   // Resolved nest-host klass: either true nest-host or self if we are not nested.
       
   178   // By always being set it makes nest-member access checks simpler.
       
   179   InstanceKlass* _nest_host;
       
   180 
   168   // the source debug extension for this klass, NULL if not specified.
   181   // the source debug extension for this klass, NULL if not specified.
   169   // Specified as UTF-8 string without terminating zero byte in the classfile,
   182   // Specified as UTF-8 string without terminating zero byte in the classfile,
   170   // it is stored in the instanceklass as a NULL-terminated UTF-8 string
   183   // it is stored in the instanceklass as a NULL-terminated UTF-8 string
   171   const char*     _source_debug_extension;
   184   const char*     _source_debug_extension;
   172   // Array name derived from this class which needs unreferencing
   185   // Array name derived from this class which needs unreferencing
   433 
   446 
   434   // inner classes
   447   // inner classes
   435   Array<u2>* inner_classes() const       { return _inner_classes; }
   448   Array<u2>* inner_classes() const       { return _inner_classes; }
   436   void set_inner_classes(Array<u2>* f)   { _inner_classes = f; }
   449   void set_inner_classes(Array<u2>* f)   { _inner_classes = f; }
   437 
   450 
       
   451   // nest members
       
   452   Array<u2>* nest_members() const     { return _nest_members; }
       
   453   void set_nest_members(Array<u2>* m) { _nest_members = m; }
       
   454 
       
   455   // nest-host index
       
   456   jushort nest_host_index() const { return _nest_host_index; }
       
   457   void set_nest_host_index(u2 i)  { _nest_host_index = i; }
       
   458 
       
   459 private:
       
   460   // Called to verify that k is a member of this nest - does not look at k's nest-host
       
   461   bool has_nest_member(InstanceKlass* k, TRAPS) const;
       
   462 public:
       
   463   // Returns nest-host class, resolving and validating it if needed
       
   464   // Returns NULL if an exception occurs during loading, or validation fails
       
   465   InstanceKlass* nest_host(Symbol* validationException, TRAPS);
       
   466   // Check if this klass is a nestmate of k - resolves this nest-host and k's
       
   467   bool has_nestmate_access_to(InstanceKlass* k, TRAPS);
       
   468 
   438   enum InnerClassAttributeOffset {
   469   enum InnerClassAttributeOffset {
   439     // From http://mirror.eng/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc10.html#18814
   470     // From http://mirror.eng/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc10.html#18814
   440     inner_class_inner_class_info_offset = 0,
   471     inner_class_inner_class_info_offset = 0,
   441     inner_class_outer_class_info_offset = 1,
   472     inner_class_outer_class_info_offset = 1,
   442     inner_class_inner_name_offset = 2,
   473     inner_class_inner_name_offset = 2,
   552   static Method* find_method(const Array<Method*>* methods,
   583   static Method* find_method(const Array<Method*>* methods,
   553                              const Symbol* name,
   584                              const Symbol* name,
   554                              const Symbol* signature);
   585                              const Symbol* signature);
   555 
   586 
   556   // find a local method, but skip static methods
   587   // find a local method, but skip static methods
   557   Method* find_instance_method(const Symbol* name, const Symbol* signature) const;
   588   Method* find_instance_method(const Symbol* name, const Symbol* signature,
       
   589                                PrivateLookupMode private_mode = find_private) const;
   558   static Method* find_instance_method(const Array<Method*>* methods,
   590   static Method* find_instance_method(const Array<Method*>* methods,
   559                                       const Symbol* name,
   591                                       const Symbol* name,
   560                                       const Symbol* signature);
   592                                       const Symbol* signature,
       
   593                                       PrivateLookupMode private_mode = find_private);
   561 
   594 
   562   // find a local method (returns NULL if not found)
   595   // find a local method (returns NULL if not found)
   563   Method* find_local_method(const Symbol* name,
   596   Method* find_local_method(const Symbol* name,
   564                             const Symbol* signature,
   597                             const Symbol* signature,
   565                             OverpassLookupMode overpass_mode,
   598                             OverpassLookupMode overpass_mode,
   583                                PrivateLookupMode private_mode);
   616                                PrivateLookupMode private_mode);
   584 
   617 
   585   // lookup operation (returns NULL if not found)
   618   // lookup operation (returns NULL if not found)
   586   Method* uncached_lookup_method(const Symbol* name,
   619   Method* uncached_lookup_method(const Symbol* name,
   587                                  const Symbol* signature,
   620                                  const Symbol* signature,
   588                                  OverpassLookupMode overpass_mode) const;
   621                                  OverpassLookupMode overpass_mode,
       
   622                                  PrivateLookupMode private_mode = find_private) const;
   589 
   623 
   590   // lookup a method in all the interfaces that this class implements
   624   // lookup a method in all the interfaces that this class implements
   591   // (returns NULL if not found)
   625   // (returns NULL if not found)
   592   Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature, DefaultsLookupMode defaults_mode) const;
   626   Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature, DefaultsLookupMode defaults_mode) const;
   593 
   627