< prev index next >

src/hotspot/share/cds/cdsConfig.hpp

Print this page

 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_CDS_CDSCONFIG_HPP
 26 #define SHARE_CDS_CDSCONFIG_HPP
 27 
 28 #include "memory/allStatic.hpp"
 29 #include "utilities/globalDefinitions.hpp"
 30 #include "utilities/macros.hpp"
 31 


 32 class CDSConfig : public AllStatic {
 33 #if INCLUDE_CDS
 34   static bool _is_dumping_static_archive;
 35   static bool _is_dumping_dynamic_archive;
 36   static bool _dumping_full_module_graph_disabled;
 37   static bool _loading_full_module_graph_disabled;

 38 
 39   static char*  _default_archive_path;
 40   static char*  _static_archive_path;
 41   static char*  _dynamic_archive_path;

 42 #endif
 43 
 44   static void extract_shared_archive_paths(const char* archive_path,
 45                                            char** base_archive_path,
 46                                            char** top_archive_path);
 47   static void init_shared_archive_paths();
 48   static bool check_unsupported_cds_runtime_properties();
 49 
 50 public:
 51   // Initialization and command-line checking
 52   static void initialize() NOT_CDS_RETURN;
 53   static void check_system_property(const char* key, const char* value) NOT_CDS_RETURN;
 54   static void check_unsupported_dumping_properties() NOT_CDS_RETURN;
 55   static bool check_vm_args_consistency(bool patch_mod_javabase,  bool mode_flag_cmd_line) NOT_CDS_RETURN_(true);
 56 
 57   // Basic CDS features
 58   static bool      is_dumping_archive()                      { return is_dumping_static_archive() || is_dumping_dynamic_archive(); }
 59   static bool      is_dumping_static_archive()               { return CDS_ONLY(_is_dumping_static_archive) NOT_CDS(false); }

 60   static void  enable_dumping_static_archive()               { CDS_ONLY(_is_dumping_static_archive = true); }



 61   static bool      is_dumping_dynamic_archive()              { return CDS_ONLY(_is_dumping_dynamic_archive) NOT_CDS(false); }
 62   static void  enable_dumping_dynamic_archive()              { CDS_ONLY(_is_dumping_dynamic_archive = true); }
 63   static void disable_dumping_dynamic_archive()              { CDS_ONLY(_is_dumping_dynamic_archive = false); }







 64 
 65   // Archive paths
 66   // Points to the classes.jsa in $JAVA_HOME
 67   static char* default_archive_path()                         NOT_CDS_RETURN_(nullptr);
 68   // The actual static archive  (if any) selected at runtime
 69   static const char* static_archive_path()                   { return CDS_ONLY(_static_archive_path) NOT_CDS(nullptr); }
 70   // The actual dynamic archive  (if any) selected at runtime
 71   static const char* dynamic_archive_path()                  { return CDS_ONLY(_dynamic_archive_path) NOT_CDS(nullptr); }
 72 
 73   static int num_archives(const char* archive_path)          NOT_CDS_RETURN_(0);
 74 
 75 
 76   // CDS archived heap
 77   static bool      is_dumping_heap()                         NOT_CDS_JAVA_HEAP_RETURN_(false);

 78   static void disable_dumping_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
 79   static bool      is_dumping_full_module_graph()            NOT_CDS_JAVA_HEAP_RETURN_(false);
 80   static void disable_loading_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
 81   static bool      is_loading_full_module_graph()            NOT_CDS_JAVA_HEAP_RETURN_(false);





 82 




 83 };
 84 
 85 #endif // SHARE_CDS_CDSCONFIG_HPP

 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_CDS_CDSCONFIG_HPP
 26 #define SHARE_CDS_CDSCONFIG_HPP
 27 
 28 #include "memory/allStatic.hpp"
 29 #include "utilities/globalDefinitions.hpp"
 30 #include "utilities/macros.hpp"
 31 
 32 class InstanceKlass;
 33 
 34 class CDSConfig : public AllStatic {
 35 #if INCLUDE_CDS
 36   static bool _is_dumping_static_archive;
 37   static bool _is_dumping_dynamic_archive;
 38   static bool _dumping_full_module_graph_disabled;
 39   static bool _loading_full_module_graph_disabled;
 40   static bool _has_preloaded_classes;
 41 
 42   static char*  _default_archive_path;
 43   static char*  _static_archive_path;
 44   static char*  _dynamic_archive_path;
 45   static bool _is_loading_invokedynamic;
 46 #endif
 47 
 48   static void extract_shared_archive_paths(const char* archive_path,
 49                                            char** base_archive_path,
 50                                            char** top_archive_path);
 51   static void init_shared_archive_paths();
 52   static bool check_unsupported_cds_runtime_properties();
 53 
 54 public:
 55   // Initialization and command-line checking
 56   static void initialize() NOT_CDS_RETURN;
 57   static void check_system_property(const char* key, const char* value) NOT_CDS_RETURN;
 58   static void check_unsupported_dumping_properties() NOT_CDS_RETURN;
 59   static bool check_vm_args_consistency(bool patch_mod_javabase,  bool mode_flag_cmd_line) NOT_CDS_RETURN_(true);
 60 
 61   // Basic CDS features
 62   static bool      is_dumping_archive()                      { return is_dumping_static_archive() || is_dumping_dynamic_archive(); }
 63   static bool      is_dumping_static_archive()               { return (CDS_ONLY(_is_dumping_static_archive) NOT_CDS(false))
 64                                                                     || is_dumping_final_static_archive(); }
 65   static void  enable_dumping_static_archive()               { CDS_ONLY(_is_dumping_static_archive = true); }
 66   static bool      is_dumping_classic_static_archive()       NOT_CDS_RETURN_(false); // -Xshare:dump
 67   static bool      is_dumping_preimage_static_archive()      NOT_CDS_RETURN_(false); // 1st phase of -XX:CacheDataStore dumping
 68   static bool      is_dumping_final_static_archive()         NOT_CDS_RETURN_(false); // 2nd phase of -XX:CacheDataStore dumping
 69   static bool      is_dumping_dynamic_archive()              { return CDS_ONLY(_is_dumping_dynamic_archive) NOT_CDS(false); }
 70   static void  enable_dumping_dynamic_archive()              { CDS_ONLY(_is_dumping_dynamic_archive = true); }
 71   static void disable_dumping_dynamic_archive()              { CDS_ONLY(_is_dumping_dynamic_archive = false); }
 72   static bool      has_preloaded_classes()                   { CDS_ONLY(return _has_preloaded_classes); NOT_CDS(return false); }
 73   static void      set_has_preloaded_classes()               { CDS_ONLY(_has_preloaded_classes = true); }
 74   static bool      is_dumping_regenerated_lambdaform_invokers() NOT_CDS_RETURN_(false);
 75   static bool      is_tracing_dynamic_proxy()                NOT_CDS_RETURN_(false);
 76 
 77   // Misc CDS features
 78   static bool      preserve_all_dumptime_verification_states(const InstanceKlass* ik);
 79 
 80   // Archive paths
 81   // Points to the classes.jsa in $JAVA_HOME
 82   static char* default_archive_path()                         NOT_CDS_RETURN_(nullptr);
 83   // The actual static archive  (if any) selected at runtime
 84   static const char* static_archive_path()                   { return CDS_ONLY(_static_archive_path) NOT_CDS(nullptr); }
 85   // The actual dynamic archive  (if any) selected at runtime
 86   static const char* dynamic_archive_path()                  { return CDS_ONLY(_dynamic_archive_path) NOT_CDS(nullptr); }
 87 
 88   static int num_archives(const char* archive_path)          NOT_CDS_RETURN_(0);
 89 
 90 
 91   // CDS archived heap
 92   static bool      is_dumping_heap()                         NOT_CDS_JAVA_HEAP_RETURN_(false);
 93   static bool      is_loading_heap()                         NOT_CDS_JAVA_HEAP_RETURN_(false);
 94   static void disable_dumping_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
 95   static bool      is_dumping_full_module_graph()            NOT_CDS_JAVA_HEAP_RETURN_(false);
 96   static void disable_loading_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
 97   static bool      is_loading_full_module_graph()            NOT_CDS_JAVA_HEAP_RETURN_(false);
 98   static bool      is_dumping_invokedynamic()                NOT_CDS_JAVA_HEAP_RETURN_(false);
 99   static bool      is_loading_invokedynamic()                NOT_CDS_JAVA_HEAP_RETURN_(false);
100   static void  set_is_loading_invokedynamic()                { CDS_JAVA_HEAP_ONLY(_is_loading_invokedynamic = true); }
101   static bool      is_dumping_dynamic_proxy()                NOT_CDS_JAVA_HEAP_RETURN_(false);
102   static bool      is_initing_classes_at_dump_time()         NOT_CDS_JAVA_HEAP_RETURN_(false);
103 
104   // AOT compiler
105   static bool      is_dumping_cached_code()                  NOT_CDS_RETURN_(false);
106   static void disable_dumping_cached_code()                  NOT_CDS_RETURN;
107   static void  enable_dumping_cached_code()                  NOT_CDS_RETURN;
108 };
109 
110 #endif // SHARE_CDS_CDSCONFIG_HPP
< prev index next >