56 static int _max_alignment; |
56 static int _max_alignment; |
57 static MetaspaceSharedStats _stats; |
57 static MetaspaceSharedStats _stats; |
58 static bool _has_error_classes; |
58 static bool _has_error_classes; |
59 static bool _archive_loading_failed; |
59 static bool _archive_loading_failed; |
60 static bool _remapped_readwrite; |
60 static bool _remapped_readwrite; |
61 static bool _open_archive_heap_region_mapped; |
|
62 static bool _archive_heap_region_fixed; |
|
63 static address _cds_i2i_entry_code_buffers; |
61 static address _cds_i2i_entry_code_buffers; |
64 static size_t _cds_i2i_entry_code_buffers_size; |
62 static size_t _cds_i2i_entry_code_buffers_size; |
65 static size_t _core_spaces_size; |
63 static size_t _core_spaces_size; |
66 public: |
64 public: |
67 enum { |
65 enum { |
91 static void prepare_for_dumping() NOT_CDS_RETURN; |
89 static void prepare_for_dumping() NOT_CDS_RETURN; |
92 static void preload_and_dump(TRAPS) NOT_CDS_RETURN; |
90 static void preload_and_dump(TRAPS) NOT_CDS_RETURN; |
93 static int preload_classes(const char * class_list_path, |
91 static int preload_classes(const char * class_list_path, |
94 TRAPS) NOT_CDS_RETURN_(0); |
92 TRAPS) NOT_CDS_RETURN_(0); |
95 |
93 |
96 #if INCLUDE_CDS_JAVA_HEAP |
94 static GrowableArray<Klass*>* collected_klasses(); |
97 private: |
|
98 static bool obj_equals(oop const& p1, oop const& p2) { |
|
99 return p1 == p2; |
|
100 } |
|
101 static unsigned obj_hash(oop const& p); |
|
102 |
|
103 typedef ResourceHashtable<oop, oop, |
|
104 MetaspaceShared::obj_hash, |
|
105 MetaspaceShared::obj_equals, |
|
106 15889, // prime number |
|
107 ResourceObj::C_HEAP> ArchivedObjectCache; |
|
108 static ArchivedObjectCache* _archive_object_cache; |
|
109 |
|
110 public: |
|
111 static ArchivedObjectCache* archive_object_cache() { |
|
112 return _archive_object_cache; |
|
113 } |
|
114 static oop find_archived_heap_object(oop obj); |
|
115 static oop archive_heap_object(oop obj, Thread* THREAD); |
|
116 static oop materialize_archived_object(narrowOop v); |
|
117 static void archive_klass_objects(Thread* THREAD); |
|
118 |
|
119 static void set_archive_heap_region_fixed() { |
|
120 _archive_heap_region_fixed = true; |
|
121 } |
|
122 |
|
123 static bool archive_heap_region_fixed() { |
|
124 return _archive_heap_region_fixed; |
|
125 } |
|
126 #endif |
|
127 |
|
128 inline static bool is_archive_object(oop p) NOT_CDS_JAVA_HEAP_RETURN_(false); |
|
129 |
|
130 static bool is_heap_object_archiving_allowed() { |
|
131 CDS_JAVA_HEAP_ONLY(return (UseG1GC && UseCompressedOops && UseCompressedClassPointers);) |
|
132 NOT_CDS_JAVA_HEAP(return false;) |
|
133 } |
|
134 static void create_archive_object_cache() { |
|
135 CDS_JAVA_HEAP_ONLY(_archive_object_cache = new (ResourceObj::C_HEAP, mtClass)ArchivedObjectCache();); |
|
136 } |
|
137 static void destroy_archive_object_cache() { |
|
138 CDS_JAVA_HEAP_ONLY(delete _archive_object_cache; _archive_object_cache = NULL;); |
|
139 } |
|
140 static void fixup_mapped_heap_regions() NOT_CDS_JAVA_HEAP_RETURN; |
|
141 |
|
142 static void dump_closed_archive_heap_objects(GrowableArray<MemRegion> * closed_archive) NOT_CDS_JAVA_HEAP_RETURN; |
|
143 |
|
144 static void dump_open_archive_heap_objects(GrowableArray<MemRegion> * open_archive) NOT_CDS_JAVA_HEAP_RETURN; |
|
145 static void set_open_archive_heap_region_mapped() { |
|
146 CDS_JAVA_HEAP_ONLY(_open_archive_heap_region_mapped = true); |
|
147 NOT_CDS_JAVA_HEAP_RETURN; |
|
148 } |
|
149 static bool open_archive_heap_region_mapped() { |
|
150 CDS_JAVA_HEAP_ONLY(return _open_archive_heap_region_mapped); |
|
151 NOT_CDS_JAVA_HEAP_RETURN_(false); |
|
152 } |
|
153 |
95 |
154 static ReservedSpace* shared_rs() { |
96 static ReservedSpace* shared_rs() { |
155 CDS_ONLY(return &_shared_rs); |
97 CDS_ONLY(return &_shared_rs); |
156 NOT_CDS(return NULL); |
98 NOT_CDS(return NULL); |
157 } |
99 } |