equal
deleted
inserted
replaced
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. |