--- old/src/hotspot/share/classfile/systemDictionary.hpp 2019-12-03 19:36:48.000000000 -0800 +++ new/src/hotspot/share/classfile/systemDictionary.hpp 2019-12-03 19:36:48.000000000 -0800 @@ -34,6 +34,53 @@ #include "runtime/signature.hpp" #include "utilities/hashtable.hpp" +class ClassInstanceInfo : public StackObj { + private: + InstanceKlass* _dynamic_nest_host; + Handle _class_data; + + public: + ClassInstanceInfo() { + _dynamic_nest_host = NULL; + _class_data = Handle(); + } + ClassInstanceInfo(InstanceKlass* dynamic_nest_host, Handle class_data) { + _dynamic_nest_host = dynamic_nest_host; + _class_data = class_data; + } + + InstanceKlass* dynamic_nest_host() const { return _dynamic_nest_host; } + Handle class_data() const { return _class_data; } + friend class ClassLoadInfo; +}; + +class ClassLoadInfo : public StackObj { + private: + Handle _protection_domain; + const InstanceKlass* _unsafe_anonymous_host; + GrowableArray* _cp_patches; + ClassInstanceInfo _class_hidden_info; + bool _is_hidden; + bool _is_weak_hidden; + bool _can_access_vm_annotations; + + public: + ClassLoadInfo(); + ClassLoadInfo(Handle protection_domain); + ClassLoadInfo(Handle protection_domain, const InstanceKlass* unsafe_anonymous_host, + GrowableArray* cp_patches, InstanceKlass* dynamic_nest_host, + Handle class_data, bool is_hidden, bool is_weak_hidden, + bool can_access_vm_annotations); + + Handle protection_domain() const { return _protection_domain; } + const InstanceKlass* unsafe_anonymous_host() const { return _unsafe_anonymous_host; } + GrowableArray* cp_patches() const { return _cp_patches; } + const ClassInstanceInfo* class_hidden_info_ptr() const { return &_class_hidden_info; } + bool is_hidden() const { return _is_hidden; } + bool is_weak_hidden() const { return _is_weak_hidden; } + bool can_access_vm_annotations() const { return _can_access_vm_annotations; } +}; + // The dictionary in each ClassLoaderData stores all loaded classes, either // initiatied by its class loader or defined by its class loader: // @@ -268,28 +315,10 @@ bool is_superclass, TRAPS); - // Parse new stream. This won't update the dictionary or - // class hierarchy, simply parse the stream. Used by JVMTI RedefineClasses. - // Also used by Unsafe_DefineAnonymousClass - static InstanceKlass* parse_stream(Symbol* class_name, - Handle class_loader, - Handle protection_domain, - ClassFileStream* st, - TRAPS) { - return parse_stream(class_name, - class_loader, - protection_domain, - st, - NULL, // unsafe_anonymous_host - NULL, // cp_patches - THREAD); - } static InstanceKlass* parse_stream(Symbol* class_name, Handle class_loader, - Handle protection_domain, ClassFileStream* st, - const InstanceKlass* unsafe_anonymous_host, - GrowableArray* cp_patches, + const ClassLoadInfo& cl_info, TRAPS); // Resolve from stream (called by jni_DefineClass and JVM_DefineClass)