284 // A constant pool cache is a runtime data structure set aside to a constant pool. The cache |
284 // A constant pool cache is a runtime data structure set aside to a constant pool. The cache |
285 // holds interpreter runtime information for all field access and invoke bytecodes. The cache |
285 // holds interpreter runtime information for all field access and invoke bytecodes. The cache |
286 // is created and initialized before a class is actively used (i.e., initialized), the indivi- |
286 // is created and initialized before a class is actively used (i.e., initialized), the indivi- |
287 // dual cache entries are filled at resolution (i.e., "link") time (see also: rewriter.*). |
287 // dual cache entries are filled at resolution (i.e., "link") time (see also: rewriter.*). |
288 |
288 |
289 class constantPoolCacheOopDesc: public arrayOopDesc { |
289 class constantPoolCacheOopDesc: public oopDesc { |
290 friend class VMStructs; |
290 friend class VMStructs; |
291 private: |
291 private: |
|
292 int _length; |
292 constantPoolOop _constant_pool; // the corresponding constant pool |
293 constantPoolOop _constant_pool; // the corresponding constant pool |
293 |
294 |
294 // Sizing |
295 // Sizing |
|
296 debug_only(friend class ClassVerifier;) |
|
297 int length() const { return _length; } |
|
298 void set_length(int length) { _length = length; } |
|
299 |
295 static int header_size() { return sizeof(constantPoolCacheOopDesc) / HeapWordSize; } |
300 static int header_size() { return sizeof(constantPoolCacheOopDesc) / HeapWordSize; } |
296 static int object_size(int length) { return align_object_size(header_size() + length * in_words(ConstantPoolCacheEntry::size())); } |
301 static int object_size(int length) { return align_object_size(header_size() + length * in_words(ConstantPoolCacheEntry::size())); } |
297 int object_size() { return object_size(length()); } |
302 int object_size() { return object_size(length()); } |
298 |
303 |
299 // Helpers |
304 // Helpers |