Mercurial > hg > truffle
comparison src/share/vm/classfile/dictionary.cpp @ 20375:6e0cb14ce59b
8046070: Class Data Sharing clean up and refactoring
Summary: Cleaned up CDS to be more configurable, maintainable and extensible
Reviewed-by: dholmes, coleenp, acorn, mchung
author | iklam |
---|---|
date | Thu, 21 Aug 2014 13:57:51 -0700 |
parents | c3990b8c710e |
children | 3375833a603e |
comparison
equal
deleted
inserted
replaced
20374:999824269b71 | 20375:6e0cb14ce59b |
---|---|
207 } | 207 } |
208 } | 208 } |
209 _pd_cache_table->roots_oops_do(strong, weak); | 209 _pd_cache_table->roots_oops_do(strong, weak); |
210 } | 210 } |
211 | 211 |
212 void Dictionary::remove_classes_in_error_state() { | |
213 assert(DumpSharedSpaces, "supported only when dumping"); | |
214 DictionaryEntry* probe = NULL; | |
215 for (int index = 0; index < table_size(); index++) { | |
216 for (DictionaryEntry** p = bucket_addr(index); *p != NULL; ) { | |
217 probe = *p; | |
218 InstanceKlass* ik = InstanceKlass::cast(probe->klass()); | |
219 if (ik->is_in_error_state()) { // purge this entry | |
220 *p = probe->next(); | |
221 if (probe == _current_class_entry) { | |
222 _current_class_entry = NULL; | |
223 } | |
224 free_entry(probe); | |
225 ResourceMark rm; | |
226 tty->print_cr("Removed error class: %s", ik->external_name()); | |
227 continue; | |
228 } | |
229 | |
230 p = probe->next_addr(); | |
231 } | |
232 } | |
233 } | |
234 | |
212 void Dictionary::always_strong_oops_do(OopClosure* blk) { | 235 void Dictionary::always_strong_oops_do(OopClosure* blk) { |
213 // Follow all system classes and temporary placeholders in dictionary; only | 236 // Follow all system classes and temporary placeholders in dictionary; only |
214 // protection domain oops contain references into the heap. In a first | 237 // protection domain oops contain references into the heap. In a first |
215 // pass over the system dictionary determine which need to be treated as | 238 // pass over the system dictionary determine which need to be treated as |
216 // strongly reachable and mark them as such. | 239 // strongly reachable and mark them as such. |
680 } | 703 } |
681 } | 704 } |
682 | 705 |
683 | 706 |
684 // ---------------------------------------------------------------------------- | 707 // ---------------------------------------------------------------------------- |
685 #ifndef PRODUCT | 708 |
686 | 709 void Dictionary::print(bool details) { |
687 void Dictionary::print() { | |
688 ResourceMark rm; | 710 ResourceMark rm; |
689 HandleMark hm; | 711 HandleMark hm; |
690 | 712 |
691 tty->print_cr("Java system dictionary (table_size=%d, classes=%d)", | 713 if (details) { |
692 table_size(), number_of_entries()); | 714 tty->print_cr("Java system dictionary (table_size=%d, classes=%d)", |
693 tty->print_cr("^ indicates that initiating loader is different from " | 715 table_size(), number_of_entries()); |
694 "defining loader"); | 716 tty->print_cr("^ indicates that initiating loader is different from " |
717 "defining loader"); | |
718 } | |
695 | 719 |
696 for (int index = 0; index < table_size(); index++) { | 720 for (int index = 0; index < table_size(); index++) { |
697 for (DictionaryEntry* probe = bucket(index); | 721 for (DictionaryEntry* probe = bucket(index); |
698 probe != NULL; | 722 probe != NULL; |
699 probe = probe->next()) { | 723 probe = probe->next()) { |
700 if (Verbose) tty->print("%4d: ", index); | 724 if (Verbose) tty->print("%4d: ", index); |
701 Klass* e = probe->klass(); | 725 Klass* e = probe->klass(); |
702 ClassLoaderData* loader_data = probe->loader_data(); | 726 ClassLoaderData* loader_data = probe->loader_data(); |
703 bool is_defining_class = | 727 bool is_defining_class = |
704 (loader_data == InstanceKlass::cast(e)->class_loader_data()); | 728 (loader_data == InstanceKlass::cast(e)->class_loader_data()); |
705 tty->print("%s%s", is_defining_class ? " " : "^", | 729 tty->print("%s%s", ((!details) || is_defining_class) ? " " : "^", |
706 e->external_name()); | 730 e->external_name()); |
707 | 731 |
732 if (details) { | |
708 tty->print(", loader "); | 733 tty->print(", loader "); |
709 loader_data->print_value(); | 734 if (loader_data != NULL) { |
735 loader_data->print_value(); | |
736 } else { | |
737 tty->print("NULL"); | |
738 } | |
739 } | |
710 tty->cr(); | 740 tty->cr(); |
711 } | 741 } |
712 } | 742 } |
743 | |
744 if (details) { | |
745 tty->cr(); | |
746 _pd_cache_table->print(); | |
747 } | |
713 tty->cr(); | 748 tty->cr(); |
714 _pd_cache_table->print(); | 749 } |
715 tty->cr(); | |
716 } | |
717 | |
718 #endif | |
719 | 750 |
720 void Dictionary::verify() { | 751 void Dictionary::verify() { |
721 guarantee(number_of_entries() >= 0, "Verify of system dictionary failed"); | 752 guarantee(number_of_entries() >= 0, "Verify of system dictionary failed"); |
722 | 753 |
723 int element_count = 0; | 754 int element_count = 0; |