hotspot/src/share/vm/classfile/moduleEntry.hpp
changeset 46404 ae62ba99a1a7
parent 46388 d7a164ad6b7f
child 46773 fb17cc9a6847
equal deleted inserted replaced
46403:f2b91b928476 46404:ae62ba99a1a7
    63   Symbol* _version;                    // module version number
    63   Symbol* _version;                    // module version number
    64   Symbol* _location;                   // module location
    64   Symbol* _location;                   // module location
    65   bool _can_read_all_unnamed;
    65   bool _can_read_all_unnamed;
    66   bool _has_default_read_edges;        // JVMTI redefine/retransform support
    66   bool _has_default_read_edges;        // JVMTI redefine/retransform support
    67   bool _must_walk_reads;               // walk module's reads list at GC safepoints to purge out dead modules
    67   bool _must_walk_reads;               // walk module's reads list at GC safepoints to purge out dead modules
       
    68   bool _is_open;                       // whether the packages in the module are all unqualifiedly exported
    68   bool _is_patched;                    // whether the module is patched via --patch-module
    69   bool _is_patched;                    // whether the module is patched via --patch-module
    69   TRACE_DEFINE_TRACE_ID_FIELD;
    70   TRACE_DEFINE_TRACE_ID_FIELD;
    70   enum {MODULE_READS_SIZE = 101};      // Initial size of list of modules that the module can read.
    71   enum {MODULE_READS_SIZE = 101};      // Initial size of list of modules that the module can read.
    71 
    72 
    72 public:
    73 public:
    79     _location = NULL;
    80     _location = NULL;
    80     _can_read_all_unnamed = false;
    81     _can_read_all_unnamed = false;
    81     _has_default_read_edges = false;
    82     _has_default_read_edges = false;
    82     _must_walk_reads = false;
    83     _must_walk_reads = false;
    83     _is_patched = false;
    84     _is_patched = false;
       
    85     _is_open = false;
    84   }
    86   }
    85 
    87 
    86   Symbol*          name() const                        { return literal(); }
    88   Symbol*          name() const                        { return literal(); }
    87   void             set_name(Symbol* n)                 { set_literal(n); }
    89   void             set_name(Symbol* n)                 { set_literal(n); }
    88 
    90 
   110   bool             can_read(ModuleEntry* m) const;
   112   bool             can_read(ModuleEntry* m) const;
   111   bool             has_reads_list() const;
   113   bool             has_reads_list() const;
   112   void             add_read(ModuleEntry* m);
   114   void             add_read(ModuleEntry* m);
   113   void             set_read_walk_required(ClassLoaderData* m_loader_data);
   115   void             set_read_walk_required(ClassLoaderData* m_loader_data);
   114 
   116 
       
   117   bool             is_open() const                     { return _is_open; }
       
   118   void             set_is_open(bool is_open);
       
   119 
   115   bool             is_named() const                    { return (name() != NULL); }
   120   bool             is_named() const                    { return (name() != NULL); }
   116 
   121 
   117   bool can_read_all_unnamed() const {
   122   bool can_read_all_unnamed() const {
   118     assert(is_named() || _can_read_all_unnamed == true,
   123     assert(is_named() || _can_read_all_unnamed == true,
   119            "unnamed modules can always read all unnamed modules");
   124            "unnamed modules can always read all unnamed modules");
   196   };
   201   };
   197 
   202 
   198 private:
   203 private:
   199   static ModuleEntry* _javabase_module;
   204   static ModuleEntry* _javabase_module;
   200 
   205 
   201   ModuleEntry* new_entry(unsigned int hash, Handle module_handle, Symbol* name, Symbol* version,
   206   ModuleEntry* new_entry(unsigned int hash, Handle module_handle, bool is_open,
   202                          Symbol* location, ClassLoaderData* loader_data);
   207                          Symbol* name, Symbol* version, Symbol* location, ClassLoaderData* loader_data);
   203   void add_entry(int index, ModuleEntry* new_entry);
   208   void add_entry(int index, ModuleEntry* new_entry);
   204 
   209 
   205   int entry_size() const { return BasicHashtable<mtModule>::entry_size(); }
   210   int entry_size() const { return BasicHashtable<mtModule>::entry_size(); }
   206 
   211 
   207   ModuleEntry** bucket_addr(int i) {
   212   ModuleEntry** bucket_addr(int i) {
   220   }
   225   }
   221 
   226 
   222   // Create module in loader's module entry table, if already exists then
   227   // Create module in loader's module entry table, if already exists then
   223   // return null.  Assume Module_lock has been locked by caller.
   228   // return null.  Assume Module_lock has been locked by caller.
   224   ModuleEntry* locked_create_entry_or_null(Handle module_handle,
   229   ModuleEntry* locked_create_entry_or_null(Handle module_handle,
       
   230                                            bool is_open,
   225                                            Symbol* module_name,
   231                                            Symbol* module_name,
   226                                            Symbol* module_version,
   232                                            Symbol* module_version,
   227                                            Symbol* module_location,
   233                                            Symbol* module_location,
   228                                            ClassLoaderData* loader_data);
   234                                            ClassLoaderData* loader_data);
   229 
   235