comparison src/share/vm/classfile/systemDictionary.cpp @ 20350:c3990b8c710e hs25.40-b07

8054402: "klass->is_loader_alive(_is_alive)) failed: must be alive" for anonymous classes Summary: Because anonymous classes are not in the system dictionary, we have to set 'unloading_occurred' based on 'CLDG::do_unloading()'. Added jtreg test. Reviewed-by: kvn, coleenp
author thartmann
date Mon, 25 Aug 2014 08:20:17 +0200
parents 2c6ef90f030a
children 6e0cb14ce59b
comparison
equal deleted inserted replaced
20349:7fa57b65c27f 20350:c3990b8c710e
1660 1660
1661 // Assumes classes in the SystemDictionary are only unloaded at a safepoint 1661 // Assumes classes in the SystemDictionary are only unloaded at a safepoint
1662 // Note: anonymous classes are not in the SD. 1662 // Note: anonymous classes are not in the SD.
1663 bool SystemDictionary::do_unloading(BoolObjectClosure* is_alive) { 1663 bool SystemDictionary::do_unloading(BoolObjectClosure* is_alive) {
1664 // First, mark for unload all ClassLoaderData referencing a dead class loader. 1664 // First, mark for unload all ClassLoaderData referencing a dead class loader.
1665 bool has_dead_loaders = ClassLoaderDataGraph::do_unloading(is_alive); 1665 bool unloading_occurred = ClassLoaderDataGraph::do_unloading(is_alive);
1666 bool unloading_occurred = false; 1666 if (unloading_occurred) {
1667 if (has_dead_loaders) { 1667 dictionary()->do_unloading();
1668 unloading_occurred = dictionary()->do_unloading();
1669 constraints()->purge_loader_constraints(); 1668 constraints()->purge_loader_constraints();
1670 resolution_errors()->purge_resolution_errors(); 1669 resolution_errors()->purge_resolution_errors();
1671 } 1670 }
1672 // Oops referenced by the system dictionary may get unreachable independently 1671 // Oops referenced by the system dictionary may get unreachable independently
1673 // of the class loader (eg. cached protection domain oops). So we need to 1672 // of the class loader (eg. cached protection domain oops). So we need to