Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/include/cds.h
40951 views
1
/*
2
* Copyright (c) 2018, 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_INCLUDE_CDS_H
26
#define SHARE_INCLUDE_CDS_H
27
28
// This file declares the CDS data structures that are used by the HotSpot Serviceability Agent
29
// (see C sources inside src/jdk.hotspot.agent).
30
//
31
// We should use only standard C types. Do not use custom types such as bool, intx,
32
// etc, to avoid introducing unnecessary dependencies to other HotSpot type declarations.
33
//
34
// Also, this is a C header file. Do not use C++ here.
35
36
#define NUM_CDS_REGIONS 7 // this must be the same as MetaspaceShared::n_regions
37
#define CDS_ARCHIVE_MAGIC 0xf00baba2
38
#define CDS_DYNAMIC_ARCHIVE_MAGIC 0xf00baba8
39
#define CURRENT_CDS_ARCHIVE_VERSION 11
40
#define INVALID_CDS_ARCHIVE_VERSION -1
41
42
struct CDSFileMapRegion {
43
int _crc; // CRC checksum of this region.
44
int _read_only; // read only region?
45
int _allow_exec; // executable code in this region?
46
int _is_heap_region; // Used by SA and debug build.
47
int _is_bitmap_region; // Relocation bitmap for RO/RW regions (used by SA and debug build).
48
int _mapped_from_file; // Is this region mapped from a file?
49
// If false, this region was initialized using os::read().
50
size_t _file_offset; // Data for this region starts at this offset in the archive file.
51
size_t _mapping_offset; // This region should be mapped at this offset from the base address
52
// - for non-heap regions, the base address is SharedBaseAddress
53
// - for heap regions, the base address is the compressed oop encoding base
54
size_t _used; // Number of bytes actually used by this region (excluding padding bytes added
55
// for alignment purposed.
56
size_t _oopmap_offset; // Bitmap for relocating embedded oops (offset from SharedBaseAddress).
57
size_t _oopmap_size_in_bits;
58
char* _mapped_base; // Actually mapped address (NULL if this region is not mapped).
59
};
60
61
struct CDSFileMapHeaderBase {
62
unsigned int _magic; // identify file type
63
int _crc; // header crc checksum
64
int _version; // must be CURRENT_CDS_ARCHIVE_VERSION
65
struct CDSFileMapRegion _space[NUM_CDS_REGIONS];
66
};
67
68
typedef struct CDSFileMapHeaderBase CDSFileMapHeaderBase;
69
70
#endif // SHARE_INCLUDE_CDS_H
71
72