8058452: ciInstanceKlass::non_static_fields() can be removed
authoranoll
Tue, 16 Sep 2014 14:39:11 +0200
changeset 26706 1e985d72c57f
parent 26705 fca1785e7084
child 26707 92f8c836b168
child 26796 666464578742
8058452: ciInstanceKlass::non_static_fields() can be removed Summary: ciInstanceKlass::non_static_fields() and all associated data structures can be removed since they are unused. Reviewed-by: kvn, thartmann
hotspot/src/share/vm/ci/ciField.hpp
hotspot/src/share/vm/ci/ciInstanceKlass.cpp
hotspot/src/share/vm/ci/ciInstanceKlass.hpp
--- a/hotspot/src/share/vm/ci/ciField.hpp	Mon Sep 15 08:08:22 2014 +0200
+++ b/hotspot/src/share/vm/ci/ciField.hpp	Tue Sep 16 14:39:11 2014 +0200
@@ -39,7 +39,6 @@
   CI_PACKAGE_ACCESS
   friend class ciEnv;
   friend class ciInstanceKlass;
-  friend class NonStaticFieldFiller;
 
 private:
   ciFlags          _flags;
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Mon Sep 15 08:08:22 2014 +0200
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Tue Sep 16 14:39:11 2014 +0200
@@ -44,7 +44,7 @@
 //
 // Loaded instance klass.
 ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) :
-  ciKlass(h_k), _non_static_fields(NULL)
+  ciKlass(h_k)
 {
   assert(get_Klass()->oop_is_instance(), "wrong type");
   assert(get_instanceKlass()->is_loaded(), "must be at least loaded");
@@ -407,37 +407,6 @@
   return field;
 }
 
-// ------------------------------------------------------------------
-// ciInstanceKlass::non_static_fields.
-
-class NonStaticFieldFiller: public FieldClosure {
-  GrowableArray<ciField*>* _arr;
-  ciEnv* _curEnv;
-public:
-  NonStaticFieldFiller(ciEnv* curEnv, GrowableArray<ciField*>* arr) :
-    _curEnv(curEnv), _arr(arr)
-  {}
-  void do_field(fieldDescriptor* fd) {
-    ciField* field = new (_curEnv->arena()) ciField(fd);
-    _arr->append(field);
-  }
-};
-
-GrowableArray<ciField*>* ciInstanceKlass::non_static_fields() {
-  if (_non_static_fields == NULL) {
-    VM_ENTRY_MARK;
-    ciEnv* curEnv = ciEnv::current();
-    InstanceKlass* ik = get_instanceKlass();
-    int max_n_fields = ik->java_fields_count();
-
-    Arena* arena = curEnv->arena();
-    _non_static_fields =
-      new (arena) GrowableArray<ciField*>(arena, max_n_fields, 0, NULL);
-    NonStaticFieldFiller filler(curEnv, _non_static_fields);
-    ik->do_nonstatic_fields(&filler);
-  }
-  return _non_static_fields;
-}
 
 static int sort_field_by_offset(ciField** a, ciField** b) {
   return (*a)->offset_in_bytes() - (*b)->offset_in_bytes();
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp	Mon Sep 15 08:08:22 2014 +0200
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp	Tue Sep 16 14:39:11 2014 +0200
@@ -71,8 +71,6 @@
   //   Itsef: more than one implementors.
   ciInstanceKlass*       _implementor;
 
-  GrowableArray<ciField*>* _non_static_fields;
-
 protected:
   ciInstanceKlass(KlassHandle h_k);
   ciInstanceKlass(ciSymbol* name, jobject loader, jobject protection_domain);
@@ -181,8 +179,6 @@
   ciField* get_field_by_offset(int field_offset, bool is_static);
   ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
 
-  GrowableArray<ciField*>* non_static_fields();
-
   // total number of nonstatic fields (including inherited):
   int nof_nonstatic_fields() {
     if (_nonstatic_fields == NULL)