equal
deleted
inserted
replaced
86 // Returns the address of the first element. The elements in the array will not |
86 // Returns the address of the first element. The elements in the array will not |
87 // relocate from this address until a subsequent thread transition. |
87 // relocate from this address until a subsequent thread transition. |
88 inline void* base(BasicType type) const; |
88 inline void* base(BasicType type) const; |
89 inline void* base_raw(BasicType type) const; // GC barrier invariant |
89 inline void* base_raw(BasicType type) const; // GC barrier invariant |
90 |
90 |
|
91 template <typename T> |
|
92 static T* obj_offset_to_raw(arrayOop obj, size_t offset_in_bytes, T* raw) { |
|
93 if (obj != NULL) { |
|
94 assert(raw == NULL, "either raw or in-heap"); |
|
95 char* base = reinterpret_cast<char*>((void*) obj); |
|
96 raw = reinterpret_cast<T*>(base + offset_in_bytes); |
|
97 } else { |
|
98 assert(raw != NULL, "either raw or in-heap"); |
|
99 } |
|
100 return raw; |
|
101 } |
|
102 |
91 // Tells whether index is within bounds. |
103 // Tells whether index is within bounds. |
92 bool is_within_bounds(int index) const { return 0 <= index && index < length(); } |
104 bool is_within_bounds(int index) const { return 0 <= index && index < length(); } |
93 |
105 |
94 // Accessors for instance variable which is not a C++ declared nonstatic |
106 // Accessors for instance variable which is not a C++ declared nonstatic |
95 // field. |
107 // field. |