--- old/src/hotspot/share/memory/metaspaceShared.hpp 2020-08-31 08:09:24.091796347 -0700 +++ new/src/hotspot/share/memory/metaspaceShared.hpp 2020-08-31 08:09:23.871788065 -0700 @@ -78,6 +78,7 @@ static intx _relocation_delta; static char* _requested_base_address; static bool _use_optimized_module_handling; + static bool _use_full_module_graph; public: enum { // core archive spaces @@ -213,17 +214,22 @@ // Allocate a block of memory from the "mc" or "ro" regions. static char* misc_code_space_alloc(size_t num_bytes); static char* read_only_space_alloc(size_t num_bytes); + static char* read_write_space_alloc(size_t num_bytes); template static Array* new_ro_array(int length) { -#if INCLUDE_CDS size_t byte_size = Array::byte_sizeof(length, sizeof(T)); Array* array = (Array*)read_only_space_alloc(byte_size); array->initialize(length); return array; -#else - return NULL; -#endif + } + + template + static Array* new_rw_array(int length) { + size_t byte_size = Array::byte_sizeof(length, sizeof(T)); + Array* array = (Array*)read_write_space_alloc(byte_size); + array->initialize(length); + return array; } template @@ -243,6 +249,7 @@ static void relocate_klass_ptr(oop o); static Klass* get_relocated_klass(Klass *k, bool is_final=false); + static Symbol* get_relocated_symbol(Symbol* orig_symbol); static void allocate_cloned_cpp_vtptrs(); static intptr_t* get_archived_cpp_vtable(MetaspaceObj::Type msotype, address obj); @@ -268,9 +275,13 @@ GrowableArray* open_oopmaps); // Can we skip some expensive operations related to modules? - static bool use_optimized_module_handling() { return _use_optimized_module_handling; } + static bool use_optimized_module_handling() { return NOT_CDS(false) CDS_ONLY(_use_optimized_module_handling); } static void disable_optimized_module_handling() { _use_optimized_module_handling = false; } + // Can we use the full archived modue graph? + static bool use_full_module_graph() NOT_CDS_RETURN_(false); + static void disable_full_module_graph() { _use_full_module_graph = false; } + private: #if INCLUDE_CDS static void write_region(FileMapInfo* mapinfo, int region_idx, DumpRegion* dump_region,