comparison src/share/vm/prims/jvm.cpp @ 7611:ff0a7943fd29

8005994: Method annotations are allocated unnecessarily during class file parsing Summary: Also reviewed by: vitalyd@gmail.com Reviewed-by: coleenp, acorn
author stefank
date Tue, 15 Jan 2013 10:09:45 +0100
parents ade95d680b42
children f422634e5828
comparison
equal deleted inserted replaced
7610:ed6154d7d259 7611:ff0a7943fd29
1580 ResourceMark rm(THREAD); 1580 ResourceMark rm(THREAD);
1581 // Return null for arrays and primitives 1581 // Return null for arrays and primitives
1582 if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) { 1582 if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
1583 Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls)); 1583 Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
1584 if (k->oop_is_instance()) { 1584 if (k->oop_is_instance()) {
1585 typeArrayOop a = Annotations::make_java_array(InstanceKlass::cast(k)->type_annotations()->class_annotations(), CHECK_NULL); 1585 Annotations* type_annotations = InstanceKlass::cast(k)->type_annotations();
1586 return (jbyteArray) JNIHandles::make_local(env, a); 1586 if (type_annotations != NULL) {
1587 typeArrayOop a = Annotations::make_java_array(type_annotations->class_annotations(), CHECK_NULL);
1588 return (jbyteArray) JNIHandles::make_local(env, a);
1589 }
1587 } 1590 }
1588 } 1591 }
1589 return NULL; 1592 return NULL;
1590 JVM_END 1593 JVM_END
1591 1594