155 static ReservedSpace* shared_rs() {
156 CDS_ONLY(return _shared_rs);
157 NOT_CDS(return NULL);
158 }
159
160 static void initialize_shared_rs(ReservedSpace* rs) NOT_CDS_RETURN;
161
162 static void set_archive_loading_failed() {
163 _archive_loading_failed = true;
164 }
165 static bool map_shared_spaces(FileMapInfo* mapinfo) NOT_CDS_RETURN_(false);
166 static void initialize_shared_spaces() NOT_CDS_RETURN;
167 static void fixup_shared_string_regions() NOT_CDS_RETURN;
168
169 // Return true if given address is in the mapped shared space.
170 static bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
171
172 // Return true if given address is in the shared region corresponding to the idx
173 static bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false);
174
175 static bool is_string_region(int idx) NOT_CDS_RETURN_(false);
176
177 static intptr_t* allocate_cpp_vtable_clones(intptr_t* top, intptr_t* end);
178 static intptr_t* clone_cpp_vtables(intptr_t* p);
179 static void zero_cpp_vtable_clones_for_writing();
180 static void patch_cpp_vtable_pointers();
181 static bool is_valid_shared_method(const Method* m);
182
183 static void serialize(SerializeClosure* sc, GrowableArray<MemRegion> *string_space,
184 size_t* space_size);
185
186 static MetaspaceSharedStats* stats() {
187 return &_stats;
188 }
189
190 // JVM/TI RedefineClasses() support:
191 // Remap the shared readonly space to shared readwrite, private if
192 // sharing is enabled. Simply returns true if sharing is not enabled
193 // or if the remapping has already been done by a prior call.
194 static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true);
195 static bool remapped_readwrite() {
|
155 static ReservedSpace* shared_rs() {
156 CDS_ONLY(return _shared_rs);
157 NOT_CDS(return NULL);
158 }
159
160 static void initialize_shared_rs(ReservedSpace* rs) NOT_CDS_RETURN;
161
162 static void set_archive_loading_failed() {
163 _archive_loading_failed = true;
164 }
165 static bool map_shared_spaces(FileMapInfo* mapinfo) NOT_CDS_RETURN_(false);
166 static void initialize_shared_spaces() NOT_CDS_RETURN;
167 static void fixup_shared_string_regions() NOT_CDS_RETURN;
168
169 // Return true if given address is in the mapped shared space.
170 static bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
171
172 // Return true if given address is in the shared region corresponding to the idx
173 static bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false);
174
175 static bool is_string_region(int idx) {
176 CDS_ONLY(return (idx >= first_string && idx < first_string + max_strings));
177 NOT_CDS(return false);
178 }
179
180 static intptr_t* allocate_cpp_vtable_clones(intptr_t* top, intptr_t* end);
181 static intptr_t* clone_cpp_vtables(intptr_t* p);
182 static void zero_cpp_vtable_clones_for_writing();
183 static void patch_cpp_vtable_pointers();
184 static bool is_valid_shared_method(const Method* m);
185
186 static void serialize(SerializeClosure* sc, GrowableArray<MemRegion> *string_space,
187 size_t* space_size);
188
189 static MetaspaceSharedStats* stats() {
190 return &_stats;
191 }
192
193 // JVM/TI RedefineClasses() support:
194 // Remap the shared readonly space to shared readwrite, private if
195 // sharing is enabled. Simply returns true if sharing is not enabled
196 // or if the remapping has already been done by a prior call.
197 static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true);
198 static bool remapped_readwrite() {
|