8257845: Integrate JEP 390

8254047: [JEP 390] Revise "value-based class" & apply to wrappers
8252181: [JEP 390] Define & apply annotation jdk.internal.ValueBased
8252183: [JEP 390] Add 'lint' warning for @ValueBased classes
8257027: [JEP 390] Diagnose synchronization on @ValueBased classes
8252180: [JEP 390] Deprecate wrapper class constructors for removal

Co-authored-by: Roger Riggs <rriggs@openjdk.org>
Co-authored-by: Srikanth Adayapalam <sadayapalam@openjdk.org>
Co-authored-by: Lois Foltan <lfoltan@openjdk.org>
Reviewed-by: rriggs, hseigel, mchung, darcy
This commit is contained in:
Dan Smith 2020-12-08 23:04:01 +00:00
parent ed4c4ee73b
commit 48d8650ae1
113 changed files with 695 additions and 327 deletions

View file

@ -1091,6 +1091,7 @@ public:
_jdk_internal_vm_annotation_Contended,
_field_Stable,
_jdk_internal_vm_annotation_ReservedStackAccess,
_jdk_internal_ValueBased,
_annotation_LIMIT
};
const Location _location;
@ -2147,6 +2148,11 @@ AnnotationCollector::annotation_index(const ClassLoaderData* loader_data,
if (RestrictReservedStack && !privileged) break; // honor privileges
return _jdk_internal_vm_annotation_ReservedStackAccess;
}
case VM_SYMBOL_ENUM_NAME(jdk_internal_ValueBased_signature): {
if (_location != _in_class) break; // only allow for classes
if (!privileged) break; // only allow in priviledged code
return _jdk_internal_ValueBased;
}
default: {
break;
}
@ -2190,7 +2196,16 @@ void MethodAnnotationCollector::apply_to(const methodHandle& m) {
void ClassFileParser::ClassAnnotationCollector::apply_to(InstanceKlass* ik) {
assert(ik != NULL, "invariant");
ik->set_is_contended(is_contended());
if (has_annotation(_jdk_internal_vm_annotation_Contended)) {
ik->set_is_contended(is_contended());
}
if (has_annotation(_jdk_internal_ValueBased)) {
ik->set_has_value_based_class_annotation();
if (DiagnoseSyncOnValueBasedClasses) {
ik->set_is_value_based();
ik->set_prototype_header(markWord::prototype());
}
}
}
#define MAX_ARGS_SIZE 255