< prev index next >

src/hotspot/share/cds/cdsConfig.cpp

Print this page

  1 /*
  2  * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 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 #include "precompiled.hpp"
 26 #include "cds/archiveHeapLoader.hpp"
 27 #include "cds/cdsConfig.hpp"
 28 #include "cds/heapShared.hpp"
 29 #include "classfile/classLoaderDataShared.hpp"
 30 #include "logging/log.hpp"


 31 
 32 bool CDSConfig::_is_dumping_static_archive = false;
 33 bool CDSConfig::_is_dumping_dynamic_archive = false;
 34 
 35 // The ability to dump the FMG depends on many factors checked by
 36 // is_dumping_full_module_graph(), but can be unconditionally disabled by
 37 // _dumping_full_module_graph_disabled. (Ditto for loading the FMG).
 38 bool CDSConfig::_dumping_full_module_graph_disabled = false;
 39 bool CDSConfig::_loading_full_module_graph_disabled = false;
 40 





 41 #if INCLUDE_CDS_JAVA_HEAP
 42 bool CDSConfig::is_dumping_heap() {




 43   // heap dump is not supported in dynamic dump
 44   return is_dumping_static_archive() && HeapShared::can_write();
 45 }
 46 
 47 bool CDSConfig::is_dumping_full_module_graph() {
 48   if (!_dumping_full_module_graph_disabled &&
 49       is_dumping_heap() &&
 50       MetaspaceShared::use_optimized_module_handling()) {
 51     return true;
 52   } else {
 53     return false;
 54   }
 55 }
 56 
 57 bool CDSConfig::is_loading_full_module_graph() {
 58   if (ClassLoaderDataShared::is_full_module_graph_loaded()) {
 59     return true;
 60   }
 61 
 62   if (!_loading_full_module_graph_disabled &&

  1 /*
  2  * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 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 #include "precompiled.hpp"
 26 #include "cds/archiveHeapLoader.hpp"
 27 #include "cds/cdsConfig.hpp"
 28 #include "cds/heapShared.hpp"
 29 #include "classfile/classLoaderDataShared.hpp"
 30 #include "logging/log.hpp"
 31 #include "runtime/arguments.hpp"
 32 #include "runtime/globals.hpp"
 33 
 34 bool CDSConfig::_is_dumping_static_archive = false;
 35 bool CDSConfig::_is_dumping_dynamic_archive = false;
 36 
 37 // The ability to dump the FMG depends on many factors checked by
 38 // is_dumping_full_module_graph(), but can be unconditionally disabled by
 39 // _dumping_full_module_graph_disabled. (Ditto for loading the FMG).
 40 bool CDSConfig::_dumping_full_module_graph_disabled = false;
 41 bool CDSConfig::_loading_full_module_graph_disabled = false;
 42 
 43 bool CDSConfig::is_valhalla_preview() {
 44   return Arguments::enable_preview() && EnableValhalla;
 45 }
 46 
 47 
 48 #if INCLUDE_CDS_JAVA_HEAP
 49 bool CDSConfig::is_dumping_heap() {
 50   if (is_valhalla_preview()) {
 51     // Not working yet -- e.g., HeapShared::oop_hash() needs to be implemented for value oops
 52     return false;
 53   }
 54   // heap dump is not supported in dynamic dump
 55   return is_dumping_static_archive() && HeapShared::can_write();
 56 }
 57 
 58 bool CDSConfig::is_dumping_full_module_graph() {
 59   if (!_dumping_full_module_graph_disabled &&
 60       is_dumping_heap() &&
 61       MetaspaceShared::use_optimized_module_handling()) {
 62     return true;
 63   } else {
 64     return false;
 65   }
 66 }
 67 
 68 bool CDSConfig::is_loading_full_module_graph() {
 69   if (ClassLoaderDataShared::is_full_module_graph_loaded()) {
 70     return true;
 71   }
 72 
 73   if (!_loading_full_module_graph_disabled &&
< prev index next >