--- old/src/hotspot/share/classfile/systemDictionary.hpp 2018-10-21 22:34:15.812822941 -0700 +++ new/src/hotspot/share/classfile/systemDictionary.hpp 2018-10-21 22:34:15.536812410 -0700 @@ -85,18 +85,19 @@ class GCTimer; class OopStorage; -// Certain classes are preloaded, such as java.lang.Object and java.lang.String. -// They are all "well-known", in the sense that no class loader is allowed +// Certain classes, such as java.lang.Object and java.lang.String, +// are all "well-known", in the sense that no class loader is allowed // to provide a different definition. // -// These klasses must all have names defined in vmSymbols. +// These klasses must all have names defined in vmSymbols. They are +// resolved during early VM start-up in a specific order. #define WK_KLASS_ENUM_NAME(kname) kname##_knum // Each well-known class has a short klass name (like object_klass), // and a vmSymbol name (like java_lang_Object). // The order of these definitions is significant; it is the order in which -// preloading is actually performed by resolve_preloaded_classes. +// class resolution is actually performed by resolve_well_known_classes. #define WK_KLASSES_DO(do_klass) \ /* well-known classes */ \ @@ -127,7 +128,7 @@ do_klass(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException ) \ do_klass(Reference_klass, java_lang_ref_Reference ) \ \ - /* Preload ref klasses and set reference types */ \ + /* ref klasses and set reference types */ \ do_klass(SoftReference_klass, java_lang_ref_SoftReference ) \ do_klass(WeakReference_klass, java_lang_ref_WeakReference ) \ do_klass(FinalReference_klass, java_lang_ref_FinalReference ) \ @@ -200,7 +201,7 @@ /* support for stack dump lock analysis */ \ do_klass(java_util_concurrent_locks_AbstractOwnableSynchronizer_klass, java_util_concurrent_locks_AbstractOwnableSynchronizer) \ \ - /* Preload boxing klasses */ \ + /* boxing klasses */ \ do_klass(Boolean_klass, java_lang_Boolean ) \ do_klass(Character_klass, java_lang_Character ) \ do_klass(Float_klass, java_lang_Float ) \ @@ -391,7 +392,8 @@ // Initialization static void initialize(TRAPS); - // Checked fast access to commonly used classes - mostly preloaded + // Checked fast access to the well-known classes -- so that you don't try to use them + // before they are resolved. static InstanceKlass* check_klass(InstanceKlass* k) { assert(k != NULL, "klass not loaded"); return k; @@ -435,6 +437,12 @@ return check_klass(_box_klasses[t]); } static BasicType box_klass_type(Klass* k); // inverse of box_klass +#ifdef ASSERT + static bool is_well_known_klass(Klass* k) { + return is_well_known_klass(k->name()); + } + static bool is_well_known_klass(Symbol* class_name); +#endif protected: // Returns the class loader data to be used when looking up/updating the @@ -695,8 +703,8 @@ ClassLoaderData* loader_data, TRAPS); - // Resolve preloaded classes so they can be used like SystemDictionary::String_klass() - static void resolve_preloaded_classes(TRAPS); + // Resolve well_known classes so they can be used like SystemDictionary::String_klass() + static void resolve_well_known_classes(TRAPS); // Class loader constraints static void check_constraints(unsigned int hash, @@ -707,7 +715,6 @@ InstanceKlass* k, Handle loader, TRAPS); - // Variables holding commonly used klasses (preloaded) static InstanceKlass* _well_known_klasses[]; // table of box klasses (int_klass, etc.)