< prev index next >

src/hotspot/share/classfile/classFileParser.cpp

Print this page
*** 1464,12 ***
      }
  
      const BasicType type = cp->basic_type_for_signature_at(signature_index);
  
      // Update number of static oop fields.
!     if (is_static && is_reference_type(type)) {
!       _static_oop_count++;
      }
  
      FieldInfo fi(access_flags, name_index, signature_index, constantvalue_index, fieldFlags);
      fi.set_index(n);
      if (fieldFlags.is_generic()) {
--- 1464,16 ---
      }
  
      const BasicType type = cp->basic_type_for_signature_at(signature_index);
  
      // Update number of static oop fields.
!     if (is_reference_type(type)) {
!       if (is_static) {
+         _static_oop_count++;
+       } else {
+         _nonstatic_oop_count++;
+       }
      }
  
      FieldInfo fi(access_flags, name_index, signature_index, constantvalue_index, fieldFlags);
      fi.set_index(n);
      if (fieldFlags.is_generic()) {

*** 5091,10 ***
--- 5095,11 ---
  
    // Not yet: supers are done below to support the new subtype-checking fields
    ik->set_nonstatic_field_size(_field_info->_nonstatic_field_size);
    ik->set_has_nonstatic_fields(_field_info->_has_nonstatic_fields);
    ik->set_static_oop_field_count(_static_oop_count);
+   ik->set_nonstatic_oop_field_count(_nonstatic_oop_count);
  
    // this transfers ownership of a lot of arrays from
    // the parser onto the InstanceKlass*
    apply_parsed_class_metadata(ik, _java_fields_count);
  

*** 5321,10 ***
--- 5326,11 ---
    _loader_data(loader_data),
    _is_hidden(cl_info->is_hidden()),
    _can_access_vm_annotations(cl_info->can_access_vm_annotations()),
    _orig_cp_size(0),
    _static_oop_count(0),
+   _nonstatic_oop_count(0),
    _super_klass(),
    _cp(nullptr),
    _fieldinfo_stream(nullptr),
    _fieldinfo_search_table(nullptr),
    _fields_status(nullptr),
< prev index next >