Mercurial > hg > truffle
diff src/share/vm/classfile/classFileParser.cpp @ 7615:f422634e5828
Merge
author | brutisso |
---|---|
date | Fri, 18 Jan 2013 11:03:15 +0100 |
parents | 5b6a231e5a86 ff0a7943fd29 |
children | 22ead76da3f4 |
line wrap: on
line diff
--- a/src/share/vm/classfile/classFileParser.cpp Thu Jan 17 18:47:36 2013 -0800 +++ b/src/share/vm/classfile/classFileParser.cpp Fri Jan 18 11:03:15 2013 +0100 @@ -2503,26 +2503,38 @@ *has_default_methods = true; } methods->at_put(index, method()); - if (*methods_annotations == NULL) { - *methods_annotations = - MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); + + if (method_annotations != NULL) { + if (*methods_annotations == NULL) { + *methods_annotations = + MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); + } + (*methods_annotations)->at_put(index, method_annotations); } - (*methods_annotations)->at_put(index, method_annotations); - if (*methods_parameter_annotations == NULL) { - *methods_parameter_annotations = - MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); + + if (method_parameter_annotations != NULL) { + if (*methods_parameter_annotations == NULL) { + *methods_parameter_annotations = + MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); + } + (*methods_parameter_annotations)->at_put(index, method_parameter_annotations); } - (*methods_parameter_annotations)->at_put(index, method_parameter_annotations); - if (*methods_default_annotations == NULL) { - *methods_default_annotations = - MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); + + if (method_default_annotations != NULL) { + if (*methods_default_annotations == NULL) { + *methods_default_annotations = + MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); + } + (*methods_default_annotations)->at_put(index, method_default_annotations); } - (*methods_default_annotations)->at_put(index, method_default_annotations); - if (*methods_type_annotations == NULL) { - *methods_type_annotations = - MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); + + if (method_type_annotations != NULL) { + if (*methods_type_annotations == NULL) { + *methods_type_annotations = + MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); + } + (*methods_type_annotations)->at_put(index, method_type_annotations); } - (*methods_type_annotations)->at_put(index, method_type_annotations); } if (_need_verify && length > 1) { @@ -3338,8 +3350,7 @@ bool has_final_method = false; AccessFlags promoted_flags; promoted_flags.set_flags(0); - // These need to be oop pointers because they are allocated lazily - // inside parse_methods inside a nested HandleMark + Array<AnnotationArray*>* methods_annotations = NULL; Array<AnnotationArray*>* methods_parameter_annotations = NULL; Array<AnnotationArray*>* methods_default_annotations = NULL;