Mercurial > hg > graal-compiler
diff src/share/vm/classfile/dictionary.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 |
line wrap: on
line diff
--- a/src/share/vm/classfile/dictionary.cpp Thu Aug 21 14:48:49 2014 -0700 +++ b/src/share/vm/classfile/dictionary.cpp Mon Aug 25 08:20:17 2014 +0200 @@ -130,15 +130,13 @@ } -bool Dictionary::do_unloading() { +void Dictionary::do_unloading() { assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); - bool class_was_unloaded = false; - int index = 0; // Defined here for portability! Do not move // Remove unloadable entries and classes from system dictionary // The placeholder array has been handled in always_strong_oops_do. DictionaryEntry* probe = NULL; - for (index = 0; index < table_size(); index++) { + for (int index = 0; index < table_size(); index++) { for (DictionaryEntry** p = bucket_addr(index); *p != NULL; ) { probe = *p; Klass* e = probe->klass(); @@ -158,16 +156,8 @@ // Do we need to delete this system dictionary entry? if (loader_data->is_unloading()) { // If the loader is not live this entry should always be - // removed (will never be looked up again). Note that this is - // not the same as unloading the referred class. - if (k_def_class_loader_data == loader_data) { - // This is the defining entry, so the referred class is about - // to be unloaded. - class_was_unloaded = true; - } - // Also remove this system dictionary entry. + // removed (will never be looked up again). purge_entry = true; - } else { // The loader in this entry is alive. If the klass is dead, // (determined by checking the defining class loader) @@ -196,7 +186,6 @@ p = probe->next_addr(); } } - return class_was_unloaded; } void Dictionary::roots_oops_do(OopClosure* strong, OopClosure* weak) {