268 MetadataFactory::free_array<Klass*>(loader_data, ti); 269 } 270 } 271 272 // local interfaces can be empty 273 if (local_interfaces != Universe::the_empty_klass_array() && 274 local_interfaces != NULL && !local_interfaces->is_shared()) { 275 MetadataFactory::free_array<Klass*>(loader_data, local_interfaces); 276 } 277 } 278 279 // This function deallocates the metadata and C heap pointers that the 280 // InstanceKlass points to. 281 void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) { 282 283 // Orphan the mirror first, CMS thinks it's still live. 284 if (java_mirror() != NULL) { 285 java_lang_Class::set_klass(java_mirror(), NULL); 286 } 287 288 // Need to take this class off the class loader data list. 289 loader_data->remove_class(this); 290 291 // The array_klass for this class is created later, after error handling. 292 // For class redefinition, we keep the original class so this scratch class 293 // doesn't have an array class. Either way, assert that there is nothing 294 // to deallocate. 295 assert(array_klasses() == NULL, "array classes shouldn't be created for this class yet"); 296 297 // Release C heap allocated data that this might point to, which includes 298 // reference counting symbol names. 299 release_C_heap_structures(); 300 301 deallocate_methods(loader_data, methods()); 302 set_methods(NULL); 303 304 if (method_ordering() != NULL && 305 method_ordering() != Universe::the_empty_int_array() && 306 !method_ordering()->is_shared()) { 307 MetadataFactory::free_array<int>(loader_data, method_ordering()); | 268 MetadataFactory::free_array<Klass*>(loader_data, ti); 269 } 270 } 271 272 // local interfaces can be empty 273 if (local_interfaces != Universe::the_empty_klass_array() && 274 local_interfaces != NULL && !local_interfaces->is_shared()) { 275 MetadataFactory::free_array<Klass*>(loader_data, local_interfaces); 276 } 277 } 278 279 // This function deallocates the metadata and C heap pointers that the 280 // InstanceKlass points to. 281 void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) { 282 283 // Orphan the mirror first, CMS thinks it's still live. 284 if (java_mirror() != NULL) { 285 java_lang_Class::set_klass(java_mirror(), NULL); 286 } 287 288 // Also remove mirror from handles 289 loader_data->remove_handle(_java_mirror); 290 291 // Need to take this class off the class loader data list. 292 loader_data->remove_class(this); 293 294 // The array_klass for this class is created later, after error handling. 295 // For class redefinition, we keep the original class so this scratch class 296 // doesn't have an array class. Either way, assert that there is nothing 297 // to deallocate. 298 assert(array_klasses() == NULL, "array classes shouldn't be created for this class yet"); 299 300 // Release C heap allocated data that this might point to, which includes 301 // reference counting symbol names. 302 release_C_heap_structures(); 303 304 deallocate_methods(loader_data, methods()); 305 set_methods(NULL); 306 307 if (method_ordering() != NULL && 308 method_ordering() != Universe::the_empty_int_array() && 309 !method_ordering()->is_shared()) { 310 MetadataFactory::free_array<int>(loader_data, method_ordering()); |