185 CDS_JAVA_HEAP_ONLY(narrowOop _archived_mirror;)
186
187 protected:
188
189 // Constructor
190 Klass(KlassID id);
191 Klass() : _id(KlassID(-1)) { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
192
193 void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw();
194
195 public:
196 int id() { return _id; }
197
198 enum DefaultsLookupMode { find_defaults, skip_defaults };
199 enum OverpassLookupMode { find_overpass, skip_overpass };
200 enum StaticLookupMode { find_static, skip_static };
201 enum PrivateLookupMode { find_private, skip_private };
202
203 bool is_klass() const volatile { return true; }
204
205 // super
206 Klass* super() const { return _super; }
207 void set_super(Klass* k) { _super = k; }
208
209 // initializes _super link, _primary_supers & _secondary_supers arrays
210 void initialize_supers(Klass* k, Array<Klass*>* transitive_interfaces, TRAPS);
211 void initialize_supers_impl1(Klass* k);
212 void initialize_supers_impl2(Klass* k);
213
214 // klass-specific helper for initializing _secondary_supers
215 virtual GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
216 Array<Klass*>* transitive_interfaces);
217
218 // java_super is the Java-level super type as specified by Class.getSuperClass.
219 virtual Klass* java_super() const { return NULL; }
220
221 juint super_check_offset() const { return _super_check_offset; }
222 void set_super_check_offset(juint o) { _super_check_offset = o; }
223
224 Klass* secondary_super_cache() const { return _secondary_super_cache; }
225 void set_secondary_super_cache(Klass* k) { _secondary_super_cache = k; }
226
227 Array<Klass*>* secondary_supers() const { return _secondary_supers; }
228 void set_secondary_supers(Array<Klass*>* k) { _secondary_supers = k; }
229
230 // Return the element of the _super chain of the given depth.
231 // If there is no such element, return either NULL or this.
232 Klass* primary_super_of_depth(juint i) const {
233 assert(i < primary_super_limit(), "oob");
234 Klass* super = _primary_supers[i];
235 assert(super == NULL || super->super_depth() == i, "correct display");
236 return super;
237 }
238
239 // Can this klass be a primary super? False for interfaces and arrays of
692 // jvm support
693 virtual jint compute_modifier_flags(TRAPS) const;
694
695 // JVMTI support
696 virtual jint jvmti_class_status() const;
697
698 // Printing
699 virtual void print_on(outputStream* st) const;
700
701 virtual void oop_print_value_on(oop obj, outputStream* st);
702 virtual void oop_print_on (oop obj, outputStream* st);
703
704 virtual const char* internal_name() const = 0;
705
706 // Verification
707 virtual void verify_on(outputStream* st);
708 void verify() { verify_on(tty); }
709
710 #ifndef PRODUCT
711 bool verify_vtable_index(int index);
712 bool verify_itable_index(int index);
713 #endif
714
715 virtual void oop_verify_on(oop obj, outputStream* st);
716
717 static bool is_null(narrowKlass obj);
718 static bool is_null(Klass* obj);
719
720 // klass encoding for klass pointer in objects.
721 static narrowKlass encode_klass_not_null(Klass* v);
722 static narrowKlass encode_klass(Klass* v);
723
724 static Klass* decode_klass_not_null(narrowKlass v);
725 static Klass* decode_klass(narrowKlass v);
726 };
727
728 #endif // SHARE_VM_OOPS_KLASS_HPP
|
185 CDS_JAVA_HEAP_ONLY(narrowOop _archived_mirror;)
186
187 protected:
188
189 // Constructor
190 Klass(KlassID id);
191 Klass() : _id(KlassID(-1)) { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
192
193 void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw();
194
195 public:
196 int id() { return _id; }
197
198 enum DefaultsLookupMode { find_defaults, skip_defaults };
199 enum OverpassLookupMode { find_overpass, skip_overpass };
200 enum StaticLookupMode { find_static, skip_static };
201 enum PrivateLookupMode { find_private, skip_private };
202
203 bool is_klass() const volatile { return true; }
204
205 // super() cannot be InstanceKlass* -- Java arrays are covariant, and _super is used
206 // to implement that. NB: the _super of "[Ljava/lang/Integer;" is "[Ljava/lang/Number;"
207 // If this is not what your code expects, you're probably looking for Klass::java_super().
208 Klass* super() const { return _super; }
209 void set_super(Klass* k) { _super = k; }
210
211 // initializes _super link, _primary_supers & _secondary_supers arrays
212 void initialize_supers(Klass* k, Array<InstanceKlass*>* transitive_interfaces, TRAPS);
213
214 // klass-specific helper for initializing _secondary_supers
215 virtual GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
216 Array<InstanceKlass*>* transitive_interfaces);
217
218 // java_super is the Java-level super type as specified by Class.getSuperClass.
219 virtual InstanceKlass* java_super() const { return NULL; }
220
221 juint super_check_offset() const { return _super_check_offset; }
222 void set_super_check_offset(juint o) { _super_check_offset = o; }
223
224 Klass* secondary_super_cache() const { return _secondary_super_cache; }
225 void set_secondary_super_cache(Klass* k) { _secondary_super_cache = k; }
226
227 Array<Klass*>* secondary_supers() const { return _secondary_supers; }
228 void set_secondary_supers(Array<Klass*>* k) { _secondary_supers = k; }
229
230 // Return the element of the _super chain of the given depth.
231 // If there is no such element, return either NULL or this.
232 Klass* primary_super_of_depth(juint i) const {
233 assert(i < primary_super_limit(), "oob");
234 Klass* super = _primary_supers[i];
235 assert(super == NULL || super->super_depth() == i, "correct display");
236 return super;
237 }
238
239 // Can this klass be a primary super? False for interfaces and arrays of
692 // jvm support
693 virtual jint compute_modifier_flags(TRAPS) const;
694
695 // JVMTI support
696 virtual jint jvmti_class_status() const;
697
698 // Printing
699 virtual void print_on(outputStream* st) const;
700
701 virtual void oop_print_value_on(oop obj, outputStream* st);
702 virtual void oop_print_on (oop obj, outputStream* st);
703
704 virtual const char* internal_name() const = 0;
705
706 // Verification
707 virtual void verify_on(outputStream* st);
708 void verify() { verify_on(tty); }
709
710 #ifndef PRODUCT
711 bool verify_vtable_index(int index);
712 #endif
713
714 virtual void oop_verify_on(oop obj, outputStream* st);
715
716 static bool is_null(narrowKlass obj);
717 static bool is_null(Klass* obj);
718
719 // klass encoding for klass pointer in objects.
720 static narrowKlass encode_klass_not_null(Klass* v);
721 static narrowKlass encode_klass(Klass* v);
722
723 static Klass* decode_klass_not_null(narrowKlass v);
724 static Klass* decode_klass(narrowKlass v);
725 };
726
727 #endif // SHARE_VM_OOPS_KLASS_HPP
|