Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/jvmtiRedefineClasses.cpp @ 7457:35431a769282
8004823: Add VM support for type annotation reflection
Reviewed-by: dholmes, coleenp
Contributed-by: joel.franck@oracle.com
author | stefank |
---|---|
date | Thu, 20 Dec 2012 10:22:19 +0100 |
parents | 070d523b96a7 |
children | cc6a617fffd2 |
comparison
equal
deleted
inserted
replaced
7456:7d42f3b08300 | 7457:35431a769282 |
---|---|
3336 flags.clear_has_localvariable_table(); | 3336 flags.clear_has_localvariable_table(); |
3337 } | 3337 } |
3338 the_class->set_access_flags(flags); | 3338 the_class->set_access_flags(flags); |
3339 } | 3339 } |
3340 | 3340 |
3341 // Replace annotation fields value | 3341 // Since there is currently no rewriting of type annotations indexes |
3342 // into the CP, we null out type annotations on scratch_class before | |
3343 // we swap annotations with the_class rather than facing the | |
3344 // possibility of shipping annotations with broken indexes to | |
3345 // Java-land. | |
3346 Annotations* new_annotations = scratch_class->annotations(); | |
3347 if (new_annotations != NULL) { | |
3348 Annotations* new_type_annotations = new_annotations->type_annotations(); | |
3349 if (new_type_annotations != NULL) { | |
3350 MetadataFactory::free_metadata(scratch_class->class_loader_data(), new_type_annotations); | |
3351 new_annotations->set_type_annotations(NULL); | |
3352 } | |
3353 } | |
3354 // Swap annotation fields values | |
3342 Annotations* old_annotations = the_class->annotations(); | 3355 Annotations* old_annotations = the_class->annotations(); |
3343 the_class->set_annotations(scratch_class->annotations()); | 3356 the_class->set_annotations(scratch_class->annotations()); |
3344 scratch_class->set_annotations(old_annotations); | 3357 scratch_class->set_annotations(old_annotations); |
3345 | 3358 |
3346 // Replace minor version number of class file | 3359 // Replace minor version number of class file |