< prev index next >

src/hotspot/share/oops/valueArrayKlass.cpp

Print this page

        

@@ -97,18 +97,18 @@
   Klass* super_klass = NULL;
   if (!Universe::is_bootstrapping() || SystemDictionary::Object_klass_loaded()) {
     Klass* element_super = element_klass->super();
     if (element_super != NULL) {
       // The element type has a direct super.  E.g., String[] has direct super of Object[].
-      super_klass = element_super->array_klass_or_null();
+      super_klass = element_super->array_klass_or_null(ArrayStorageProperties::empty);
       bool supers_exist = super_klass != NULL;
       // Also, see if the element has secondary supertypes.
       // We need an array type for each.
       Array<Klass*>* element_supers = element_klass->secondary_supers();
       for( int i = element_supers->length()-1; i >= 0; i-- ) {
         Klass* elem_super = element_supers->at(i);
-        if (elem_super->array_klass_or_null() == NULL) {
+        if (elem_super->array_klass_or_null(ArrayStorageProperties::empty) == NULL) {
           supers_exist = false;
           break;
         }
       }
       if (!supers_exist) {

@@ -120,11 +120,11 @@
           for( int i = element_supers->length()-1; i >= 0; i-- ) {
             Klass* elem_super = element_supers->at(i);
             elem_super->array_klass(CHECK_0);
           }
           // Now retry from the beginning
-          ek = element_klass->array_klass(1, CHECK_0);
+          ek = element_klass->array_klass(ArrayStorageProperties::flattened_and_null_free, 1, CHECK_0);
         }  // re-lock
         return ValueArrayKlass::cast(ek);
       }
     } else {
       ShouldNotReachHere(); // Value array klass cannot be the object array klass

@@ -144,12 +144,13 @@
   assert(module != NULL, "No module entry for array");
   complete_create_array_klass(vak, super_klass, module, CHECK_NULL);
   return vak;
 }
 
-ValueArrayKlass* ValueArrayKlass::allocate_klass(Klass* element_klass, TRAPS) {
-  Symbol* name = ArrayKlass::create_element_klass_array_name(element_klass, CHECK_NULL);
+ValueArrayKlass* ValueArrayKlass::allocate_klass(ArrayStorageProperties storage_props, Klass* element_klass, TRAPS) {
+  assert(storage_props.is_flattened(), "Expected flat storage");
+  Symbol* name = ArrayKlass::create_element_klass_array_name(true, element_klass, CHECK_NULL);
   return allocate_klass(element_klass, name, THREAD);
 }
 
 void ValueArrayKlass::initialize(TRAPS) {
   element_klass()->initialize(THREAD);

@@ -319,12 +320,12 @@
      }
    }
 }
 
 
-Klass* ValueArrayKlass::array_klass_impl(bool or_null, int n, TRAPS) {
-
+Klass* ValueArrayKlass::array_klass_impl(ArrayStorageProperties storage_props, bool or_null, int n, TRAPS) {
+  assert(storage_props.is_flattened() || n > 1, "Expected flat storage");
   assert(dimension() <= n, "check order of chain");
   int dim = dimension();
   if (dim == n) return this;
 
   if (higher_dimension() == NULL) {

@@ -339,11 +340,11 @@
       // Check if another thread beat us
       if (higher_dimension() == NULL) {
 
         // Create multi-dim klass object and link them together
         Klass* k =
-          ObjArrayKlass::allocate_objArray_klass(class_loader_data(), dim + 1, this, CHECK_NULL);
+          ObjArrayKlass::allocate_objArray_klass(storage_props, dim + 1, this, CHECK_NULL);
         ObjArrayKlass* ak = ObjArrayKlass::cast(k);
         ak->set_lower_dimension(this);
         OrderAccess::storestore();
         set_higher_dimension(ak);
         assert(ak->is_objArray_klass(), "incorrect initialization of ObjArrayKlass");

@@ -353,17 +354,17 @@
     CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
   }
 
   ObjArrayKlass *ak = ObjArrayKlass::cast(higher_dimension());
   if (or_null) {
-    return ak->array_klass_or_null(n);
+    return ak->array_klass_or_null(storage_props, n);
   }
-  return ak->array_klass(n, THREAD);
+  return ak->array_klass(storage_props, n, THREAD);
 }
 
-Klass* ValueArrayKlass::array_klass_impl(bool or_null, TRAPS) {
-  return array_klass_impl(or_null, dimension() +  1, THREAD);
+Klass* ValueArrayKlass::array_klass_impl(ArrayStorageProperties storage_props, bool or_null, TRAPS) {
+  return array_klass_impl(storage_props, or_null, dimension() +  1, THREAD);
 }
 
 ModuleEntry* ValueArrayKlass::module() const {
   assert(element_klass() != NULL, "ValueArrayKlass returned unexpected NULL bottom_klass");
   // The array is defined in the module of its bottom class

@@ -394,11 +395,11 @@
     GrowableArray<Klass*>* secondaries = new GrowableArray<Klass*>(num_elem_supers+2);
     secondaries->push(SystemDictionary::Cloneable_klass());
     secondaries->push(SystemDictionary::Serializable_klass());
     for (int i = 0; i < num_elem_supers; i++) {
       Klass* elem_super = (Klass*) elem_supers->at(i);
-      Klass* array_super = elem_super->array_klass_or_null();
+      Klass* array_super = elem_super->array_klass_or_null(ArrayStorageProperties::empty);
       assert(array_super != NULL, "must already have been created");
       secondaries->push(array_super);
     }
     return secondaries;
   }
< prev index next >