< prev index next >
src/hotspot/share/oops/instanceKlass.hpp
Print this page
@@ -160,10 +160,23 @@
// number_of_inner_classes * 4. If the class has both InnerClasses
// and EnclosingMethod attributes the _inner_classes array length is
// number_of_inner_classes * 4 + enclosing_method_attribute_size.
Array<jushort>* _inner_classes;
+ // The NestMembers attribute. An array of shorts, where each is a
+ // class info index for the class that is a nest member. This data
+ // has not been validated.
+ Array<jushort>* _nest_members;
+
+ // The NestHost attribute. The class info index for the class
+ // that is the nest-host of this class. This data has not been validated.
+ jushort _nest_host_index;
+
+ // Resolved nest-host klass: either true nest-host or self if we are not nested.
+ // By always being set it makes nest-member access checks simpler.
+ InstanceKlass* _nest_host;
+
// the source debug extension for this klass, NULL if not specified.
// Specified as UTF-8 string without terminating zero byte in the classfile,
// it is stored in the instanceklass as a NULL-terminated UTF-8 string
const char* _source_debug_extension;
// Array name derived from this class which needs unreferencing
@@ -426,10 +439,28 @@
// inner classes
Array<u2>* inner_classes() const { return _inner_classes; }
void set_inner_classes(Array<u2>* f) { _inner_classes = f; }
+ // nest members
+ Array<u2>* nest_members() const { return _nest_members; }
+ void set_nest_members(Array<u2>* m) { _nest_members = m; }
+
+ // nest-host index
+ jushort nest_host_index() const { return _nest_host_index; }
+ void set_nest_host_index(u2 i) { _nest_host_index = i; }
+
+ // Returns nest-host class, resolving and validating it if needed
+ // Returns NULL if an exception occurs during loading, or validation fails
+ InstanceKlass* nest_host(Symbol* validationException, TRAPS);
+ InstanceKlass* raw_nest_host() { return _nest_host; } // debugging
+
+ // Called to verify that k is a member of this nest - does not look at k's nest-host
+ bool has_nest_member(InstanceKlass* k, TRAPS) const;
+ // Check if this klass is a nestmate of k - resolves this nest-host and k's
+ bool has_nestmate_access_to(InstanceKlass* k, TRAPS);
+
enum InnerClassAttributeOffset {
// From http://mirror.eng/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc10.html#18814
inner_class_inner_class_info_offset = 0,
inner_class_outer_class_info_offset = 1,
inner_class_inner_name_offset = 2,
@@ -545,14 +576,16 @@
static Method* find_method(const Array<Method*>* methods,
const Symbol* name,
const Symbol* signature);
// find a local method, but skip static methods
- Method* find_instance_method(const Symbol* name, const Symbol* signature) const;
+ Method* find_instance_method(const Symbol* name, const Symbol* signature,
+ PrivateLookupMode private_mode = find_private) const;
static Method* find_instance_method(const Array<Method*>* methods,
const Symbol* name,
- const Symbol* signature);
+ const Symbol* signature,
+ PrivateLookupMode private_mode = find_private);
// find a local method (returns NULL if not found)
Method* find_local_method(const Symbol* name,
const Symbol* signature,
OverpassLookupMode overpass_mode,
@@ -576,11 +609,12 @@
PrivateLookupMode private_mode);
// lookup operation (returns NULL if not found)
Method* uncached_lookup_method(const Symbol* name,
const Symbol* signature,
- OverpassLookupMode overpass_mode) const;
+ OverpassLookupMode overpass_mode,
+ PrivateLookupMode private_mode = find_private) const;
// lookup a method in all the interfaces that this class implements
// (returns NULL if not found)
Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature, DefaultsLookupMode defaults_mode) const;
< prev index next >