713 714 // Sizing (in words) 715 static int header_size() { return sizeof(ConstantPool)/HeapWordSize; } 716 static int size(int length) { return align_object_size(header_size() + length); } 717 int size() const { return size(length()); } 718 #if INCLUDE_SERVICES 719 void collect_statistics(KlassSizeStats *sz) const; 720 #endif 721 722 friend class ClassFileParser; 723 friend class SystemDictionary; 724 725 // Used by compiler to prevent classloading. 726 static Method* method_at_if_loaded (constantPoolHandle this_oop, int which); 727 static bool has_appendix_at_if_loaded (constantPoolHandle this_oop, int which); 728 static oop appendix_at_if_loaded (constantPoolHandle this_oop, int which); 729 static bool has_method_type_at_if_loaded (constantPoolHandle this_oop, int which); 730 static oop method_type_at_if_loaded (constantPoolHandle this_oop, int which); 731 static Klass* klass_at_if_loaded (constantPoolHandle this_oop, int which); 732 static Klass* klass_ref_at_if_loaded (constantPoolHandle this_oop, int which); 733 // Same as above - but does LinkResolving. 734 static Klass* klass_ref_at_if_loaded_check(constantPoolHandle this_oop, int which, TRAPS); 735 736 // Routines currently used for annotations (only called by jvm.cpp) but which might be used in the 737 // future by other Java code. These take constant pool indices rather than 738 // constant pool cache indices as do the peer methods above. 739 Symbol* uncached_klass_ref_at_noresolve(int which); 740 Symbol* uncached_name_ref_at(int which) { return impl_name_ref_at(which, true); } 741 Symbol* uncached_signature_ref_at(int which) { return impl_signature_ref_at(which, true); } 742 int uncached_klass_ref_index_at(int which) { return impl_klass_ref_index_at(which, true); } 743 int uncached_name_and_type_ref_index_at(int which) { return impl_name_and_type_ref_index_at(which, true); } 744 745 // Sharing 746 int pre_resolve_shared_klasses(TRAPS); 747 748 // Debugging 749 const char* printable_name_at(int which) PRODUCT_RETURN0; 750 751 #ifdef ASSERT 752 enum { CPCACHE_INDEX_TAG = 0x10000 }; // helps keep CP cache indices distinct from CP indices 753 #else 754 enum { CPCACHE_INDEX_TAG = 0 }; // in product mode, this zero value is a no-op | 713 714 // Sizing (in words) 715 static int header_size() { return sizeof(ConstantPool)/HeapWordSize; } 716 static int size(int length) { return align_object_size(header_size() + length); } 717 int size() const { return size(length()); } 718 #if INCLUDE_SERVICES 719 void collect_statistics(KlassSizeStats *sz) const; 720 #endif 721 722 friend class ClassFileParser; 723 friend class SystemDictionary; 724 725 // Used by compiler to prevent classloading. 726 static Method* method_at_if_loaded (constantPoolHandle this_oop, int which); 727 static bool has_appendix_at_if_loaded (constantPoolHandle this_oop, int which); 728 static oop appendix_at_if_loaded (constantPoolHandle this_oop, int which); 729 static bool has_method_type_at_if_loaded (constantPoolHandle this_oop, int which); 730 static oop method_type_at_if_loaded (constantPoolHandle this_oop, int which); 731 static Klass* klass_at_if_loaded (constantPoolHandle this_oop, int which); 732 static Klass* klass_ref_at_if_loaded (constantPoolHandle this_oop, int which); 733 734 // Routines currently used for annotations (only called by jvm.cpp) but which might be used in the 735 // future by other Java code. These take constant pool indices rather than 736 // constant pool cache indices as do the peer methods above. 737 Symbol* uncached_klass_ref_at_noresolve(int which); 738 Symbol* uncached_name_ref_at(int which) { return impl_name_ref_at(which, true); } 739 Symbol* uncached_signature_ref_at(int which) { return impl_signature_ref_at(which, true); } 740 int uncached_klass_ref_index_at(int which) { return impl_klass_ref_index_at(which, true); } 741 int uncached_name_and_type_ref_index_at(int which) { return impl_name_and_type_ref_index_at(which, true); } 742 743 // Sharing 744 int pre_resolve_shared_klasses(TRAPS); 745 746 // Debugging 747 const char* printable_name_at(int which) PRODUCT_RETURN0; 748 749 #ifdef ASSERT 750 enum { CPCACHE_INDEX_TAG = 0x10000 }; // helps keep CP cache indices distinct from CP indices 751 #else 752 enum { CPCACHE_INDEX_TAG = 0 }; // in product mode, this zero value is a no-op |