36 assert(is_within_bounds(index), "index out of bounds"); |
36 assert(is_within_bounds(index), "index out of bounds"); |
37 return &((T*)base())[index]; |
37 return &((T*)base())[index]; |
38 } |
38 } |
39 |
39 |
40 public: |
40 public: |
|
41 // Returns the offset of the first element. |
|
42 static int base_offset_in_bytes() { |
|
43 return arrayOopDesc::base_offset_in_bytes(T_OBJECT); |
|
44 } |
|
45 |
41 // base is the address following the header. |
46 // base is the address following the header. |
42 HeapWord* base() const { return (HeapWord*) arrayOopDesc::base(T_OBJECT); } |
47 HeapWord* base() const { return (HeapWord*) arrayOopDesc::base(T_OBJECT); } |
43 |
48 |
44 // Accessing |
49 // Accessing |
45 oop obj_at(int index) const { |
50 oop obj_at(int index) const { |