< prev index next >

src/hotspot/share/ci/ciArrayKlass.cpp

Print this page

        

@@ -25,10 +25,13 @@
 #include "precompiled.hpp"
 #include "ci/ciArrayKlass.hpp"
 #include "ci/ciObjArrayKlass.hpp"
 #include "ci/ciTypeArrayKlass.hpp"
 #include "ci/ciUtilities.hpp"
+#include "ci/ciUtilities.inline.hpp"
+#include "ci/ciValueArrayKlass.hpp"
+#include "ci/ciValueKlass.hpp"
 
 // ciArrayKlass
 //
 // This class represents a Klass* in the HotSpot virtual machine
 // whose Klass part in an ArrayKlass.

@@ -57,11 +60,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();
   }
 }
 
 
 // ------------------------------------------------------------------

@@ -69,16 +72,18 @@
 //
 // What type is obtained when this array is indexed as many times as possible?
 ciType* ciArrayKlass::base_element_type() {
   if (is_type_array_klass()) {
     return ciType::make(as_type_array_klass()->element_type());
-  } else {
+  } else if (is_obj_array_klass()) {
     ciKlass* ek = as_obj_array_klass()->base_element_klass();
     if (ek->is_type_array_klass()) {
       return ciType::make(ek->as_type_array_klass()->element_type());
     }
     return ek;
+  } else {
+    return as_value_array_klass()->base_element_klass();
   }
 }
 
 
 // ------------------------------------------------------------------

@@ -94,12 +99,29 @@
 
 // ------------------------------------------------------------------
 // ciArrayKlass::base_element_type
 //
 // What type is obtained when this array is indexed as many times as possible?
-ciArrayKlass* ciArrayKlass::make(ciType* element_type) {
+ciArrayKlass* ciArrayKlass::make(ciType* element_type, bool never_null) {
   if (element_type->is_primitive_type()) {
     return ciTypeArrayKlass::make(element_type->basic_type());
+  } else if (element_type->is_valuetype() && element_type->as_value_klass()->flatten_array() && never_null) {
+    return ciValueArrayKlass::make(element_type->as_klass());
   } else {
-    return ciObjArrayKlass::make(element_type->as_klass());
+    return ciObjArrayKlass::make(element_type->as_klass(), never_null);
   }
 }
+
+int ciArrayKlass::array_header_in_bytes() {
+  return get_ArrayKlass()->array_header_in_bytes();
+}
+
+ArrayStorageProperties ciArrayKlass::storage_properties() {
+  return get_ArrayKlass()->storage_properties();
+}
+
+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);
+  )
+}
< prev index next >