8140594: Various minor code improvements (compiler)

Various minor code improvements (compiler)

Reviewed-by: thartmann, kvn
This commit is contained in:
Goetz Lindenmaier 2016-05-03 12:23:06 +02:00
parent 96c4dc3210
commit 1e4b00b1dc
19 changed files with 77 additions and 56 deletions

View file

@ -1401,9 +1401,11 @@ class ClassFileParser::FieldAllocationCount : public ResourceObj {
FieldAllocationType update(bool is_static, BasicType type) {
FieldAllocationType atype = basic_type_to_atype(is_static, type);
// Make sure there is no overflow with injected fields.
assert(count[atype] < 0xFFFF, "More than 65535 fields");
count[atype]++;
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;
}
};
@ -3335,8 +3337,9 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
}
} else if (tag == vmSymbols::tag_bootstrap_methods() &&
_major_version >= Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
if (parsed_bootstrap_methods_attribute)
if (parsed_bootstrap_methods_attribute) {
classfile_parse_error("Multiple BootstrapMethods attributes in class file %s", CHECK);
}
parsed_bootstrap_methods_attribute = true;
parse_classfile_bootstrap_methods_attribute(cfs, cp, attribute_length, CHECK);
} else if (tag == vmSymbols::tag_runtime_visible_type_annotations()) {