Path: blob/master/src/hotspot/share/cds/dynamicArchive.hpp
41144 views
/*1* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_CDS_DYNAMICARCHIVE_HPP25#define SHARE_CDS_DYNAMICARCHIVE_HPP2627#include "cds/filemap.hpp"28#include "classfile/compactHashtable.hpp"29#include "memory/allocation.hpp"30#include "memory/memRegion.hpp"31#include "memory/virtualspace.hpp"32#include "oops/oop.hpp"33#include "utilities/exceptions.hpp"34#include "utilities/macros.hpp"35#include "utilities/resourceHash.hpp"3637#if INCLUDE_CDS3839class DynamicArchiveHeader : public FileMapHeader {40friend class CDSOffsets;41private:42int _base_header_crc;43int _base_region_crc[MetaspaceShared::n_regions];4445public:46int base_header_crc() const { return _base_header_crc; }47int base_region_crc(int i) const {48assert(is_valid_region(i), "must be");49return _base_region_crc[i];50}5152void set_base_header_crc(int c) { _base_header_crc = c; }53void set_base_region_crc(int i, int c) {54assert(is_valid_region(i), "must be");55_base_region_crc[i] = c;56}57};5859class DynamicArchive : AllStatic {60static bool _has_been_dumped_once;61public:62static void prepare_for_dynamic_dumping_at_exit();63static void dump(const char* archive_name, TRAPS);64static void dump();65static bool has_been_dumped_once() { return _has_been_dumped_once; }66static void set_has_been_dumped_once() { _has_been_dumped_once = true; }67static bool is_mapped() { return FileMapInfo::dynamic_info() != NULL; }68static bool validate(FileMapInfo* dynamic_info);69};70#endif // INCLUDE_CDS71#endif // SHARE_CDS_DYNAMICARCHIVE_HPP727374