< prev index next >

src/hotspot/share/ci/ciArrayKlass.cpp

Print this page
@@ -21,14 +21,18 @@
   * questions.
   *
   */
  
  #include "ci/ciArrayKlass.hpp"
+ #include "ci/ciFlatArrayKlass.hpp"
+ #include "ci/ciInlineKlass.hpp"
  #include "ci/ciObjArrayKlass.hpp"
  #include "ci/ciTypeArrayKlass.hpp"
  #include "ci/ciUtilities.inline.hpp"
  #include "memory/universe.hpp"
+ #include "oops/arrayKlass.hpp"
+ #include "oops/inlineKlass.inline.hpp"
  
  // ciArrayKlass
  //
  // This class represents a Klass* in the HotSpot virtual machine
  // whose Klass part in an ArrayKlass.

@@ -57,11 +61,11 @@
  // What type is obtained when this array is indexed once?
  ciType* ciArrayKlass::element_type() {
    if (is_type_array_klass()) {
      return ciType::make(as_type_array_klass()->element_type());
    } else {
-     return as_obj_array_klass()->element_klass()->as_klass();
+     return element_klass()->as_klass();
    }
  }
  
  
  // ------------------------------------------------------------------

@@ -94,13 +98,39 @@
  
  // ------------------------------------------------------------------
  // ciArrayKlass::make
  //
  // Make an array klass of the specified element type.
- ciArrayKlass* ciArrayKlass::make(ciType* element_type) {
+ ciArrayKlass* ciArrayKlass::make(ciType* element_type, bool null_free, bool atomic, bool refined_type) {
    if (element_type->is_primitive_type()) {
      return ciTypeArrayKlass::make(element_type->basic_type());
    } else {
-     return ciObjArrayKlass::make(element_type->as_klass());
+     return ciObjArrayKlass::make(element_type->as_klass(), refined_type, null_free, atomic);
    }
  }
  
+ int ciArrayKlass::array_header_in_bytes() {
+   return get_ArrayKlass()->array_header_in_bytes();
+ }
+ 
+ ciInstance* ciArrayKlass::component_mirror_instance() const {
+   GUARDED_VM_ENTRY(
+     oop component_mirror = ArrayKlass::cast(get_Klass())->component_mirror();
+     return CURRENT_ENV->get_instance(component_mirror);
+   )
+ }
+ 
+ bool ciArrayKlass::is_elem_null_free() const {
+   ArrayKlass::ArrayProperties props = properties();
+   assert(props != ArrayKlass::INVALID, "meaningless");
+   return ArrayKlass::is_null_restricted(props);
+ }
+ 
+ bool ciArrayKlass::is_elem_atomic() const {
+   ArrayKlass::ArrayProperties props = properties();
+   assert(props != ArrayKlass::INVALID, "meaningless");
+   return !ArrayKlass::is_non_atomic(props);
+ }
+ 
+ ArrayKlass::ArrayProperties ciArrayKlass::properties() const {
+   GUARDED_VM_ENTRY(return ArrayKlass::cast(get_Klass())->properties();)
+ }
< prev index next >