Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/constMethod.cpp @ 8837:0c3ee6f1fa23
8009531: Crash when redefining class with annotated method
Summary: Neglected to copy the annotations in clone_with_new_data when they were moved to ConstMethod.
Reviewed-by: acorn, sspitsyn, dcubed
author | coleenp |
---|---|
date | Wed, 27 Mar 2013 08:19:50 -0400 |
parents | c8b31b461e1a |
children | a1ebd310d5c1 |
comparison
equal
deleted
inserted
replaced
8823:23f2d309e855 | 8837:0c3ee6f1fa23 |
---|---|
361 if (has_parameter_annotations()) offset++; | 361 if (has_parameter_annotations()) offset++; |
362 if (has_type_annotations()) offset++; | 362 if (has_type_annotations()) offset++; |
363 return (AnnotationArray**)constMethod_end() - offset; | 363 return (AnnotationArray**)constMethod_end() - offset; |
364 } | 364 } |
365 | 365 |
366 // copy annotations from 'cm' to 'this' | |
367 void ConstMethod::copy_annotations_from(ConstMethod* cm) { | |
368 if (cm->has_method_annotations()) { | |
369 assert(has_method_annotations(), "should be allocated already"); | |
370 set_method_annotations(cm->method_annotations()); | |
371 } | |
372 if (cm->has_parameter_annotations()) { | |
373 assert(has_parameter_annotations(), "should be allocated already"); | |
374 set_parameter_annotations(cm->parameter_annotations()); | |
375 } | |
376 if (cm->has_type_annotations()) { | |
377 assert(has_type_annotations(), "should be allocated already"); | |
378 set_type_annotations(cm->type_annotations()); | |
379 } | |
380 if (cm->has_default_annotations()) { | |
381 assert(has_default_annotations(), "should be allocated already"); | |
382 set_default_annotations(cm->default_annotations()); | |
383 } | |
384 } | |
385 | |
366 // Printing | 386 // Printing |
367 | 387 |
368 void ConstMethod::print_on(outputStream* st) const { | 388 void ConstMethod::print_on(outputStream* st) const { |
369 ResourceMark rm; | 389 ResourceMark rm; |
370 assert(is_constMethod(), "must be constMethod"); | 390 assert(is_constMethod(), "must be constMethod"); |