--- old/src/share/vm/ci/ciInstanceKlass.hpp 2016-12-02 14:22:05.947886118 +0100 +++ new/src/share/vm/ci/ciInstanceKlass.hpp 2016-12-02 14:22:05.615886107 +0100 @@ -65,6 +65,8 @@ ciConstantPoolCache* _field_cache; // cached map index->field GrowableArray* _nonstatic_fields; + int _nof_declared_nonstatic_fields; // Number of nonstatic fields declared in the bytecode + // i.e., without value types flattened into the instance. int _has_injected_fields; // any non static injected fields? lazily initialized. // The possible values of the _implementor fall into following three cases: @@ -196,6 +198,14 @@ return _nonstatic_fields->length(); } + int nof_declared_nonstatic_fields() { + if (_nonstatic_fields == NULL) { + compute_nonstatic_fields(); + } + assert(_nof_declared_nonstatic_fields >= 0, "after lazy initialization _nof_declared_nonstatic_fields must be at least 0"); + return _nof_declared_nonstatic_fields; + } + bool has_injected_fields() { if (_has_injected_fields == -1) { compute_injected_fields();