8049105: Move array component mirror to instance of java/lang/Class (hotspot part 2)
authorcoleenp
Thu, 28 Aug 2014 11:29:09 -0400
changeset 26412 80741eb33ba2
parent 26408 d6defe172e25
child 26413 920381b1a54b
8049105: Move array component mirror to instance of java/lang/Class (hotspot part 2) Summary: This removes component mirrors from arrayKlass metadata and the C2 intrinsic for them. Reviewed-by: kvn, twisti, mgerdin
hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java
hotspot/make/aix/makefiles/mapfile-vers-debug
hotspot/make/aix/makefiles/mapfile-vers-product
hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug
hotspot/make/bsd/makefiles/mapfile-vers-darwin-product
hotspot/make/bsd/makefiles/mapfile-vers-debug
hotspot/make/bsd/makefiles/mapfile-vers-product
hotspot/make/linux/makefiles/mapfile-vers-debug
hotspot/make/linux/makefiles/mapfile-vers-product
hotspot/make/solaris/makefiles/mapfile-vers
hotspot/src/share/vm/ci/ciArrayKlass.hpp
hotspot/src/share/vm/classfile/javaClasses.cpp
hotspot/src/share/vm/classfile/javaClasses.hpp
hotspot/src/share/vm/classfile/vmSymbols.hpp
hotspot/src/share/vm/oops/arrayKlass.cpp
hotspot/src/share/vm/oops/arrayKlass.hpp
hotspot/src/share/vm/oops/klass.hpp
hotspot/src/share/vm/opto/library_call.cpp
hotspot/src/share/vm/opto/memnode.cpp
hotspot/src/share/vm/prims/jvm.cpp
hotspot/src/share/vm/prims/jvm.h
hotspot/src/share/vm/runtime/reflection.cpp
hotspot/src/share/vm/runtime/vmStructs.cpp
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,6 @@
     higherDimension    = new MetadataField(type.getAddressField("_higher_dimension"), 0);
     lowerDimension     = new MetadataField(type.getAddressField("_lower_dimension"), 0);
     vtableLen          = new CIntField(type.getCIntegerField("_vtable_len"), 0);
-    componentMirror    = new OopField(type.getOopField("_component_mirror"), 0);
     javaLangCloneableName = null;
     javaLangObjectName = null;
     javaIoSerializableName = null;
@@ -63,7 +62,6 @@
   private static MetadataField  higherDimension;
   private static MetadataField  lowerDimension;
   private static CIntField vtableLen;
-  private static OopField  componentMirror;
 
   public Klass getJavaSuper() {
     SystemDictionary sysDict = VM.getVM().getSystemDictionary();
@@ -74,7 +72,6 @@
   public Klass getHigherDimension() { return (Klass) higherDimension.getValue(this); }
   public Klass getLowerDimension()  { return (Klass) lowerDimension.getValue(this); }
   public long  getVtableLen()       { return         vtableLen.getValue(this); }
-  public Oop   getComponentMirror() { return         componentMirror.getValue(this); }
 
   // constant class names - javaLangCloneable, javaIoSerializable, javaLangObject
   // Initialized lazily to avoid initialization ordering dependencies between ArrayKlass and SymbolTable
@@ -144,6 +141,5 @@
     visitor.doMetadata(higherDimension, true);
     visitor.doMetadata(lowerDimension, true);
       visitor.doCInt(vtableLen, true);
-      visitor.doOop(componentMirror, true);
     }
   }
--- a/hotspot/make/aix/makefiles/mapfile-vers-debug	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/aix/makefiles/mapfile-vers-debug	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,6 @@
                 JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
-                JVM_GetComponentType;
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
--- a/hotspot/make/aix/makefiles/mapfile-vers-product	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/aix/makefiles/mapfile-vers-product	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,6 @@
                 JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
-                JVM_GetComponentType;
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -123,7 +123,6 @@
                 _JVM_GetClassSignature
                 _JVM_GetClassSigners
                 _JVM_GetClassTypeAnnotations
-                _JVM_GetComponentType
                 _JVM_GetDeclaredClasses
                 _JVM_GetDeclaringClass
                 _JVM_GetEnclosingMethodInfo
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -123,7 +123,6 @@
                 _JVM_GetClassSignature
                 _JVM_GetClassSigners
                 _JVM_GetClassTypeAnnotations
-                _JVM_GetComponentType
                 _JVM_GetDeclaredClasses
                 _JVM_GetDeclaringClass
                 _JVM_GetEnclosingMethodInfo
--- a/hotspot/make/bsd/makefiles/mapfile-vers-debug	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,6 @@
                 JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
-                JVM_GetComponentType;
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
--- a/hotspot/make/bsd/makefiles/mapfile-vers-product	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-product	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,6 @@
                 JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
-                JVM_GetComponentType;
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
--- a/hotspot/make/linux/makefiles/mapfile-vers-debug	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/linux/makefiles/mapfile-vers-debug	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,6 @@
                 JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
-                JVM_GetComponentType;
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
--- a/hotspot/make/linux/makefiles/mapfile-vers-product	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/linux/makefiles/mapfile-vers-product	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,6 @@
                 JVM_GetClassSignature;
                 JVM_GetClassSigners;
                 JVM_GetClassTypeAnnotations;
-                JVM_GetComponentType;
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
--- a/hotspot/make/solaris/makefiles/mapfile-vers	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/make/solaris/makefiles/mapfile-vers	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,6 @@
                 JVM_GetClassNameUTF;
                 JVM_GetClassSignature;
                 JVM_GetClassSigners;
-                JVM_GetComponentType;
                 JVM_GetClassTypeAnnotations;
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
--- a/hotspot/src/share/vm/ci/ciArrayKlass.hpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciArrayKlass.hpp	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,11 +52,6 @@
   ciType* base_element_type();  // JLS calls this the "element type"
   bool is_leaf_type();          // No subtypes of this array type.
 
-  ciInstance* component_mirror() {
-    // This is a real field in ArrayKlass, but we derive it from element_type.
-    return element_type()->java_mirror();
-  }
-
   // What kind of vmObject is this?
   bool is_array_klass() const { return true; }
   bool is_java_klass() const  { return true; }
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Thu Aug 28 11:29:09 2014 -0400
@@ -620,7 +620,6 @@
       // Two-way link between the array klass and its component mirror:
       // (array_klass) k -> mirror -> component_mirror -> array_klass -> k
       set_component_mirror(mirror(), comp_mirror());
-      ArrayKlass::cast(k())->set_component_mirror(comp_mirror());
       set_array_klass(comp_mirror(), k());
     } else {
       assert(k->oop_is_instance(), "Must be");
@@ -682,10 +681,9 @@
 }
 
 void java_lang_Class::set_component_mirror(oop java_class, oop comp_mirror) {
-  if (_component_mirror_offset != 0) {
+  assert(_component_mirror_offset != 0, "must be set");
     java_class->obj_field_put(_component_mirror_offset, comp_mirror);
   }
-}
 oop java_lang_Class::component_mirror(oop java_class) {
   assert(_component_mirror_offset != 0, "must be set");
   return java_class->obj_field(_component_mirror_offset);
@@ -875,22 +873,27 @@
   assert(!offsets_computed, "offsets should be initialized only once");
   offsets_computed = true;
 
-  Klass* klass_oop = SystemDictionary::Class_klass();
+  Klass* k = SystemDictionary::Class_klass();
   // The classRedefinedCount field is only present starting in 1.5,
   // so don't go fatal.
   compute_optional_offset(classRedefinedCount_offset,
-                          klass_oop, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature());
+                          k, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature());
 
   // Needs to be optional because the old build runs Queens during bootstrapping
   // and jdk8-9 doesn't have coordinated pushes yet.
   compute_optional_offset(_class_loader_offset,
-                 klass_oop, vmSymbols::classLoader_name(),
+                 k, vmSymbols::classLoader_name(),
                  vmSymbols::classloader_signature());
 
-  compute_optional_offset(_component_mirror_offset,
-                 klass_oop, vmSymbols::componentType_name(),
+  compute_offset(_component_mirror_offset,
+                 k, vmSymbols::componentType_name(),
                  vmSymbols::class_signature());
 
+  // Init lock is a C union with component_mirror.  Only instanceKlass mirrors have
+  // init_lock and only ArrayKlass mirrors have component_mirror.  Since both are oops
+  // GC treats them the same.
+  _init_lock_offset = _component_mirror_offset;
+
   CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
 }
 
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Thu Aug 28 11:29:09 2014 -0400
@@ -222,7 +222,6 @@
   macro(java_lang_Class, oop_size,               int_signature,     false) \
   macro(java_lang_Class, static_oop_field_count, int_signature,     false) \
   macro(java_lang_Class, protection_domain,      object_signature,  false) \
-  macro(java_lang_Class, init_lock,              object_signature,  false) \
   macro(java_lang_Class, signers,                object_signature,  false)
 
 class java_lang_Class : AllStatic {
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp	Thu Aug 28 11:29:09 2014 -0400
@@ -399,7 +399,6 @@
   template(oop_size_name,                             "oop_size")                                 \
   template(static_oop_field_count_name,               "static_oop_field_count")                   \
   template(protection_domain_name,                    "protection_domain")                        \
-  template(init_lock_name,                            "init_lock")                                \
   template(signers_name,                              "signers_name")                             \
   template(loader_data_name,                          "loader_data")                              \
   template(dependencies_name,                         "dependencies")                             \
@@ -747,8 +746,6 @@
    do_name(     isPrimitive_name,                                "isPrimitive")                                         \
   do_intrinsic(_getSuperclass,            java_lang_Class,        getSuperclass_name, void_class_signature,      F_RN)  \
    do_name(     getSuperclass_name,                              "getSuperclass")                                       \
-  do_intrinsic(_getComponentType,         java_lang_Class,        getComponentType_name, void_class_signature,   F_RN)  \
-   do_name(     getComponentType_name,                           "getComponentType")                                    \
                                                                                                                         \
   do_intrinsic(_getClassAccessFlags,      sun_reflect_Reflection, getClassAccessFlags_name, class_int_signature, F_SN)  \
    do_name(     getClassAccessFlags_name,                        "getClassAccessFlags")                                 \
--- a/hotspot/src/share/vm/oops/arrayKlass.cpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/oops/arrayKlass.cpp	Thu Aug 28 11:29:09 2014 -0400
@@ -78,7 +78,6 @@
   set_dimension(1);
   set_higher_dimension(NULL);
   set_lower_dimension(NULL);
-  set_component_mirror(NULL);
   // Arrays don't add any new methods, so their vtable is the same size as
   // the vtable of klass Object.
   int vtable_size = Universe::base_vtable_size();
@@ -160,14 +159,6 @@
   }
 }
 
-// GC support
-
-void ArrayKlass::oops_do(OopClosure* cl) {
-  Klass::oops_do(cl);
-
-  cl->do_oop(adr_component_mirror());
-}
-
 // JVM support
 
 jint ArrayKlass::compute_modifier_flags(TRAPS) const {
@@ -182,8 +173,6 @@
 
 void ArrayKlass::remove_unshareable_info() {
   Klass::remove_unshareable_info();
-  // Clear the java mirror
-  set_component_mirror(NULL);
 }
 
 void ArrayKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
@@ -217,10 +206,6 @@
 
 void ArrayKlass::verify_on(outputStream* st) {
   Klass::verify_on(st);
-
-  if (component_mirror() != NULL) {
-    guarantee(component_mirror()->klass() != NULL, "should have a class");
-  }
 }
 
 void ArrayKlass::oop_verify_on(oop obj, outputStream* st) {
--- a/hotspot/src/share/vm/oops/arrayKlass.hpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/oops/arrayKlass.hpp	Thu Aug 28 11:29:09 2014 -0400
@@ -39,7 +39,6 @@
   Klass* volatile _higher_dimension;  // Refers the (n+1)'th-dimensional array (if present).
   Klass* volatile _lower_dimension;   // Refers the (n-1)'th-dimensional array (if present).
   int      _vtable_len;        // size of vtable for this klass
-  oop      _component_mirror;  // component type, as a java/lang/Class
 
  protected:
   // Constructors
@@ -70,13 +69,6 @@
   // type of elements (T_OBJECT for both oop arrays and array-arrays)
   BasicType element_type() const        { return layout_helper_element_type(layout_helper()); }
 
-  oop  component_mirror() const         { return _component_mirror; }
-  void set_component_mirror(oop m)      { klass_oop_store(&_component_mirror, m); }
-  oop* adr_component_mirror()           { return (oop*)&this->_component_mirror;}
-
-  // Compiler/Interpreter offset
-  static ByteSize component_mirror_offset() { return in_ByteSize(offset_of(ArrayKlass, _component_mirror)); }
-
   virtual Klass* java_super() const;//{ return SystemDictionary::Object_klass(); }
 
   // Allocation
@@ -122,9 +114,6 @@
   void array_klasses_do(void f(Klass* k));
   void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
 
-  // GC support
-  virtual void oops_do(OopClosure* cl);
-
   // Return a handle.
   static void     complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, TRAPS);
 
--- a/hotspot/src/share/vm/oops/klass.hpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/oops/klass.hpp	Thu Aug 28 11:29:09 2014 -0400
@@ -565,7 +565,7 @@
   TRACE_DEFINE_KLASS_METHODS;
 
   // garbage collection support
-  virtual void oops_do(OopClosure* cl);
+  void oops_do(OopClosure* cl);
 
   // Iff the class loader (or mirror for anonymous classes) is alive the
   // Klass is considered alive.
--- a/hotspot/src/share/vm/opto/library_call.cpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Thu Aug 28 11:29:09 2014 -0400
@@ -836,7 +836,6 @@
   case vmIntrinsics::_isArray:
   case vmIntrinsics::_isPrimitive:
   case vmIntrinsics::_getSuperclass:
-  case vmIntrinsics::_getComponentType:
   case vmIntrinsics::_getClassAccessFlags:      return inline_native_Class_query(intrinsic_id());
 
   case vmIntrinsics::_floatToRawIntBits:
@@ -3400,10 +3399,6 @@
     prim_return_value = null();
     return_type = TypeInstPtr::MIRROR->cast_to_ptr_type(TypePtr::BotPTR);
     break;
-  case vmIntrinsics::_getComponentType:
-    prim_return_value = null();
-    return_type = TypeInstPtr::MIRROR->cast_to_ptr_type(TypePtr::BotPTR);
-    break;
   case vmIntrinsics::_getClassAccessFlags:
     prim_return_value = intcon(JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC);
     return_type = TypeInt::INT;  // not bool!  6297094
@@ -3520,17 +3515,6 @@
     }
     break;
 
-  case vmIntrinsics::_getComponentType:
-    if (generate_array_guard(kls, region) != NULL) {
-      // Be sure to pin the oop load to the guard edge just created:
-      Node* is_array_ctrl = region->in(region->req()-1);
-      Node* cma = basic_plus_adr(kls, in_bytes(ArrayKlass::component_mirror_offset()));
-      Node* cmo = make_load(is_array_ctrl, cma, TypeInstPtr::MIRROR, T_OBJECT, MemNode::unordered);
-      phi->add_req(cmo);
-    }
-    query_value = null();  // non-array case is null
-    break;
-
   case vmIntrinsics::_getClassAccessFlags:
     p = basic_plus_adr(kls, in_bytes(Klass::access_flags_offset()));
     query_value = make_load(NULL, p, TypeInt::INT, T_INT, MemNode::unordered);
--- a/hotspot/src/share/vm/opto/memnode.cpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Thu Aug 28 11:29:09 2014 -0400
@@ -1799,13 +1799,6 @@
       }
       const Type* aift = load_array_final_field(tkls, klass);
       if (aift != NULL)  return aift;
-      if (tkls->offset() == in_bytes(ArrayKlass::component_mirror_offset())
-          && klass->is_array_klass()) {
-        // The field is ArrayKlass::_component_mirror.  Return its (constant) value.
-        // (Folds up aClassConstant.getComponentType, common in Arrays.copyOf.)
-        assert(Opcode() == Op_LoadP, "must load an oop from _component_mirror");
-        return TypeInstPtr::make(klass->as_array_klass()->component_mirror());
-      }
       if (tkls->offset() == in_bytes(Klass::java_mirror_offset())) {
         // The field is Klass::_java_mirror.  Return its (constant) value.
         // (Folds up the 2nd indirection in anObjConstant.getClass().)
@@ -2200,18 +2193,15 @@
   }
 
   // Simplify k.java_mirror.as_klass to plain k, where k is a Klass*.
-  // Simplify ak.component_mirror.array_klass to plain ak, ak an ArrayKlass.
   // See inline_native_Class_query for occurrences of these patterns.
   // Java Example:  x.getClass().isAssignableFrom(y)
-  // Java Example:  Array.newInstance(x.getClass().getComponentType(), n)
   //
   // This improves reflective code, often making the Class
   // mirror go completely dead.  (Current exception:  Class
   // mirrors may appear in debug info, but we could clean them out by
   // introducing a new debug info operator for Klass*.java_mirror).
   if (toop->isa_instptr() && toop->klass() == phase->C->env()->Class_klass()
-      && (offset == java_lang_Class::klass_offset_in_bytes() ||
-          offset == java_lang_Class::array_klass_offset_in_bytes())) {
+      && offset == java_lang_Class::klass_offset_in_bytes()) {
     // We are loading a special hidden field from a Class mirror,
     // the field which points to its Klass or ArrayKlass metaobject.
     if (base->is_Load()) {
@@ -2223,9 +2213,6 @@
           && adr2->is_AddP()
           ) {
         int mirror_field = in_bytes(Klass::java_mirror_offset());
-        if (offset == java_lang_Class::array_klass_offset_in_bytes()) {
-          mirror_field = in_bytes(ArrayKlass::component_mirror_offset());
-        }
         if (tkls->offset() == mirror_field) {
           return adr2->in(AddPNode::Base);
         }
--- a/hotspot/src/share/vm/prims/jvm.cpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Thu Aug 28 11:29:09 2014 -0400
@@ -1403,14 +1403,6 @@
 JVM_END
 
 
-JVM_ENTRY(jclass, JVM_GetComponentType(JNIEnv *env, jclass cls))
-  JVMWrapper("JVM_GetComponentType");
-  oop mirror = JNIHandles::resolve_non_null(cls);
-  oop result = Reflection::array_component_type(mirror, CHECK_NULL);
-  return (jclass) JNIHandles::make_local(env, result);
-JVM_END
-
-
 JVM_ENTRY(jint, JVM_GetClassModifiers(JNIEnv *env, jclass cls))
   JVMWrapper("JVM_GetClassModifiers");
   if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(cls))) {
--- a/hotspot/src/share/vm/prims/jvm.h	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/prims/jvm.h	Thu Aug 28 11:29:09 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -483,9 +483,6 @@
 JNIEXPORT jboolean JNICALL
 JVM_IsPrimitiveClass(JNIEnv *env, jclass cls);
 
-JNIEXPORT jclass JNICALL
-JVM_GetComponentType(JNIEnv *env, jclass cls);
-
 JNIEXPORT jint JNICALL
 JVM_GetClassModifiers(JNIEnv *env, jclass cls);
 
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Thu Aug 28 11:29:09 2014 -0400
@@ -390,7 +390,7 @@
     return NULL;
   }
 
-  oop result = ArrayKlass::cast(klass)->component_mirror();
+  oop result = java_lang_Class::component_mirror(mirror);
 #ifdef ASSERT
   oop result2 = NULL;
   if (ArrayKlass::cast(klass)->dimension() == 1) {
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Thu Aug 28 11:29:09 2014 -0400
@@ -274,7 +274,6 @@
   volatile_nonstatic_field(ArrayKlass,         _higher_dimension,                             Klass*)                                \
   volatile_nonstatic_field(ArrayKlass,         _lower_dimension,                              Klass*)                                \
   nonstatic_field(ArrayKlass,                  _vtable_len,                                   int)                                   \
-  nonstatic_field(ArrayKlass,                  _component_mirror,                             oop)                                   \
   nonstatic_field(CompiledICHolder,     _holder_method,                                Method*)                               \
   nonstatic_field(CompiledICHolder,     _holder_klass,                                 Klass*)                                \
   nonstatic_field(ConstantPool,         _tags,                                         Array<u1>*)                            \