< prev index next >

src/hotspot/share/oops/typeArrayKlass.cpp

Print this page

211       return this;
212 
213   // lock-free read needs acquire semantics
214   if (higher_dimension_acquire() == nullptr) {
215     return nullptr;
216   }
217 
218   ObjArrayKlass* h_ak = ObjArrayKlass::cast(higher_dimension());
219   return h_ak->array_klass_or_null(n);
220 }
221 
222 Klass* TypeArrayKlass::array_klass(TRAPS) {
223   return array_klass(dimension() +  1, THREAD);
224 }
225 
226 Klass* TypeArrayKlass::array_klass_or_null() {
227   return array_klass_or_null(dimension() +  1);
228 }
229 
230 size_t TypeArrayKlass::oop_size(oop obj) const {
231   assert(obj->is_typeArray(),"must be a type array");

232   typeArrayOop t = typeArrayOop(obj);
233   return t->object_size(this);
234 }
235 
236 void TypeArrayKlass::initialize(TRAPS) {
237   // Nothing to do. Having this function is handy since objArrayKlasses can be
238   // initialized by calling initialize on their bottom_klass, see ObjArrayKlass::initialize
239 }
240 
241 const char* TypeArrayKlass::external_name(BasicType type) {
242   switch (type) {
243     case T_BOOLEAN: return "[Z";
244     case T_CHAR:    return "[C";
245     case T_FLOAT:   return "[F";
246     case T_DOUBLE:  return "[D";
247     case T_BYTE:    return "[B";
248     case T_SHORT:   return "[S";
249     case T_INT:     return "[I";
250     case T_LONG:    return "[J";
251     default: ShouldNotReachHere();

211       return this;
212 
213   // lock-free read needs acquire semantics
214   if (higher_dimension_acquire() == nullptr) {
215     return nullptr;
216   }
217 
218   ObjArrayKlass* h_ak = ObjArrayKlass::cast(higher_dimension());
219   return h_ak->array_klass_or_null(n);
220 }
221 
222 Klass* TypeArrayKlass::array_klass(TRAPS) {
223   return array_klass(dimension() +  1, THREAD);
224 }
225 
226 Klass* TypeArrayKlass::array_klass_or_null() {
227   return array_klass_or_null(dimension() +  1);
228 }
229 
230 size_t TypeArrayKlass::oop_size(oop obj) const {
231   // In this assert, we cannot safely access the Klass* with compact headers.
232   assert(UseCompactObjectHeaders || obj->is_typeArray(),"must be a type array");
233   typeArrayOop t = typeArrayOop(obj);
234   return t->object_size(this);
235 }
236 
237 void TypeArrayKlass::initialize(TRAPS) {
238   // Nothing to do. Having this function is handy since objArrayKlasses can be
239   // initialized by calling initialize on their bottom_klass, see ObjArrayKlass::initialize
240 }
241 
242 const char* TypeArrayKlass::external_name(BasicType type) {
243   switch (type) {
244     case T_BOOLEAN: return "[Z";
245     case T_CHAR:    return "[C";
246     case T_FLOAT:   return "[F";
247     case T_DOUBLE:  return "[D";
248     case T_BYTE:    return "[B";
249     case T_SHORT:   return "[S";
250     case T_INT:     return "[I";
251     case T_LONG:    return "[J";
252     default: ShouldNotReachHere();
< prev index next >