src/share/vm/oops/constantPoolOop.hpp

changeset 548
ba764ed4b6f2
parent 435
a61af66fc99e
child 631
d1605aabd0a1
     1.1 --- a/src/share/vm/oops/constantPoolOop.hpp	Fri Apr 11 09:56:35 2008 -0400
     1.2 +++ b/src/share/vm/oops/constantPoolOop.hpp	Sun Apr 13 17:43:42 2008 -0400
     1.3 @@ -34,13 +34,14 @@
     1.4  
     1.5  class SymbolHashMap;
     1.6  
     1.7 -class constantPoolOopDesc : public arrayOopDesc {
     1.8 +class constantPoolOopDesc : public oopDesc {
     1.9    friend class VMStructs;
    1.10    friend class BytecodeInterpreter;  // Directly extracts an oop in the pool for fast instanceof/checkcast
    1.11   private:
    1.12    typeArrayOop         _tags; // the tag array describing the constant pool's contents
    1.13    constantPoolCacheOop _cache;         // the cache holding interpreter runtime information
    1.14    klassOop             _pool_holder;   // the corresponding class
    1.15 +  int                  _length; // number of elements in the array
    1.16    // only set to non-zero if constant pool is merged by RedefineClasses
    1.17    int                  _orig_length;
    1.18  
    1.19 @@ -330,6 +331,14 @@
    1.20    bool klass_name_at_matches(instanceKlassHandle k, int which);
    1.21  
    1.22    // Sizing
    1.23 +  int length() const                   { return _length; }
    1.24 +  void set_length(int length)          { _length = length; }
    1.25 +
    1.26 +  // Tells whether index is within bounds.
    1.27 +  bool is_within_bounds(int index) const {
    1.28 +    return 0 <= index && index < length();
    1.29 +  }
    1.30 +
    1.31    static int header_size()             { return sizeof(constantPoolOopDesc)/HeapWordSize; }
    1.32    static int object_size(int length)   { return align_object_size(header_size() + length); }
    1.33    int object_size()                    { return object_size(length()); }

mercurial