mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8005994: Method annotations are allocated unnecessarily during class file parsing
Also reviewed by: vitalyd@gmail.com Reviewed-by: coleenp, acorn
This commit is contained in:
parent
67fc68ea7f
commit
9d65c6d24f
2 changed files with 34 additions and 20 deletions
|
@ -1582,8 +1582,11 @@ JVM_ENTRY(jbyteArray, JVM_GetClassTypeAnnotations(JNIEnv *env, jclass cls))
|
|||
if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
|
||||
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
|
||||
if (k->oop_is_instance()) {
|
||||
typeArrayOop a = Annotations::make_java_array(InstanceKlass::cast(k)->type_annotations()->class_annotations(), CHECK_NULL);
|
||||
return (jbyteArray) JNIHandles::make_local(env, a);
|
||||
Annotations* type_annotations = InstanceKlass::cast(k)->type_annotations();
|
||||
if (type_annotations != NULL) {
|
||||
typeArrayOop a = Annotations::make_java_array(type_annotations->class_annotations(), CHECK_NULL);
|
||||
return (jbyteArray) JNIHandles::make_local(env, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue