author | stuefe |
Fri, 17 Mar 2017 19:05:45 +0100 | |
changeset 46360 | c753322134b0 |
parent 46324 | 8764956ec928 |
child 46427 | 54713555867e |
permissions | -rw-r--r-- |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
1 |
/* |
46324
8764956ec928
8005165: Remove CPU-dependent code in self-patching vtables
iklam
parents:
41182
diff
changeset
|
2 |
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
4 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
8 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
13 |
* accompanied this code). |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
14 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
18 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
21 |
* questions. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
22 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
23 |
*/ |
30578 | 24 |
|
25 |
#ifndef SHARE_VM_MEMORY_METASPACESHARED_HPP |
|
26 |
#define SHARE_VM_MEMORY_METASPACESHARED_HPP |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
27 |
|
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
28 |
#include "classfile/compactHashtable.hpp" |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
29 |
#include "memory/allocation.hpp" |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
30 |
#include "memory/memRegion.hpp" |
30291
54cdc5c1a9cb
8068352: Move virtualspace.* out of src/share/vm/runtime to memory directory
coleenp
parents:
28363
diff
changeset
|
31 |
#include "memory/virtualspace.hpp" |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
32 |
#include "utilities/exceptions.hpp" |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
33 |
#include "utilities/macros.hpp" |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
34 |
|
38634
176eda5b3359
8157090: SharedArchiveFile/SpaceUtilizationCheck.java fails as space utilization is below 30 percent
redestad
parents:
38303
diff
changeset
|
35 |
#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M)) |
176eda5b3359
8157090: SharedArchiveFile/SpaceUtilizationCheck.java fails as space utilization is below 30 percent
redestad
parents:
38303
diff
changeset
|
36 |
#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M)) |
34242
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
37 |
|
38634
176eda5b3359
8157090: SharedArchiveFile/SpaceUtilizationCheck.java fails as space utilization is below 30 percent
redestad
parents:
38303
diff
changeset
|
38 |
#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M)) |
176eda5b3359
8157090: SharedArchiveFile/SpaceUtilizationCheck.java fails as space utilization is below 30 percent
redestad
parents:
38303
diff
changeset
|
39 |
#define MIN_SHARED_READ_ONLY_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M)) |
34242
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
40 |
|
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
41 |
// the MIN_SHARED_MISC_DATA_SIZE and MIN_SHARED_MISC_CODE_SIZE estimates are based on |
37439
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
42 |
// the sizes required for dumping the archive using the default classlist. The sizes |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
43 |
// are multiplied by 1.5 for a safety margin. |
34242
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
44 |
|
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
45 |
#define DEFAULT_SHARED_MISC_DATA_SIZE (NOT_LP64(2*M) LP64_ONLY(4*M)) |
37439
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
46 |
#define MIN_SHARED_MISC_DATA_SIZE (NOT_LP64(1*M) LP64_ONLY(1200*K)) |
34242
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
47 |
|
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
48 |
#define DEFAULT_SHARED_MISC_CODE_SIZE (120*K) |
37439
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
49 |
#define MIN_SHARED_MISC_CODE_SIZE (NOT_LP64(63*K) LP64_ONLY(69*K)) |
34242
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
50 |
#define DEFAULT_COMBINED_SIZE (DEFAULT_SHARED_READ_WRITE_SIZE+DEFAULT_SHARED_READ_ONLY_SIZE+DEFAULT_SHARED_MISC_DATA_SIZE+DEFAULT_SHARED_MISC_CODE_SIZE) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
51 |
|
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
52 |
// the max size is the MAX size (ie. 0x7FFFFFFF) - the total size of |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
53 |
// the other 3 sections - page size (to avoid overflow in case the final |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
54 |
// size will get aligned up on page size) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
55 |
#define SHARED_PAGE ((size_t)os::vm_page_size()) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
56 |
#define MAX_SHARED_DELTA (0x7FFFFFFF) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
57 |
#define MAX_SHARED_READ_WRITE_SIZE (MAX_SHARED_DELTA-(MIN_SHARED_READ_ONLY_SIZE+MIN_SHARED_MISC_DATA_SIZE+MIN_SHARED_MISC_CODE_SIZE)-SHARED_PAGE) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
58 |
#define MAX_SHARED_READ_ONLY_SIZE (MAX_SHARED_DELTA-(MIN_SHARED_READ_WRITE_SIZE+MIN_SHARED_MISC_DATA_SIZE+MIN_SHARED_MISC_CODE_SIZE)-SHARED_PAGE) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
59 |
#define MAX_SHARED_MISC_DATA_SIZE (MAX_SHARED_DELTA-(MIN_SHARED_READ_WRITE_SIZE+MIN_SHARED_READ_ONLY_SIZE+MIN_SHARED_MISC_CODE_SIZE)-SHARED_PAGE) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
60 |
#define MAX_SHARED_MISC_CODE_SIZE (MAX_SHARED_DELTA-(MIN_SHARED_READ_WRITE_SIZE+MIN_SHARED_READ_ONLY_SIZE+MIN_SHARED_MISC_DATA_SIZE)-SHARED_PAGE) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
61 |
|
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
62 |
#define LargeSharedArchiveSize (300*M) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
63 |
#define HugeSharedArchiveSize (800*M) |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
64 |
#define ReadOnlyRegionPercentage 0.4 |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
65 |
#define ReadWriteRegionPercentage 0.55 |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
66 |
#define MiscDataRegionPercentage 0.03 |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
67 |
#define MiscCodeRegionPercentage 0.02 |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
68 |
#define LargeThresholdClassCount 5000 |
e530decd7c63
8138983: Runtime: implement ranges for Shared*** flags
gziemski
parents:
31345
diff
changeset
|
69 |
#define HugeThresholdClassCount 40000 |
26304
a28e6335ce60
8048150: Allow easy configurations for large CDS archives
ccheung
parents:
26135
diff
changeset
|
70 |
|
a28e6335ce60
8048150: Allow easy configurations for large CDS archives
ccheung
parents:
26135
diff
changeset
|
71 |
#define SET_ESTIMATED_SIZE(type, region) \ |
a28e6335ce60
8048150: Allow easy configurations for large CDS archives
ccheung
parents:
26135
diff
changeset
|
72 |
Shared ##region## Size = FLAG_IS_DEFAULT(Shared ##region## Size) ? \ |
26408
d6defe172e25
8056175: Change "8048150: Allow easy configurations for large CDS archives" triggers conversion warning with older GCC
ccheung
parents:
26304
diff
changeset
|
73 |
(uintx)(type ## SharedArchiveSize * region ## RegionPercentage) : Shared ## region ## Size |
26304
a28e6335ce60
8048150: Allow easy configurations for large CDS archives
ccheung
parents:
26135
diff
changeset
|
74 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
75 |
class FileMapInfo; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
76 |
|
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
77 |
class MetaspaceSharedStats VALUE_OBJ_CLASS_SPEC { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
78 |
public: |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
79 |
MetaspaceSharedStats() { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
80 |
memset(this, 0, sizeof(*this)); |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
81 |
} |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
82 |
CompactHashtableStats symbol; |
31345
1bba15125d8d
8015086: add interned strings to the shared archive.
jiangli
parents:
30579
diff
changeset
|
83 |
CompactHashtableStats string; |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
84 |
}; |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
85 |
|
35231 | 86 |
class SharedMiscRegion VALUE_OBJ_CLASS_SPEC { |
87 |
private: |
|
88 |
VirtualSpace _vs; |
|
89 |
char* _alloc_top; |
|
90 |
SharedSpaceType _space_type; |
|
91 |
||
92 |
public: |
|
93 |
void initialize(ReservedSpace rs, size_t committed_byte_size, SharedSpaceType space_type); |
|
94 |
VirtualSpace* virtual_space() { |
|
95 |
return &_vs; |
|
96 |
} |
|
97 |
char* low() const { |
|
98 |
return _vs.low(); |
|
99 |
} |
|
100 |
char* alloc_top() const { |
|
101 |
return _alloc_top; |
|
102 |
} |
|
103 |
char* alloc(size_t num_bytes) NOT_CDS_RETURN_(NULL); |
|
104 |
}; |
|
105 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
106 |
// Class Data Sharing Support |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
107 |
class MetaspaceShared : AllStatic { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
108 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
109 |
// CDS support |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
110 |
static ReservedSpace* _shared_rs; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
111 |
static int _max_alignment; |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
112 |
static MetaspaceSharedStats _stats; |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
113 |
static bool _link_classes_made_progress; |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
114 |
static bool _check_classes_made_progress; |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
115 |
static bool _has_error_classes; |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
116 |
static bool _archive_loading_failed; |
39714 | 117 |
static bool _remapped_readwrite; |
37439
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
118 |
static address _cds_i2i_entry_code_buffers; |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
119 |
static size_t _cds_i2i_entry_code_buffers_size; |
35231 | 120 |
|
121 |
// Used only during dumping. |
|
122 |
static SharedMiscRegion _md; |
|
123 |
static SharedMiscRegion _mc; |
|
41182 | 124 |
static SharedMiscRegion _od; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
125 |
public: |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
126 |
enum { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
127 |
ro = 0, // read-only shared space in the heap |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
128 |
rw = 1, // read-write shared space in the heap |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
129 |
md = 2, // miscellaneous data for initializing tables, etc. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
130 |
mc = 3, // miscellaneous code - vtable replacement. |
31345
1bba15125d8d
8015086: add interned strings to the shared archive.
jiangli
parents:
30579
diff
changeset
|
131 |
max_strings = 2, // max number of string regions in string space |
1bba15125d8d
8015086: add interned strings to the shared archive.
jiangli
parents:
30579
diff
changeset
|
132 |
num_non_strings = 4, // number of non-string regions |
1bba15125d8d
8015086: add interned strings to the shared archive.
jiangli
parents:
30579
diff
changeset
|
133 |
first_string = num_non_strings, // index of first string region |
41182 | 134 |
// The optional data region is the last region. |
135 |
// Currently it only contains class file data. |
|
136 |
od = max_strings + num_non_strings, |
|
137 |
n_regions = od + 1 // total number of regions |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
138 |
}; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
139 |
|
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
140 |
// Accessor functions to save shared space created for metadata, which has |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
141 |
// extra space allocated at the end for miscellaneous data and code. |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
142 |
static void set_max_alignment(int alignment) { |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
143 |
CDS_ONLY(_max_alignment = alignment); |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
144 |
} |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
145 |
|
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
146 |
static int max_alignment() { |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
147 |
CDS_ONLY(return _max_alignment); |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
148 |
NOT_CDS(return 0); |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
149 |
} |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
150 |
|
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
151 |
static void prepare_for_dumping() NOT_CDS_RETURN; |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
152 |
static void preload_and_dump(TRAPS) NOT_CDS_RETURN; |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
153 |
static int preload_and_dump(const char * class_list_path, |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
154 |
GrowableArray<Klass*>* class_promote_order, |
27677 | 155 |
TRAPS) NOT_CDS_RETURN_(0); |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
156 |
|
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
157 |
static ReservedSpace* shared_rs() { |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
158 |
CDS_ONLY(return _shared_rs); |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
159 |
NOT_CDS(return NULL); |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
160 |
} |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
161 |
|
35231 | 162 |
static void initialize_shared_rs(ReservedSpace* rs) NOT_CDS_RETURN; |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
163 |
|
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
164 |
static void set_archive_loading_failed() { |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
165 |
_archive_loading_failed = true; |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
166 |
} |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
167 |
static bool map_shared_spaces(FileMapInfo* mapinfo) NOT_CDS_RETURN_(false); |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
168 |
static void initialize_shared_spaces() NOT_CDS_RETURN; |
31345
1bba15125d8d
8015086: add interned strings to the shared archive.
jiangli
parents:
30579
diff
changeset
|
169 |
static void fixup_shared_string_regions() NOT_CDS_RETURN; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
170 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
171 |
// Return true if given address is in the mapped shared space. |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
172 |
static bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
173 |
|
37439
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
174 |
// Return true if given address is in the shared region corresponding to the idx |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
175 |
static bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false); |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
176 |
|
31345
1bba15125d8d
8015086: add interned strings to the shared archive.
jiangli
parents:
30579
diff
changeset
|
177 |
static bool is_string_region(int idx) NOT_CDS_RETURN_(false); |
1bba15125d8d
8015086: add interned strings to the shared archive.
jiangli
parents:
30579
diff
changeset
|
178 |
|
46324
8764956ec928
8005165: Remove CPU-dependent code in self-patching vtables
iklam
parents:
41182
diff
changeset
|
179 |
static intptr_t* allocate_cpp_vtable_clones(intptr_t* top, intptr_t* end); |
8764956ec928
8005165: Remove CPU-dependent code in self-patching vtables
iklam
parents:
41182
diff
changeset
|
180 |
static intptr_t* clone_cpp_vtables(intptr_t* p); |
8764956ec928
8005165: Remove CPU-dependent code in self-patching vtables
iklam
parents:
41182
diff
changeset
|
181 |
static void zero_cpp_vtable_clones_for_writing(); |
8764956ec928
8005165: Remove CPU-dependent code in self-patching vtables
iklam
parents:
41182
diff
changeset
|
182 |
static void patch_cpp_vtable_pointers(); |
8764956ec928
8005165: Remove CPU-dependent code in self-patching vtables
iklam
parents:
41182
diff
changeset
|
183 |
static bool is_valid_shared_method(const Method* m); |
8764956ec928
8005165: Remove CPU-dependent code in self-patching vtables
iklam
parents:
41182
diff
changeset
|
184 |
|
37995 | 185 |
static void serialize(SerializeClosure* sc, GrowableArray<MemRegion> *string_space, |
186 |
size_t* space_size); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
187 |
|
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
188 |
static MetaspaceSharedStats* stats() { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
189 |
return &_stats; |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
190 |
} |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
28023
diff
changeset
|
191 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
192 |
// JVM/TI RedefineClasses() support: |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
193 |
// Remap the shared readonly space to shared readwrite, private if |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
194 |
// sharing is enabled. Simply returns true if sharing is not enabled |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
195 |
// or if the remapping has already been done by a prior call. |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
196 |
static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true); |
39714 | 197 |
static bool remapped_readwrite() { |
198 |
CDS_ONLY(return _remapped_readwrite); |
|
199 |
NOT_CDS(return false); |
|
200 |
} |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
201 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
202 |
static void print_shared_spaces(); |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
203 |
|
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
204 |
static bool try_link_class(InstanceKlass* ik, TRAPS); |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
205 |
static void link_one_shared_class(Klass* obj, TRAPS); |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
206 |
static void check_one_shared_class(Klass* obj); |
36508 | 207 |
static void check_shared_class_loader_type(Klass* obj); |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
13975
diff
changeset
|
208 |
static void link_and_cleanup_shared_classes(TRAPS); |
26304
a28e6335ce60
8048150: Allow easy configurations for large CDS archives
ccheung
parents:
26135
diff
changeset
|
209 |
|
a28e6335ce60
8048150: Allow easy configurations for large CDS archives
ccheung
parents:
26135
diff
changeset
|
210 |
static int count_class(const char* classlist_file); |
a28e6335ce60
8048150: Allow easy configurations for large CDS archives
ccheung
parents:
26135
diff
changeset
|
211 |
static void estimate_regions_size() NOT_CDS_RETURN; |
34257
4be3504cc03b
8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
31345
diff
changeset
|
212 |
|
41182 | 213 |
// Allocate a block of memory from the "mc", "md", or "od" regions. |
35231 | 214 |
static char* misc_code_space_alloc(size_t num_bytes) { return _mc.alloc(num_bytes); } |
215 |
static char* misc_data_space_alloc(size_t num_bytes) { return _md.alloc(num_bytes); } |
|
41182 | 216 |
static char* optional_data_space_alloc(size_t num_bytes) { return _od.alloc(num_bytes); } |
35231 | 217 |
|
37439
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
218 |
static address cds_i2i_entry_code_buffers(size_t total_size); |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
219 |
|
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
220 |
static address cds_i2i_entry_code_buffers() { |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
221 |
return _cds_i2i_entry_code_buffers; |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
222 |
} |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
223 |
static size_t cds_i2i_entry_code_buffers_size() { |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
224 |
return _cds_i2i_entry_code_buffers_size; |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
225 |
} |
e8970711113b
8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents:
36508
diff
changeset
|
226 |
|
35231 | 227 |
static SharedMiscRegion* misc_code_region() { |
228 |
assert(DumpSharedSpaces, "used during dumping only"); |
|
229 |
return &_mc; |
|
230 |
} |
|
231 |
static SharedMiscRegion* misc_data_region() { |
|
232 |
assert(DumpSharedSpaces, "used during dumping only"); |
|
233 |
return &_md; |
|
234 |
} |
|
41182 | 235 |
static SharedMiscRegion* optional_data_region() { |
236 |
assert(DumpSharedSpaces, "used during dumping only"); |
|
237 |
return &_od; |
|
238 |
} |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
239 |
}; |
30578 | 240 |
#endif // SHARE_VM_MEMORY_METASPACESHARED_HPP |