author | jiangli |
Fri, 07 Sep 2018 15:18:14 -0400 | |
changeset 51674 | d7dcaacb95dd |
parent 51491 | 187c84a5efe1 |
child 51701 | 9012aeaf993b |
permissions | -rw-r--r-- |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
1 |
/* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
2 |
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
4 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
8 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
13 |
* accompanied this code). |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
14 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
18 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
21 |
* questions. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
22 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
23 |
*/ |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
24 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
25 |
#ifndef SHARE_VM_MEMORY_HEAPSHARED_HPP |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
26 |
#define SHARE_VM_MEMORY_HEAPSHARED_HPP |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
27 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
28 |
#include "classfile/systemDictionary.hpp" |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
29 |
#include "memory/universe.hpp" |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
30 |
#include "oops/objArrayKlass.hpp" |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
31 |
#include "oops/oop.hpp" |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
32 |
#include "oops/typeArrayKlass.hpp" |
51491
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
33 |
#include "utilities/bitMap.hpp" |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
34 |
#include "utilities/growableArray.hpp" |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
35 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
36 |
#if INCLUDE_CDS_JAVA_HEAP |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
37 |
// A dump time sub-graph info for Klass _k. It includes the entry points |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
38 |
// (static fields in _k's mirror) of the archived sub-graphs reachable |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
39 |
// from _k's mirror. It also contains a list of Klasses of the objects |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
40 |
// within the sub-graphs. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
41 |
class KlassSubGraphInfo: public CHeapObj<mtClass> { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
42 |
private: |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
43 |
KlassSubGraphInfo* _next; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
44 |
// The class that contains the static field(s) as the entry point(s) |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
45 |
// of archived object sub-graph(s). |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
46 |
Klass* _k; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
47 |
// A list of classes need to be loaded and initialized before the archived |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
48 |
// object sub-graphs can be accessed at runtime. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
49 |
GrowableArray<Klass*>* _subgraph_object_klasses; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
50 |
// A list of _k's static fields as the entry points of archived sub-graphs. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
51 |
// For each entry field, it is a pair of field_offset and field_value. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
52 |
GrowableArray<juint>* _subgraph_entry_fields; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
53 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
54 |
public: |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
55 |
KlassSubGraphInfo(Klass* k, KlassSubGraphInfo* next) : |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
56 |
_next(next), _k(k), _subgraph_object_klasses(NULL), |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
57 |
_subgraph_entry_fields(NULL) {} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
58 |
~KlassSubGraphInfo() { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
59 |
if (_subgraph_object_klasses != NULL) { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
60 |
delete _subgraph_object_klasses; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
61 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
62 |
if (_subgraph_entry_fields != NULL) { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
63 |
delete _subgraph_entry_fields; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
64 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
65 |
}; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
66 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
67 |
KlassSubGraphInfo* next() { return _next; } |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
68 |
Klass* klass() { return _k; } |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
69 |
GrowableArray<Klass*>* subgraph_object_klasses() { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
70 |
return _subgraph_object_klasses; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
71 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
72 |
GrowableArray<juint>* subgraph_entry_fields() { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
73 |
return _subgraph_entry_fields; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
74 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
75 |
void add_subgraph_entry_field(int static_field_offset, oop v); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
76 |
void add_subgraph_object_klass(Klass *orig_k, Klass *relocated_k); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
77 |
}; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
78 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
79 |
// An archived record of object sub-graphs reachable from static |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
80 |
// fields within _k's mirror. The record is reloaded from the archive |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
81 |
// at runtime. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
82 |
class ArchivedKlassSubGraphInfoRecord { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
83 |
private: |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
84 |
ArchivedKlassSubGraphInfoRecord* _next; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
85 |
Klass* _k; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
86 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
87 |
// contains pairs of field offset and value for each subgraph entry field |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
88 |
Array<juint>* _entry_field_records; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
89 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
90 |
// klasses of objects in archived sub-graphs referenced from the entry points |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
91 |
// (static fields) in the containing class |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
92 |
Array<Klass*>* _subgraph_klasses; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
93 |
public: |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
94 |
ArchivedKlassSubGraphInfoRecord() : |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
95 |
_next(NULL), _k(NULL), _entry_field_records(NULL), _subgraph_klasses(NULL) {} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
96 |
void init(KlassSubGraphInfo* info); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
97 |
Klass* klass() { return _k; } |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
98 |
ArchivedKlassSubGraphInfoRecord* next() { return _next; } |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
99 |
void set_next(ArchivedKlassSubGraphInfoRecord* next) { _next = next; } |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
100 |
Array<juint>* entry_field_records() { return _entry_field_records; } |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
101 |
Array<Klass*>* subgraph_klasses() { return _subgraph_klasses; } |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
102 |
}; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
103 |
#endif // INCLUDE_CDS_JAVA_HEAP |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
104 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
105 |
class HeapShared: AllStatic { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
106 |
private: |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
107 |
#if INCLUDE_CDS_JAVA_HEAP |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
108 |
// This is a list of subgraph infos built at dump time while |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
109 |
// archiving object subgraphs. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
110 |
static KlassSubGraphInfo* _subgraph_info_list; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
111 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
112 |
// Contains a list of ArchivedKlassSubGraphInfoRecords that is stored |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
113 |
// in the archive file and reloaded at runtime. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
114 |
static int _num_archived_subgraph_info_records; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
115 |
static Array<ArchivedKlassSubGraphInfoRecord>* _archived_subgraph_info_records; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
116 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
117 |
// Archive object sub-graph starting from the given static field |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
118 |
// in Klass k's mirror. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
119 |
static void archive_reachable_objects_from_static_field( |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
120 |
Klass* k, int field_ofset, BasicType field_type, TRAPS); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
121 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
122 |
static KlassSubGraphInfo* find_subgraph_info(Klass *k); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
123 |
static KlassSubGraphInfo* get_subgraph_info(Klass *k); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
124 |
static int num_of_subgraph_infos(); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
125 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
126 |
static size_t build_archived_subgraph_info_records(int num_records); |
51491
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
127 |
|
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
128 |
// Used by decode_with_archived_oop_encoding_mode |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
129 |
static address _narrow_oop_base; |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
130 |
static int _narrow_oop_shift; |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
131 |
|
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
132 |
#endif // INCLUDE_CDS_JAVA_HEAP |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
133 |
public: |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
134 |
static char* read_archived_subgraph_infos(char* buffer) NOT_CDS_JAVA_HEAP_RETURN_(buffer); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
135 |
static void write_archived_subgraph_infos() NOT_CDS_JAVA_HEAP_RETURN; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
136 |
static void initialize_from_archived_subgraph(Klass* k) NOT_CDS_JAVA_HEAP_RETURN; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
137 |
|
51491
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
138 |
// NarrowOops stored in the CDS archive may use a different encoding scheme |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
139 |
// than Universe::narrow_oop_{base,shift} -- see FileMapInfo::map_heap_regions_impl. |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
140 |
// To decode them, do not use CompressedOops::decode_not_null. Use this |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
141 |
// function instead. |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
142 |
inline static oop decode_with_archived_oop_encoding_mode(narrowOop v) NOT_CDS_JAVA_HEAP_RETURN_(NULL); |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
143 |
|
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
144 |
static void init_narrow_oop_decoding(address base, int shift) NOT_CDS_JAVA_HEAP_RETURN; |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
145 |
|
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
146 |
static void patch_archived_heap_embedded_pointers(MemRegion mem, address oopmap, |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
147 |
size_t oopmap_in_bits) NOT_CDS_JAVA_HEAP_RETURN; |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
148 |
|
51429
d9f6e3ee7fcb
8209545: Simplify HeapShared::archive_module_graph_objects
iklam
parents:
50951
diff
changeset
|
149 |
static void init_archivable_static_fields(Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN; |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
150 |
static void archive_module_graph_objects(Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN; |
51491
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
151 |
|
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
152 |
#if INCLUDE_CDS_JAVA_HEAP |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
153 |
static ResourceBitMap calculate_oopmap(MemRegion region); |
187c84a5efe1
8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
51429
diff
changeset
|
154 |
#endif |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
155 |
}; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
156 |
#endif // SHARE_VM_MEMORY_HEAPSHARED_HPP |