8256052: Remove unused allocation type from fieldInfo

Reviewed-by: redestad, lfoltan, hseigel
This commit is contained in:
Frederic Parain 2020-11-10 19:16:35 +00:00
parent 6d8acd2696
commit bd3e65b576
5 changed files with 27 additions and 121 deletions

View file

@ -1557,14 +1557,13 @@ class ClassFileParser::FieldAllocationCount : public ResourceObj {
}
}
FieldAllocationType update(bool is_static, BasicType type) {
void update(bool is_static, BasicType type) {
FieldAllocationType atype = basic_type_to_atype(is_static, type);
if (atype != BAD_ALLOCATION_TYPE) {
// Make sure there is no overflow with injected fields.
assert(count[atype] < 0xFFFF, "More than 65535 fields");
count[atype]++;
}
return atype;
}
};
@ -1704,9 +1703,8 @@ void ClassFileParser::parse_fields(const ClassFileStream* const cfs,
constantvalue_index);
const BasicType type = cp->basic_type_for_signature_at(signature_index);
// Remember how many oops we encountered and compute allocation type
const FieldAllocationType atype = fac->update(is_static, type);
field->set_allocation_type(atype);
// Update FieldAllocationCount for this kind of field
fac->update(is_static, type);
// After field is initialized with type, we can augment it with aux info
if (parsed_annotations.has_any_annotations()) {
@ -1749,9 +1747,8 @@ void ClassFileParser::parse_fields(const ClassFileStream* const cfs,
const BasicType type = Signature::basic_type(injected[n].signature());
// Remember how many oops we encountered and compute allocation type
const FieldAllocationType atype = fac->update(false, type);
field->set_allocation_type(atype);
// Update FieldAllocationCount for this kind of field
fac->update(false, type);
index++;
}
}