Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/cds/dynamicArchive.hpp
41144 views
1
/*
2
* Copyright (c) 2019, 2021, 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
#ifndef SHARE_CDS_DYNAMICARCHIVE_HPP
26
#define SHARE_CDS_DYNAMICARCHIVE_HPP
27
28
#include "cds/filemap.hpp"
29
#include "classfile/compactHashtable.hpp"
30
#include "memory/allocation.hpp"
31
#include "memory/memRegion.hpp"
32
#include "memory/virtualspace.hpp"
33
#include "oops/oop.hpp"
34
#include "utilities/exceptions.hpp"
35
#include "utilities/macros.hpp"
36
#include "utilities/resourceHash.hpp"
37
38
#if INCLUDE_CDS
39
40
class DynamicArchiveHeader : public FileMapHeader {
41
friend class CDSOffsets;
42
private:
43
int _base_header_crc;
44
int _base_region_crc[MetaspaceShared::n_regions];
45
46
public:
47
int base_header_crc() const { return _base_header_crc; }
48
int base_region_crc(int i) const {
49
assert(is_valid_region(i), "must be");
50
return _base_region_crc[i];
51
}
52
53
void set_base_header_crc(int c) { _base_header_crc = c; }
54
void set_base_region_crc(int i, int c) {
55
assert(is_valid_region(i), "must be");
56
_base_region_crc[i] = c;
57
}
58
};
59
60
class DynamicArchive : AllStatic {
61
static bool _has_been_dumped_once;
62
public:
63
static void prepare_for_dynamic_dumping_at_exit();
64
static void dump(const char* archive_name, TRAPS);
65
static void dump();
66
static bool has_been_dumped_once() { return _has_been_dumped_once; }
67
static void set_has_been_dumped_once() { _has_been_dumped_once = true; }
68
static bool is_mapped() { return FileMapInfo::dynamic_info() != NULL; }
69
static bool validate(FileMapInfo* dynamic_info);
70
};
71
#endif // INCLUDE_CDS
72
#endif // SHARE_CDS_DYNAMICARCHIVE_HPP
73
74