8003419: NPG: Clean up metadata created during class loading if failure

Store metadata on ClassFileParser instance to be cleaned up by destructor.  This enabled some refactoring of the enormous parseClassFile function.

Reviewed-by: jmasa, acorn
This commit is contained in:
Coleen Phillimore 2013-03-13 17:34:29 -04:00
parent b243475fd2
commit c5867cb71b
6 changed files with 1155 additions and 1105 deletions

View file

@ -67,6 +67,12 @@ ConstMethod::ConstMethod(int byte_code_size,
set_size_of_parameters(0);
}
// Accessor that copies to metadata.
void ConstMethod::copy_stackmap_data(ClassLoaderData* loader_data,
u1* sd, int length, TRAPS) {
_stackmap_data = MetadataFactory::new_array<u1>(loader_data, length, CHECK);
memcpy((void*)_stackmap_data->adr_at(0), (void*)sd, length);
}
// Deallocate metadata fields associated with ConstMethod*
void ConstMethod::deallocate_contents(ClassLoaderData* loader_data) {