--- old/src/share/vm/classfile/systemDictionary.cpp 2017-06-29 15:57:19.423731818 -0700 +++ new/src/share/vm/classfile/systemDictionary.cpp 2017-06-29 15:57:19.239724744 -0700 @@ -47,6 +47,7 @@ #include "interpreter/interpreter.hpp" #include "logging/log.hpp" #include "memory/filemap.hpp" +#include "memory/metaspaceClosure.hpp" #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceKlass.hpp" @@ -2007,6 +2008,18 @@ dictionary()->classes_do(f); } +// CDS: scan and relocate all classes in the system dictionary. +void SystemDictionary::classes_do(MetaspaceClosure* it) { + dictionary()->classes_do(it); +} + +// CDS: scan and relocate all classes referenced by _well_known_klasses[]. +void SystemDictionary::well_known_klasses_do(MetaspaceClosure* it) { + for (int id = FIRST_WKID; id < WKID_LIMIT; id++) { + it->push(well_known_klass_addr((WKID)id)); + } +} + void SystemDictionary::methods_do(void f(Method*)) { // Walk methods in loaded classes ClassLoaderDataGraph::methods_do(f); @@ -2841,22 +2854,23 @@ return unpack_method_and_appendix(mname, caller, appendix_box, appendix_result, THREAD); } -// Since the identity hash code for symbols changes when the symbols are -// moved from the regular perm gen (hash in the mark word) to the shared -// spaces (hash is the address), the classes loaded into the dictionary -// may be in the wrong buckets. +void SystemDictionary::reorder_dictionary_for_sharing() { + dictionary()->reorder_dictionary_for_sharing(); +} -void SystemDictionary::reorder_dictionary() { - dictionary()->reorder_dictionary(); +size_t SystemDictionary::count_bytes_for_buckets() { + return dictionary()->count_bytes_for_buckets(); } +size_t SystemDictionary::count_bytes_for_table() { + return dictionary()->count_bytes_for_table(); +} -void SystemDictionary::copy_buckets(char** top, char* end) { +void SystemDictionary::copy_buckets(char* top, char* end) { dictionary()->copy_buckets(top, end); } - -void SystemDictionary::copy_table(char** top, char* end) { +void SystemDictionary::copy_table(char* top, char* end) { dictionary()->copy_table(top, end); }