< prev index next >

src/hotspot/share/oops/objArrayKlass.cpp

Print this page

321   int num_secondaries = num_extra_slots + 2 + num_elem_supers;
322   if (num_secondaries == 2) {
323     // Must share this for correct bootstrapping!
324     set_secondary_supers(Universe::the_array_interfaces_array());
325     return nullptr;
326   } else {
327     GrowableArray<Klass*>* secondaries = new GrowableArray<Klass*>(num_elem_supers+2);
328     secondaries->push(vmClasses::Cloneable_klass());
329     secondaries->push(vmClasses::Serializable_klass());
330     for (int i = 0; i < num_elem_supers; i++) {
331       Klass* elem_super = elem_supers->at(i);
332       Klass* array_super = elem_super->array_klass_or_null();
333       assert(array_super != nullptr, "must already have been created");
334       secondaries->push(array_super);
335     }
336     return secondaries;
337   }
338 }
339 
340 void ObjArrayKlass::initialize(TRAPS) {





341   bottom_klass()->initialize(THREAD);  // dispatches to either InstanceKlass or TypeArrayKlass
342 }
343 
344 void ObjArrayKlass::metaspace_pointers_do(MetaspaceClosure* it) {
345   ArrayKlass::metaspace_pointers_do(it);
346   it->push(&_element_klass);
347   it->push(&_bottom_klass);
348 }
349 
350 jint ObjArrayKlass::compute_modifier_flags() const {
351   // The modifier for an objectArray is the same as its element
352   if (element_klass() == nullptr) {
353     assert(Universe::is_bootstrapping(), "partial objArray only at startup");
354     return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
355   }
356   // Return the flags of the bottom element type.
357   jint element_flags = bottom_klass()->compute_modifier_flags();
358 
359   return (element_flags & (JVM_ACC_PUBLIC | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED))
360                         | (JVM_ACC_ABSTRACT | JVM_ACC_FINAL);

321   int num_secondaries = num_extra_slots + 2 + num_elem_supers;
322   if (num_secondaries == 2) {
323     // Must share this for correct bootstrapping!
324     set_secondary_supers(Universe::the_array_interfaces_array());
325     return nullptr;
326   } else {
327     GrowableArray<Klass*>* secondaries = new GrowableArray<Klass*>(num_elem_supers+2);
328     secondaries->push(vmClasses::Cloneable_klass());
329     secondaries->push(vmClasses::Serializable_klass());
330     for (int i = 0; i < num_elem_supers; i++) {
331       Klass* elem_super = elem_supers->at(i);
332       Klass* array_super = elem_super->array_klass_or_null();
333       assert(array_super != nullptr, "must already have been created");
334       secondaries->push(array_super);
335     }
336     return secondaries;
337   }
338 }
339 
340 void ObjArrayKlass::initialize(TRAPS) {
341   if (RecordTraining && bottom_klass()->is_instance_klass()) {
342     InstanceKlass* bk = InstanceKlass::cast(bottom_klass());
343     bk->record_initialization_touch("array", nullptr, nullptr,
344                                     this, nullptr, CHECK);
345   }
346   bottom_klass()->initialize(THREAD);  // dispatches to either InstanceKlass or TypeArrayKlass
347 }
348 
349 void ObjArrayKlass::metaspace_pointers_do(MetaspaceClosure* it) {
350   ArrayKlass::metaspace_pointers_do(it);
351   it->push(&_element_klass);
352   it->push(&_bottom_klass);
353 }
354 
355 jint ObjArrayKlass::compute_modifier_flags() const {
356   // The modifier for an objectArray is the same as its element
357   if (element_klass() == nullptr) {
358     assert(Universe::is_bootstrapping(), "partial objArray only at startup");
359     return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
360   }
361   // Return the flags of the bottom element type.
362   jint element_flags = bottom_klass()->compute_modifier_flags();
363 
364   return (element_flags & (JVM_ACC_PUBLIC | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED))
365                         | (JVM_ACC_ABSTRACT | JVM_ACC_FINAL);
< prev index next >