574 OverpassLookupMode overpass_mode,
575 PrivateLookupMode = PrivateLookupMode::find) const;
576 public:
577 Method* lookup_method(const Symbol* name, const Symbol* signature) const {
578 return uncached_lookup_method(name, signature, OverpassLookupMode::find);
579 }
580
581 // array class with specific rank
582 virtual ArrayKlass* array_klass(int rank, TRAPS) = 0;
583
584 // array class with this klass as element type
585 virtual ArrayKlass* array_klass(TRAPS) = 0;
586
587 // These will return null instead of allocating on the heap:
588 virtual ArrayKlass* array_klass_or_null(int rank) = 0;
589 virtual ArrayKlass* array_klass_or_null() = 0;
590
591 virtual oop protection_domain() const = 0;
592
593 oop class_loader() const;
594
595 inline oop klass_holder() const;
596
597 inline void keep_alive() const;
598
599 protected:
600
601 // Error handling when length > max_length or length < 0
602 static void check_array_allocation_length(int length, int max_length, TRAPS);
603
604 void set_vtable_length(int len) { _vtable_len= len; }
605
606 vtableEntry* start_of_vtable() const;
607 #if INCLUDE_CDS
608 void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
609 #endif
610 public:
611 Method* method_at_vtable(int index);
612
613 static ByteSize vtable_start_offset();
713 bool is_value_based() const { return _misc_flags.is_value_based_class(); }
714 void set_is_value_based() { _misc_flags.set_is_value_based_class(true); }
715
716 klass_flags_t misc_flags() const { return _misc_flags.value(); }
717
718 inline bool is_non_strong_hidden() const;
719
720 bool is_cloneable() const;
721 void set_is_cloneable();
722
723 inline markWord prototype_header() const;
724 inline void set_prototype_header(markWord header);
725 static ByteSize prototype_header_offset() { return in_ByteSize(offset_of(Klass, _prototype_header)); }
726
727 JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
728
729 virtual void metaspace_pointers_do(MetaspaceClosure* iter);
730 virtual MetaspaceObj::Type type() const { return ClassType; }
731
732 inline bool is_loader_alive() const;
733
734 void clean_subklass();
735
736 static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
737 static void clean_subklass_tree() {
738 clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
739 }
740
741 // Return self, except for abstract classes with exactly 1
742 // implementor. Then return the 1 concrete implementation.
743 Klass *up_cast_abstract();
744
745 // klass name
746 Symbol* name() const { return _name; }
747 void set_name(Symbol* n);
748
749 virtual void release_C_heap_structures(bool release_constant_pool = true);
750
751 public:
752 // Get modifier flags from Java mirror cache.
|
574 OverpassLookupMode overpass_mode,
575 PrivateLookupMode = PrivateLookupMode::find) const;
576 public:
577 Method* lookup_method(const Symbol* name, const Symbol* signature) const {
578 return uncached_lookup_method(name, signature, OverpassLookupMode::find);
579 }
580
581 // array class with specific rank
582 virtual ArrayKlass* array_klass(int rank, TRAPS) = 0;
583
584 // array class with this klass as element type
585 virtual ArrayKlass* array_klass(TRAPS) = 0;
586
587 // These will return null instead of allocating on the heap:
588 virtual ArrayKlass* array_klass_or_null(int rank) = 0;
589 virtual ArrayKlass* array_klass_or_null() = 0;
590
591 virtual oop protection_domain() const = 0;
592
593 oop class_loader() const;
594 Symbol* class_loader_name_and_id() const;
595
596 inline oop klass_holder() const;
597
598 inline void keep_alive() const;
599
600 protected:
601
602 // Error handling when length > max_length or length < 0
603 static void check_array_allocation_length(int length, int max_length, TRAPS);
604
605 void set_vtable_length(int len) { _vtable_len= len; }
606
607 vtableEntry* start_of_vtable() const;
608 #if INCLUDE_CDS
609 void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
610 #endif
611 public:
612 Method* method_at_vtable(int index);
613
614 static ByteSize vtable_start_offset();
714 bool is_value_based() const { return _misc_flags.is_value_based_class(); }
715 void set_is_value_based() { _misc_flags.set_is_value_based_class(true); }
716
717 klass_flags_t misc_flags() const { return _misc_flags.value(); }
718
719 inline bool is_non_strong_hidden() const;
720
721 bool is_cloneable() const;
722 void set_is_cloneable();
723
724 inline markWord prototype_header() const;
725 inline void set_prototype_header(markWord header);
726 static ByteSize prototype_header_offset() { return in_ByteSize(offset_of(Klass, _prototype_header)); }
727
728 JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
729
730 virtual void metaspace_pointers_do(MetaspaceClosure* iter);
731 virtual MetaspaceObj::Type type() const { return ClassType; }
732
733 inline bool is_loader_alive() const;
734 inline bool is_loader_present_and_alive() const;
735
736 void clean_subklass();
737
738 static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
739 static void clean_subklass_tree() {
740 clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
741 }
742
743 // Return self, except for abstract classes with exactly 1
744 // implementor. Then return the 1 concrete implementation.
745 Klass *up_cast_abstract();
746
747 // klass name
748 Symbol* name() const { return _name; }
749 void set_name(Symbol* n);
750
751 virtual void release_C_heap_structures(bool release_constant_pool = true);
752
753 public:
754 // Get modifier flags from Java mirror cache.
|