hotspot/src/share/vm/classfile/packageEntry.hpp
changeset 46404 ae62ba99a1a7
parent 46387 c46632622b17
equal deleted inserted replaced
46403:f2b91b928476 46404:ae62ba99a1a7
   126   void               set_module(ModuleEntry* m) { _module = m; }
   126   void               set_module(ModuleEntry* m) { _module = m; }
   127 
   127 
   128   // package's export state
   128   // package's export state
   129   bool is_exported() const { // qualifiedly or unqualifiedly exported
   129   bool is_exported() const { // qualifiedly or unqualifiedly exported
   130     assert_locked_or_safepoint(Module_lock);
   130     assert_locked_or_safepoint(Module_lock);
   131     return ((_export_flags & PKG_EXP_UNQUALIFIED_OR_ALL_UNAMED) != 0) || has_qual_exports_list();
   131     return module()->is_open() ||
       
   132             ((_export_flags & PKG_EXP_UNQUALIFIED_OR_ALL_UNAMED) != 0) ||
       
   133             has_qual_exports_list();
   132   }
   134   }
   133   // Returns true if the package has any explicit qualified exports or is exported to all unnamed
   135   // Returns true if the package has any explicit qualified exports or is exported to all unnamed
   134   bool is_qual_exported() const {
   136   bool is_qual_exported() const {
   135     assert_locked_or_safepoint(Module_lock);
   137     assert_locked_or_safepoint(Module_lock);
   136     return (has_qual_exports_list() || is_exported_allUnnamed());
   138     return (has_qual_exports_list() || is_exported_allUnnamed());
   143     assert_locked_or_safepoint(Module_lock);
   145     assert_locked_or_safepoint(Module_lock);
   144     return (!is_unqual_exported() && _qualified_exports != NULL);
   146     return (!is_unqual_exported() && _qualified_exports != NULL);
   145   }
   147   }
   146   bool is_exported_allUnnamed() const {
   148   bool is_exported_allUnnamed() const {
   147     assert_locked_or_safepoint(Module_lock);
   149     assert_locked_or_safepoint(Module_lock);
   148     return (_export_flags == PKG_EXP_ALLUNNAMED);
   150     return (module()->is_open() || _export_flags == PKG_EXP_ALLUNNAMED);
   149   }
   151   }
   150   bool is_unqual_exported() const {
   152   bool is_unqual_exported() const {
   151     assert_locked_or_safepoint(Module_lock);
   153     assert_locked_or_safepoint(Module_lock);
   152     return (_export_flags == PKG_EXP_UNQUALIFIED);
   154     return (module()->is_open() || _export_flags == PKG_EXP_UNQUALIFIED);
   153   }
   155   }
   154 
   156 
   155   // Explicitly set _export_flags to PKG_EXP_UNQUALIFIED and clear
   157   // Explicitly set _export_flags to PKG_EXP_UNQUALIFIED and clear
   156   // PKG_EXP_ALLUNNAMED, if it was set.
   158   // PKG_EXP_ALLUNNAMED, if it was set.
   157   void set_unqual_exported() {
   159   void set_unqual_exported() {
       
   160     if (module()->is_open()) {
       
   161         // No-op for open modules since all packages are unqualifiedly exported
       
   162         return;
       
   163     }
   158     assert(Module_lock->owned_by_self(), "should have the Module_lock");
   164     assert(Module_lock->owned_by_self(), "should have the Module_lock");
   159     _export_flags = PKG_EXP_UNQUALIFIED;
   165     _export_flags = PKG_EXP_UNQUALIFIED;
   160   }
   166   }
   161 
   167 
   162   bool exported_pending_delete() const;
   168   bool exported_pending_delete() const;