< prev index next >

src/share/vm/classfile/systemDictionary.cpp

Print this page

@@ -45,10 +45,11 @@
 #include "gc/shared/gcTraceTime.inline.hpp"
 #include "interpreter/bytecodeStream.hpp"
 #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"
 #include "oops/instanceRefKlass.hpp"
 #include "oops/klass.inline.hpp"

@@ -2005,10 +2006,22 @@
 // Don't iterate over placeholders
 void SystemDictionary::classes_do(void f(Klass*, ClassLoaderData*)) {
   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);
   // Walk method handle intrinsics
   invoke_method_table()->methods_do(f);

@@ -2839,26 +2852,27 @@
   Handle mname(THREAD, (oop) result.get_jobject());
   (*method_type_result) = method_type;
   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);
 }
 
 int SystemDictionary::number_of_classes() {
   return dictionary()->number_of_entries();
< prev index next >