< prev index next >

src/hotspot/share/classfile/packageEntry.hpp

Print this page

        

*** 25,34 **** --- 25,35 ---- #ifndef SHARE_CLASSFILE_PACKAGEENTRY_HPP #define SHARE_CLASSFILE_PACKAGEENTRY_HPP #include "classfile/moduleEntry.hpp" #include "oops/symbol.hpp" + #include "runtime/atomic.hpp" #include "utilities/growableArray.hpp" #include "utilities/hashtable.hpp" #include "utilities/macros.hpp" #include "utilities/ostream.hpp" #if INCLUDE_JFR
*** 92,101 **** --- 93,104 ---- // is also qualifiedly exported to one or more named modules. #define PKG_EXP_UNQUALIFIED 0x0001 #define PKG_EXP_ALLUNNAMED 0x0002 #define PKG_EXP_UNQUALIFIED_OR_ALL_UNAMED (PKG_EXP_UNQUALIFIED | PKG_EXP_ALLUNNAMED) + #define MAX_BITMAP_BITS 32 + class PackageEntry : public HashtableEntry<Symbol*, mtModule> { private: ModuleEntry* _module; // Indicates if package is exported unqualifiedly or to all unnamed. Access to // this field is protected by the Module_lock.
*** 112,128 **** --- 115,134 ---- JFR_ONLY(DEFINE_TRACE_ID_FIELD;) // Initial size of a package entry's list of qualified exports. enum {QUAL_EXP_SIZE = 43}; + volatile intptr_t _defined_in_class_path; // a Package java object has been define via CDS + public: void init() { _module = NULL; _export_flags = 0; _classpath_index = -1; _must_walk_exports = false; _qualified_exports = NULL; + _defined_in_class_path = 0; } // package name Symbol* name() const { return literal(); }
*** 210,219 **** --- 216,237 ---- void purge_qualified_exports(); void delete_qualified_exports(); void print(outputStream* st = tty); void verify(); + + bool is_defined_by_cds_in_class_path(intptr_t idx) const { + return((Atomic::load(&_defined_in_class_path) & ((intptr_t)1 << idx)) != 0); + } + void set_defined_in_class_path(intptr_t idx) { + intptr_t old_val = 0; + intptr_t new_val = 0; + do { + old_val = Atomic::load(&_defined_in_class_path); + new_val = old_val | ((intptr_t)1 << idx); + } while (Atomic::cmpxchg(&_defined_in_class_path, old_val, new_val) != old_val); + } }; // The PackageEntryTable is a Hashtable containing a list of all packages defined // by a particular class loader. Each package is represented as a PackageEntry node. // The PackageEntryTable's lookup is lock free.
< prev index next >