hotspot/src/share/vm/oops/objArrayKlass.cpp
changeset 38094 46977cd73d86
parent 37190 09d719d466a6
child 40887 8d35e19f5548
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp	Tue Apr 26 11:49:37 2016 +0000
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp	Tue Apr 26 09:08:12 2016 -0400
@@ -23,6 +23,8 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/moduleEntry.hpp"
+#include "classfile/packageEntry.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
@@ -135,14 +137,7 @@
   // GC walks these as strong roots.
   loader_data->add_class(oak);
 
-  // The array is defined in the module of its bottom class
-  Klass* bottom_klass = oak->bottom_klass();
-  ModuleEntry* module;
-  if (bottom_klass->is_instance_klass()) {
-    module = InstanceKlass::cast(bottom_klass)->module();
-  } else {
-    module = ModuleEntryTable::javabase_module();
-  }
+  ModuleEntry* module = oak->module();
   assert(module != NULL, "No module entry for array");
 
   // Call complete_create_array_klass after all instance variables has been initialized.
@@ -422,6 +417,16 @@
                         | (JVM_ACC_ABSTRACT | JVM_ACC_FINAL);
 }
 
+ModuleEntry* ObjArrayKlass::module() const {
+  assert(bottom_klass() != NULL, "ObjArrayKlass returned unexpected NULL bottom_klass");
+  // The array is defined in the module of its bottom class
+  return bottom_klass()->module();
+}
+
+PackageEntry* ObjArrayKlass::package() const {
+  assert(bottom_klass() != NULL, "ObjArrayKlass returned unexpected NULL bottom_klass");
+  return bottom_klass()->package();
+}
 
 // Printing