comparison src/share/vm/oops/constantPool.hpp @ 7956:16fb9f942703

6479360: PrintClassHistogram improvements Summary: jcmd <pid> GC.class_stats (UnlockDiagnosticVMOptions) Reviewed-by: coleenp, hseigel, sla, acorn Contributed-by: ioi.lam@oracle.com
author acorn
date Fri, 25 Jan 2013 15:06:18 -0500
parents 5daaddd917a1
children 0d26ce8e9251
comparison
equal deleted inserted replaced
7950:6cf2530f7fd3 7956:16fb9f942703
78 assert(is_resolved(), "bad call"); 78 assert(is_resolved(), "bad call");
79 return (Klass*)_ptr; 79 return (Klass*)_ptr;
80 } 80 }
81 }; 81 };
82 82
83 class KlassSizeStats;
83 class ConstantPool : public Metadata { 84 class ConstantPool : public Metadata {
84 friend class VMStructs; 85 friend class VMStructs;
85 friend class BytecodeInterpreter; // Directly extracts an oop in the pool for fast instanceof/checkcast 86 friend class BytecodeInterpreter; // Directly extracts an oop in the pool for fast instanceof/checkcast
86 friend class Universe; // For null constructor 87 friend class Universe; // For null constructor
87 private: 88 private:
682 // Tells whether index is within bounds. 683 // Tells whether index is within bounds.
683 bool is_within_bounds(int index) const { 684 bool is_within_bounds(int index) const {
684 return 0 <= index && index < length(); 685 return 0 <= index && index < length();
685 } 686 }
686 687
688 // Sizing (in words)
687 static int header_size() { return sizeof(ConstantPool)/HeapWordSize; } 689 static int header_size() { return sizeof(ConstantPool)/HeapWordSize; }
688 static int size(int length) { return align_object_size(header_size() + length); } 690 static int size(int length) { return align_object_size(header_size() + length); }
689 int size() const { return size(length()); } 691 int size() const { return size(length()); }
692 #if INCLUDE_SERVICES
693 void collect_statistics(KlassSizeStats *sz) const;
694 #endif
690 695
691 friend class ClassFileParser; 696 friend class ClassFileParser;
692 friend class SystemDictionary; 697 friend class SystemDictionary;
693 698
694 // Used by compiler to prevent classloading. 699 // Used by compiler to prevent classloading.