279 static bool is_valid_shared_method(const Method* m) NOT_CDS_RETURN_(false);
280 static void serialize(SerializeClosure* sc) NOT_CDS_RETURN;
281
282 static MetaspaceSharedStats* stats() {
283 return &_stats;
284 }
285
286 static void report_out_of_space(const char* name, size_t needed_bytes);
287
288 // JVM/TI RedefineClasses() support:
289 // Remap the shared readonly space to shared readwrite, private if
290 // sharing is enabled. Simply returns true if sharing is not enabled
291 // or if the remapping has already been done by a prior call.
292 static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true);
293 static bool remapped_readwrite() {
294 CDS_ONLY(return _remapped_readwrite);
295 NOT_CDS(return false);
296 }
297
298 static bool try_link_class(InstanceKlass* ik, TRAPS);
299 static void link_and_cleanup_shared_classes(TRAPS);
300
301 #if INCLUDE_CDS
302 static ReservedSpace reserve_shared_space(size_t size, char* requested_address = NULL);
303 static size_t reserved_space_alignment();
304 static void init_shared_dump_space(DumpRegion* first_space, address first_space_bottom = NULL);
305 static DumpRegion* misc_code_dump_space();
306 static DumpRegion* read_write_dump_space();
307 static DumpRegion* read_only_dump_space();
308 static void pack_dump_space(DumpRegion* current, DumpRegion* next,
309 ReservedSpace* rs);
310
311 static void rewrite_nofast_bytecodes_and_calculate_fingerprints(Thread* thread, InstanceKlass* ik);
312 #endif
313
314 // Allocate a block of memory from the "mc", "ro", or "rw" regions.
315 static char* misc_code_space_alloc(size_t num_bytes);
316 static char* read_only_space_alloc(size_t num_bytes);
317
318 template <typename T>
319 static Array<T>* new_ro_array(int length) {
|
279 static bool is_valid_shared_method(const Method* m) NOT_CDS_RETURN_(false);
280 static void serialize(SerializeClosure* sc) NOT_CDS_RETURN;
281
282 static MetaspaceSharedStats* stats() {
283 return &_stats;
284 }
285
286 static void report_out_of_space(const char* name, size_t needed_bytes);
287
288 // JVM/TI RedefineClasses() support:
289 // Remap the shared readonly space to shared readwrite, private if
290 // sharing is enabled. Simply returns true if sharing is not enabled
291 // or if the remapping has already been done by a prior call.
292 static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true);
293 static bool remapped_readwrite() {
294 CDS_ONLY(return _remapped_readwrite);
295 NOT_CDS(return false);
296 }
297
298 static bool try_link_class(InstanceKlass* ik, TRAPS);
299 static void link_and_cleanup_shared_classes(bool is_static, Thread* THREAD);
300
301 #if INCLUDE_CDS
302 static ReservedSpace reserve_shared_space(size_t size, char* requested_address = NULL);
303 static size_t reserved_space_alignment();
304 static void init_shared_dump_space(DumpRegion* first_space, address first_space_bottom = NULL);
305 static DumpRegion* misc_code_dump_space();
306 static DumpRegion* read_write_dump_space();
307 static DumpRegion* read_only_dump_space();
308 static void pack_dump_space(DumpRegion* current, DumpRegion* next,
309 ReservedSpace* rs);
310
311 static void rewrite_nofast_bytecodes_and_calculate_fingerprints(Thread* thread, InstanceKlass* ik);
312 #endif
313
314 // Allocate a block of memory from the "mc", "ro", or "rw" regions.
315 static char* misc_code_space_alloc(size_t num_bytes);
316 static char* read_only_space_alloc(size_t num_bytes);
317
318 template <typename T>
319 static Array<T>* new_ro_array(int length) {
|