--- old/src/share/vm/classfile/dictionary.cpp 2017-03-08 11:09:22.352935471 -0500 +++ new/src/share/vm/classfile/dictionary.cpp 2017-03-08 11:09:21.921095938 -0500 @@ -331,20 +331,6 @@ _pd_cache_table->oops_do(f); } -void Dictionary::methods_do(void f(Method*)) { - for (int index = 0; index < table_size(); index++) { - for (DictionaryEntry* probe = bucket(index); - probe != NULL; - probe = probe->next()) { - Klass* k = probe->klass(); - if (probe->loader_data() == k->class_loader_data()) { - // only take klass is we have the entry with the defining class loader - InstanceKlass::cast(k)->methods_do(f); - } - } - } -} - void Dictionary::unlink(BoolObjectClosure* is_alive) { // Only the protection domain cache table may contain references to the heap // that need to be unlinked. --- old/src/share/vm/classfile/dictionary.hpp 2017-03-08 11:09:31.922949900 -0500 +++ new/src/share/vm/classfile/dictionary.hpp 2017-03-08 11:09:31.644386764 -0500 @@ -100,8 +100,6 @@ void classes_do(void f(Klass*, TRAPS), TRAPS); void classes_do(void f(Klass*, ClassLoaderData*)); - void methods_do(void f(Method*)); - void unlink(BoolObjectClosure* is_alive); void remove_classes_in_error_state(); --- old/src/share/vm/classfile/loaderConstraints.cpp 2017-03-08 11:09:40.784277299 -0500 +++ new/src/share/vm/classfile/loaderConstraints.cpp 2017-03-08 11:09:40.504581945 -0500 @@ -57,19 +57,6 @@ Hashtable::free_entry(entry); } -// Enhanced Class Redefinition support -void LoaderConstraintTable::classes_do(KlassClosure* f) { - for (int index = 0; index < table_size(); index++) { - for (LoaderConstraintEntry* probe = bucket(index); - probe != NULL; - probe = probe->next()) { - if (probe->klass() != NULL) { - f->do_klass(probe->klass()); - } - } - } - } - // The loaderConstraintTable must always be accessed with the // SystemDictionary lock held. This is true even for readers as // entries in the table could be being dynamically resized. --- old/src/share/vm/classfile/loaderConstraints.hpp 2017-03-08 11:09:49.515274913 -0500 +++ new/src/share/vm/classfile/loaderConstraints.hpp 2017-03-08 11:09:49.171183008 -0500 @@ -61,9 +61,6 @@ return (LoaderConstraintEntry**)Hashtable::bucket_addr(i); } - // Enhanced Class Redefinition support - void classes_do(KlassClosure* f); - // Check class loader constraints bool add_entry(Symbol* name, Klass* klass1, Handle loader1, Klass* klass2, Handle loader2); --- old/src/share/vm/classfile/placeholders.cpp 2017-03-08 11:09:59.091014427 -0500 +++ new/src/share/vm/classfile/placeholders.cpp 2017-03-08 11:09:58.765821489 -0500 @@ -194,17 +194,6 @@ } } -// do all entries in the placeholder table -void PlaceholderTable::entries_do(void f(Symbol*)) { - for (int index = 0; index < table_size(); index++) { - for (PlaceholderEntry* probe = bucket(index); - probe != NULL; - probe = probe->next()) { - f(probe->klassname()); - } - } -} - #ifndef PRODUCT // Note, doesn't append a cr --- old/src/share/vm/classfile/placeholders.hpp 2017-03-08 11:10:07.726555904 -0500 +++ new/src/share/vm/classfile/placeholders.hpp 2017-03-08 11:10:07.419633654 -0500 @@ -101,9 +101,6 @@ // GC support. void classes_do(KlassClosure* f); - // JVMTI support - void entries_do(void f(Symbol*)); - #ifndef PRODUCT void print(); #endif --- old/src/share/vm/classfile/systemDictionary.cpp 2017-03-08 11:10:16.466509075 -0500 +++ new/src/share/vm/classfile/systemDictionary.cpp 2017-03-08 11:10:16.111213968 -0500 @@ -1979,31 +1979,6 @@ invoke_method_table()->oops_do(f); } -// Extended Class redefinition support. -// If one of these classes is replaced, we need to replace it in these places. -// KlassClosure::do_klass should take the address of a class but we can -// change that later. -void SystemDictionary::preloaded_classes_do(KlassClosure* f) { - for (int k = (int)FIRST_WKID; k < (int)WKID_LIMIT; k++) { - f->do_klass(_well_known_klasses[k]); - } - - { - for (int i = 0; i < T_VOID+1; i++) { - if (_box_klasses[i] != NULL) { - assert(i >= T_BOOLEAN, "checking"); - f->do_klass(_box_klasses[i]); - } - } - } - - FilteredFieldsMap::classes_do(f); -} - -void SystemDictionary::lazily_loaded_classes_do(KlassClosure* f) { - f->do_klass(_abstract_ownable_synchronizer_klass); -} - // Just the classes from defining class loaders // Don't iterate over placeholders void SystemDictionary::classes_do(void f(Klass*)) { @@ -2023,12 +1998,8 @@ dictionary()->classes_do(f); } -void SystemDictionary::placeholders_do(void f(Symbol*)) { - placeholders()->entries_do(f); -} - void SystemDictionary::methods_do(void f(Method*)) { - dictionary()->methods_do(f); + ClassLoaderDataGraph::methods_do(f); invoke_method_table()->methods_do(f); } --- old/src/share/vm/classfile/systemDictionary.hpp 2017-03-08 11:10:25.486031624 -0500 +++ new/src/share/vm/classfile/systemDictionary.hpp 2017-03-08 11:10:25.191907176 -0500 @@ -347,16 +347,14 @@ TRAPS); // Iterate over all klasses in dictionary - // Just the classes from defining class loaders + // Just the classes from defining class loaders static void classes_do(void f(Klass*)); // Added for initialize_itable_for_klass to handle exceptions static void classes_do(void f(Klass*, TRAPS), TRAPS); - // All classes, and their class loaders + // All classes, and their class loaders, including initiating class loaders static void classes_do(void f(Klass*, ClassLoaderData*)); - static void placeholders_do(void f(Symbol*)); - - // Iterate over all methods in all klasses in dictionary + // Iterate over all methods in all klasses static void methods_do(void f(Method*)); // Garbage collection support @@ -383,10 +381,6 @@ // System loader lock static oop system_loader_lock() { return _system_loader_lock_obj; } -protected: - // Extended Redefine classes support (tbi) - static void preloaded_classes_do(KlassClosure* f); - static void lazily_loaded_classes_do(KlassClosure* f); public: // Sharing support. static void reorder_dictionary(); --- old/src/share/vm/memory/universe.hpp 2017-03-08 11:10:34.709080908 -0500 +++ new/src/share/vm/memory/universe.hpp 2017-03-08 11:10:34.271523140 -0500 @@ -62,11 +62,6 @@ Method* get_method(); - // Enhanced Class Redefinition support - void classes_do(void f(Klass*)) { - f(_klass); - } - // CDS support. Replace the klass in this with the archive version // could use this for Enhanced Class Redefinition also. void serialize(SerializeClosure* f) { --- old/src/share/vm/oops/klassVtable.cpp 2017-03-08 11:10:43.663561244 -0500 +++ new/src/share/vm/oops/klassVtable.cpp 2017-03-08 11:10:43.271373157 -0500 @@ -1563,7 +1563,6 @@ no_klasses++; if (kl->is_instance_klass()) { no_instance_klasses++; - kl->array_klasses_do(do_class); } if (kl->is_array_klass()) { no_array_klasses++; @@ -1573,7 +1572,7 @@ } static void compute() { - SystemDictionary::classes_do(do_class); + ClassLoaderDataGraph::classes_do(do_class); fixed = no_klasses * oopSize; // vtable length // filler size is a conservative approximation filler = oopSize * (no_klasses - no_instance_klasses) * (sizeof(InstanceKlass) - sizeof(ArrayKlass) - 1); --- old/src/share/vm/prims/jvmtiGetLoadedClasses.cpp 2017-03-08 11:10:53.236504017 -0500 +++ new/src/share/vm/prims/jvmtiGetLoadedClasses.cpp 2017-03-08 11:10:52.838559851 -0500 @@ -213,14 +213,6 @@ } } - static void prim_array_increment_with_loader(Klass* array, ClassLoaderData* loader_data) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - oop class_loader = loader_data->class_loader(); - if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) { - that->set_count(that->get_count() + 1); - } - } - static void add_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); if (that->available()) { --- old/src/share/vm/prims/privilegedStack.cpp 2017-03-08 11:11:01.947757604 -0500 +++ new/src/share/vm/prims/privilegedStack.cpp 2017-03-08 11:11:01.676588639 -0500 @@ -51,14 +51,6 @@ } while(cur != NULL); } -void PrivilegedElement::classes_do(KlassClosure* f) { - PrivilegedElement *cur = this; - do { - f->do_klass(cur->_klass); - cur = cur->_next; - } while(cur != NULL); -} - //------------------------------------------------------------------------------- #ifndef PRODUCT --- old/src/share/vm/prims/privilegedStack.hpp 2017-03-08 11:11:10.642775036 -0500 +++ new/src/share/vm/prims/privilegedStack.hpp 2017-03-08 11:11:10.367301113 -0500 @@ -39,7 +39,6 @@ public: void initialize(vframeStream* vf, oop context, PrivilegedElement* next, TRAPS); void oops_do(OopClosure* f); - void classes_do(KlassClosure* f); intptr_t* frame_id() const { return _frame_id; } oop privileged_context() const { return _privileged_context; } oop class_loader() const { return InstanceKlass::cast(_klass)->class_loader(); } --- old/src/share/vm/runtime/biasedLocking.cpp 2017-03-08 11:11:19.459715261 -0500 +++ new/src/share/vm/runtime/biasedLocking.cpp 2017-03-08 11:11:19.084302875 -0500 @@ -42,9 +42,13 @@ static GrowableArray* _preserved_oop_stack = NULL; static GrowableArray* _preserved_mark_stack = NULL; -static void enable_biased_locking(Klass* k) { - k->set_prototype_header(markOopDesc::biased_locking_prototype()); -} +class EnableBiasedLocking : public KlassClosure { + void do_klass(Klass* k) { + if (k->is_instance_klass()) { + k->set_prototype_header(markOopDesc::biased_locking_prototype()); + } + } +}; class VM_EnableBiasedLocking: public VM_Operation { private: @@ -58,7 +62,8 @@ void doit() { // Iterate the system dictionary enabling biased locking for all // currently loaded classes - SystemDictionary::classes_do(enable_biased_locking); + EnableBiasedLocking enable_biased_locking; + ClassLoaderDataGraph::loaded_classes_do(&enable_biased_locking); // Indicate that future instances should enable it as well _biased_locking_enabled = true; --- old/src/share/vm/runtime/java.cpp 2017-03-08 11:11:28.124988109 -0500 +++ new/src/share/vm/runtime/java.cpp 2017-03-08 11:11:27.830209193 -0500 @@ -112,7 +112,7 @@ ResourceMark rm; HandleMark hm; collected_profiled_methods = new GrowableArray(1024); - ClassLoaderDataGraph::methods_do(collect_profiled_methods); + SystemDictionary::methods_do(collect_profiled_methods); collected_profiled_methods->sort(&compare_methods); int count = collected_profiled_methods->length(); @@ -163,7 +163,7 @@ collected_invoked_methods->sort(&compare_methods); // tty->cr(); - tty->print_cr("Histogram Over MethodOop Invocation Counters (cutoff = " INTX_FORMAT "):", MethodHistogramCutoff); + tty->print_cr("Histogram Over Method Invocation Counters (cutoff = " INTX_FORMAT "):", MethodHistogramCutoff); tty->cr(); tty->print_cr("____Count_(I+C)____Method________________________Module_________________"); unsigned total = 0, int_total = 0, comp_total = 0, static_total = 0, final_total = 0, --- old/src/share/vm/runtime/reflectionUtils.hpp 2017-03-08 11:11:37.000744603 -0500 +++ new/src/share/vm/runtime/reflectionUtils.hpp 2017-03-08 11:11:36.717667206 -0500 @@ -196,12 +196,6 @@ } return nflds; } - // Enhance Class Redefinition Support - static void classes_do(KlassClosure* f) { - for (int i = 0; i < _filtered_fields->length(); i++) { - f->do_klass(_filtered_fields->at(i)->klass()); - } - } }; --- old/src/share/vm/services/classLoadingService.cpp 2017-03-08 11:11:45.800711356 -0500 +++ new/src/share/vm/services/classLoadingService.cpp 2017-03-08 11:11:45.423514849 -0500 @@ -216,7 +216,7 @@ _loaded_classes = _klass_handle_array; _current_thread = cur_thread; - SystemDictionary::classes_do(&add_loaded_class); + ClassLoaderDataGraph::classes_do(&add_loaded_class); // FIXME: Exclude array klasses for now // Universe::basic_type_classes_do(&add_loaded_class); --- old/src/share/vm/services/classLoadingService.hpp 2017-03-08 11:11:55.170789316 -0500 +++ new/src/share/vm/services/classLoadingService.hpp 2017-03-08 11:11:54.871176023 -0500 @@ -141,8 +141,10 @@ // KlassHandle h(_current_thread, l); // _loaded_classes->append(h); // } - KlassHandle h(_current_thread, k); - _loaded_classes->append(h); + if (k->is_instance_klass()) { + KlassHandle h(_current_thread, k); + _loaded_classes->append(h); + } } }; --- old/src/share/vm/services/heapDumper.cpp 2017-03-08 11:12:03.775890817 -0500 +++ new/src/share/vm/services/heapDumper.cpp 2017-03-08 11:12:03.491245507 -0500 @@ -1825,7 +1825,8 @@ // HPROF_GC_ROOT_STICKY_CLASS StickyClassDumper class_dumper(writer()); - SystemDictionary::always_strong_classes_do(&class_dumper); + ClassLoaderData::the_null_class_loader_data()->classes_do(&class_dumper); + //SystemDictionary::always_strong_classes_do(&class_dumper); // fixes up the length of the dump record and writes the HPROF_HEAP_DUMP_END record. DumperSupport::end_of_dump(writer());