< prev index next >

src/hotspot/share/ci/ciArray.cpp

Print this page
@@ -35,10 +35,11 @@
  // ciArray
  //
  // This class represents an arrayOop in the HotSpot virtual
  // machine.
  static BasicType fixup_element_type(BasicType bt) {
+   if (bt == T_FLAT_ELEMENT) return T_OBJECT;
    if (is_reference_type(bt))  return T_OBJECT;
    if (bt == T_BOOLEAN)  return T_BYTE;
    return bt;
  }
  

@@ -117,10 +118,30 @@
      return ciConstant();
    }
    return element_value((jint) index);
  }
  
+ bool ciArray::is_null_free() {
+   VM_ENTRY_MARK;
+   return get_oop()->is_null_free_array();
+ }
+ 
+ bool ciArray::is_atomic() {
+   VM_ENTRY_MARK;
+   arrayOop oop = get_arrayOop();
+   if (oop->is_refArray()) {
+     return oop->klass()->is_inline_klass();
+   }
+   if (oop->is_flatArray()) {
+     FlatArrayKlass* fak = FlatArrayKlass::cast(oop->klass());
+     if (fak->element_klass()->is_naturally_atomic() || fak->layout_kind() == LayoutKind::ATOMIC_FLAT || fak->layout_kind() == LayoutKind::NULLABLE_ATOMIC_FLAT) {
+       return true;
+     }
+   }
+   return false;
+ }
+ 
  // ------------------------------------------------------------------
  // ciArray::print_impl
  //
  // Implementation of the print method.
  void ciArray::print_impl(outputStream* st) {
< prev index next >