1449 MetadataFactory::new_array<AnnotationArray*>(_loader_data,
1450 length,
1451 nullptr,
1452 CHECK);
1453 }
1454 _fields_type_annotations->at_put(n, parsed_annotations.field_type_annotations());
1455 parsed_annotations.set_field_type_annotations(nullptr);
1456 }
1457
1458 if (is_synthetic) {
1459 access_flags.set_is_synthetic();
1460 }
1461 if (generic_signature_index != 0) {
1462 fieldFlags.update_generic(true);
1463 }
1464 }
1465
1466 const BasicType type = cp->basic_type_for_signature_at(signature_index);
1467
1468 // Update number of static oop fields.
1469 if (is_static && is_reference_type(type)) {
1470 _static_oop_count++;
1471 }
1472
1473 FieldInfo fi(access_flags, name_index, signature_index, constantvalue_index, fieldFlags);
1474 fi.set_index(n);
1475 if (fieldFlags.is_generic()) {
1476 fi.set_generic_signature_index(generic_signature_index);
1477 }
1478 parsed_annotations.apply_to(&fi);
1479 if (fi.field_flags().is_contended()) {
1480 _has_contended_fields = true;
1481 }
1482 _temp_field_info->append(fi);
1483 }
1484 assert(_temp_field_info->length() == length, "Must be");
1485
1486 int index = length;
1487 if (num_injected != 0) {
1488 for (int n = 0; n < num_injected; n++) {
1489 // Check for duplicates
1490 if (injected[n].may_be_java) {
5076
5077 _loader_data->add_class(ik, publicize);
5078
5079 set_klass_to_deallocate(ik);
5080
5081 assert(_field_info != nullptr, "invariant");
5082 assert(ik->static_field_size() == _field_info->_static_field_size, "sanity");
5083 assert(ik->nonstatic_oop_map_count() == _field_info->oop_map_blocks->_nonstatic_oop_map_count,
5084 "sanity");
5085
5086 assert(ik->is_instance_klass(), "sanity");
5087 assert(ik->size_helper() == _field_info->_instance_size, "sanity");
5088
5089 // Fill in information already parsed
5090 ik->set_should_verify_class(_need_verify);
5091
5092 // Not yet: supers are done below to support the new subtype-checking fields
5093 ik->set_nonstatic_field_size(_field_info->_nonstatic_field_size);
5094 ik->set_has_nonstatic_fields(_field_info->_has_nonstatic_fields);
5095 ik->set_static_oop_field_count(_static_oop_count);
5096
5097 // this transfers ownership of a lot of arrays from
5098 // the parser onto the InstanceKlass*
5099 apply_parsed_class_metadata(ik, _java_fields_count);
5100
5101 // can only set dynamic nest-host after static nest information is set
5102 if (cl_inst_info.dynamic_nest_host() != nullptr) {
5103 ik->set_nest_host(cl_inst_info.dynamic_nest_host());
5104 }
5105
5106 // note that is not safe to use the fields in the parser from this point on
5107 assert(nullptr == _cp, "invariant");
5108 assert(nullptr == _fieldinfo_stream, "invariant");
5109 assert(nullptr == _fieldinfo_search_table, "invariant");
5110 assert(nullptr == _fields_status, "invariant");
5111 assert(nullptr == _methods, "invariant");
5112 assert(nullptr == _inner_classes, "invariant");
5113 assert(nullptr == _nest_members, "invariant");
5114 assert(nullptr == _combined_annotations, "invariant");
5115 assert(nullptr == _record_components, "invariant");
5306 _class_name = new_class_name;
5307 // Increment the refcount of the new name.
5308 // Now the ClassFileParser owns this name and will decrement in
5309 // the destructor.
5310 _class_name->increment_refcount();
5311 }
5312
5313 ClassFileParser::ClassFileParser(ClassFileStream* stream,
5314 Symbol* name,
5315 ClassLoaderData* loader_data,
5316 const ClassLoadInfo* cl_info,
5317 Publicity pub_level,
5318 TRAPS) :
5319 _stream(stream),
5320 _class_name(nullptr),
5321 _loader_data(loader_data),
5322 _is_hidden(cl_info->is_hidden()),
5323 _can_access_vm_annotations(cl_info->can_access_vm_annotations()),
5324 _orig_cp_size(0),
5325 _static_oop_count(0),
5326 _super_klass(),
5327 _cp(nullptr),
5328 _fieldinfo_stream(nullptr),
5329 _fieldinfo_search_table(nullptr),
5330 _fields_status(nullptr),
5331 _methods(nullptr),
5332 _inner_classes(nullptr),
5333 _nest_members(nullptr),
5334 _nest_host(0),
5335 _permitted_subclasses(nullptr),
5336 _record_components(nullptr),
5337 _local_interfaces(nullptr),
5338 _transitive_interfaces(nullptr),
5339 _combined_annotations(nullptr),
5340 _class_annotations(nullptr),
5341 _class_type_annotations(nullptr),
5342 _fields_annotations(nullptr),
5343 _fields_type_annotations(nullptr),
5344 _klass(nullptr),
5345 _klass_to_deallocate(nullptr),
|
1449 MetadataFactory::new_array<AnnotationArray*>(_loader_data,
1450 length,
1451 nullptr,
1452 CHECK);
1453 }
1454 _fields_type_annotations->at_put(n, parsed_annotations.field_type_annotations());
1455 parsed_annotations.set_field_type_annotations(nullptr);
1456 }
1457
1458 if (is_synthetic) {
1459 access_flags.set_is_synthetic();
1460 }
1461 if (generic_signature_index != 0) {
1462 fieldFlags.update_generic(true);
1463 }
1464 }
1465
1466 const BasicType type = cp->basic_type_for_signature_at(signature_index);
1467
1468 // Update number of static oop fields.
1469 if (is_reference_type(type)) {
1470 if (is_static) {
1471 _static_oop_count++;
1472 } else {
1473 _nonstatic_oop_count++;
1474 }
1475 }
1476
1477 FieldInfo fi(access_flags, name_index, signature_index, constantvalue_index, fieldFlags);
1478 fi.set_index(n);
1479 if (fieldFlags.is_generic()) {
1480 fi.set_generic_signature_index(generic_signature_index);
1481 }
1482 parsed_annotations.apply_to(&fi);
1483 if (fi.field_flags().is_contended()) {
1484 _has_contended_fields = true;
1485 }
1486 _temp_field_info->append(fi);
1487 }
1488 assert(_temp_field_info->length() == length, "Must be");
1489
1490 int index = length;
1491 if (num_injected != 0) {
1492 for (int n = 0; n < num_injected; n++) {
1493 // Check for duplicates
1494 if (injected[n].may_be_java) {
5080
5081 _loader_data->add_class(ik, publicize);
5082
5083 set_klass_to_deallocate(ik);
5084
5085 assert(_field_info != nullptr, "invariant");
5086 assert(ik->static_field_size() == _field_info->_static_field_size, "sanity");
5087 assert(ik->nonstatic_oop_map_count() == _field_info->oop_map_blocks->_nonstatic_oop_map_count,
5088 "sanity");
5089
5090 assert(ik->is_instance_klass(), "sanity");
5091 assert(ik->size_helper() == _field_info->_instance_size, "sanity");
5092
5093 // Fill in information already parsed
5094 ik->set_should_verify_class(_need_verify);
5095
5096 // Not yet: supers are done below to support the new subtype-checking fields
5097 ik->set_nonstatic_field_size(_field_info->_nonstatic_field_size);
5098 ik->set_has_nonstatic_fields(_field_info->_has_nonstatic_fields);
5099 ik->set_static_oop_field_count(_static_oop_count);
5100 ik->set_nonstatic_oop_field_count(_nonstatic_oop_count);
5101
5102 // this transfers ownership of a lot of arrays from
5103 // the parser onto the InstanceKlass*
5104 apply_parsed_class_metadata(ik, _java_fields_count);
5105
5106 // can only set dynamic nest-host after static nest information is set
5107 if (cl_inst_info.dynamic_nest_host() != nullptr) {
5108 ik->set_nest_host(cl_inst_info.dynamic_nest_host());
5109 }
5110
5111 // note that is not safe to use the fields in the parser from this point on
5112 assert(nullptr == _cp, "invariant");
5113 assert(nullptr == _fieldinfo_stream, "invariant");
5114 assert(nullptr == _fieldinfo_search_table, "invariant");
5115 assert(nullptr == _fields_status, "invariant");
5116 assert(nullptr == _methods, "invariant");
5117 assert(nullptr == _inner_classes, "invariant");
5118 assert(nullptr == _nest_members, "invariant");
5119 assert(nullptr == _combined_annotations, "invariant");
5120 assert(nullptr == _record_components, "invariant");
5311 _class_name = new_class_name;
5312 // Increment the refcount of the new name.
5313 // Now the ClassFileParser owns this name and will decrement in
5314 // the destructor.
5315 _class_name->increment_refcount();
5316 }
5317
5318 ClassFileParser::ClassFileParser(ClassFileStream* stream,
5319 Symbol* name,
5320 ClassLoaderData* loader_data,
5321 const ClassLoadInfo* cl_info,
5322 Publicity pub_level,
5323 TRAPS) :
5324 _stream(stream),
5325 _class_name(nullptr),
5326 _loader_data(loader_data),
5327 _is_hidden(cl_info->is_hidden()),
5328 _can_access_vm_annotations(cl_info->can_access_vm_annotations()),
5329 _orig_cp_size(0),
5330 _static_oop_count(0),
5331 _nonstatic_oop_count(0),
5332 _super_klass(),
5333 _cp(nullptr),
5334 _fieldinfo_stream(nullptr),
5335 _fieldinfo_search_table(nullptr),
5336 _fields_status(nullptr),
5337 _methods(nullptr),
5338 _inner_classes(nullptr),
5339 _nest_members(nullptr),
5340 _nest_host(0),
5341 _permitted_subclasses(nullptr),
5342 _record_components(nullptr),
5343 _local_interfaces(nullptr),
5344 _transitive_interfaces(nullptr),
5345 _combined_annotations(nullptr),
5346 _class_annotations(nullptr),
5347 _class_type_annotations(nullptr),
5348 _fields_annotations(nullptr),
5349 _fields_type_annotations(nullptr),
5350 _klass(nullptr),
5351 _klass_to_deallocate(nullptr),
|