< prev index next >

src/hotspot/share/oops/valueArrayKlass.cpp

Print this page
rev 59083 : DRAFT 8236522: NonTearable marker interface for inline classes to enforce atomicity


  66   assert(is_valueArray_klass(), "sanity");
  67 
  68   CMH("tweak name symbol refcnt ?")
  69 #ifndef PRODUCT
  70   if (PrintValueArrayLayout) {
  71     print();
  72   }
  73 #endif
  74 }
  75 
  76 ValueKlass* ValueArrayKlass::element_klass() const {
  77   return ValueKlass::cast(_element_klass);
  78 }
  79 
  80 void ValueArrayKlass::set_element_klass(Klass* k) {
  81   _element_klass = k;
  82 }
  83 
  84 ValueArrayKlass* ValueArrayKlass::allocate_klass(Klass* element_klass, TRAPS) {
  85   assert(ValueArrayFlatten, "Flatten array required");
  86   assert(ValueKlass::cast(element_klass)->is_atomic() || (!ValueArrayAtomicAccess), "Atomic by-default");
  87 
  88   /*
  89    *  MVT->LWorld, now need to allocate secondaries array types, just like objArrayKlass...
  90    *  ...so now we are trying out covariant array types, just copy objArrayKlass
  91    *  TODO refactor any remaining commonality
  92    */
  93 
  94   // Eagerly allocate the direct array supertype, which would be "[L<vt>;" for this "[Q<vt>;"
  95   Klass* super_klass = element_klass->array_klass_or_null(ArrayStorageProperties::empty);
  96   if (super_klass == NULL) {
  97     MutexUnlocker mu(MultiArray_lock);
  98     // allocate super...need to drop the lock
  99     element_klass->array_klass(ArrayStorageProperties::empty, 1, CHECK_NULL);
 100     // retry, start from the beginning since lock dropped...
 101     Klass* ak = element_klass->array_klass(ArrayStorageProperties::flattened_and_null_free, 1, CHECK_NULL);
 102     return ValueArrayKlass::cast(ak);
 103   }
 104 
 105   Symbol* name = ArrayKlass::create_element_klass_array_name(true, element_klass, CHECK_NULL);
 106   ClassLoaderData* loader_data = element_klass->class_loader_data();




  66   assert(is_valueArray_klass(), "sanity");
  67 
  68   CMH("tweak name symbol refcnt ?")
  69 #ifndef PRODUCT
  70   if (PrintValueArrayLayout) {
  71     print();
  72   }
  73 #endif
  74 }
  75 
  76 ValueKlass* ValueArrayKlass::element_klass() const {
  77   return ValueKlass::cast(_element_klass);
  78 }
  79 
  80 void ValueArrayKlass::set_element_klass(Klass* k) {
  81   _element_klass = k;
  82 }
  83 
  84 ValueArrayKlass* ValueArrayKlass::allocate_klass(Klass* element_klass, TRAPS) {
  85   assert(ValueArrayFlatten, "Flatten array required");
  86   assert(ValueKlass::cast(element_klass)->is_naturally_atomic() || (!ValueArrayAtomicAccess), "Atomic by-default");
  87 
  88   /*
  89    *  MVT->LWorld, now need to allocate secondaries array types, just like objArrayKlass...
  90    *  ...so now we are trying out covariant array types, just copy objArrayKlass
  91    *  TODO refactor any remaining commonality
  92    */
  93 
  94   // Eagerly allocate the direct array supertype, which would be "[L<vt>;" for this "[Q<vt>;"
  95   Klass* super_klass = element_klass->array_klass_or_null(ArrayStorageProperties::empty);
  96   if (super_klass == NULL) {
  97     MutexUnlocker mu(MultiArray_lock);
  98     // allocate super...need to drop the lock
  99     element_klass->array_klass(ArrayStorageProperties::empty, 1, CHECK_NULL);
 100     // retry, start from the beginning since lock dropped...
 101     Klass* ak = element_klass->array_klass(ArrayStorageProperties::flattened_and_null_free, 1, CHECK_NULL);
 102     return ValueArrayKlass::cast(ak);
 103   }
 104 
 105   Symbol* name = ArrayKlass::create_element_klass_array_name(true, element_klass, CHECK_NULL);
 106   ClassLoaderData* loader_data = element_klass->class_loader_data();


< prev index next >