# HG changeset patch # User anoll # Date 1410871151 -7200 # Node ID 1e985d72c57fc6bea7c24196035cc1aa23369f8b # Parent fca1785e70847d2854bb0cf0b6ef2cc91dead7a1 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 diff -r fca1785e7084 -r 1e985d72c57f hotspot/src/share/vm/ci/ciField.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; diff -r fca1785e7084 -r 1e985d72c57f hotspot/src/share/vm/ci/ciInstanceKlass.cpp --- 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* _arr; - ciEnv* _curEnv; -public: - NonStaticFieldFiller(ciEnv* curEnv, GrowableArray* arr) : - _curEnv(curEnv), _arr(arr) - {} - void do_field(fieldDescriptor* fd) { - ciField* field = new (_curEnv->arena()) ciField(fd); - _arr->append(field); - } -}; - -GrowableArray* 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(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(); diff -r fca1785e7084 -r 1e985d72c57f hotspot/src/share/vm/ci/ciInstanceKlass.hpp --- 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* _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* non_static_fields(); - // total number of nonstatic fields (including inherited): int nof_nonstatic_fields() { if (_nonstatic_fields == NULL)