39 static ReservedSpace* _shared_rs; 40 static int _max_alignment; 41 42 public: 43 enum { 44 vtbl_list_size = 17, // number of entries in the shared space vtable list. 45 num_virtuals = 200 // maximum number of virtual functions 46 // If virtual functions are added to Metadata, 47 // this number needs to be increased. Also, 48 // SharedMiscCodeSize will need to be increased. 49 }; 50 51 enum { 52 ro = 0, // read-only shared space in the heap 53 rw = 1, // read-write shared space in the heap 54 md = 2, // miscellaneous data for initializing tables, etc. 55 mc = 3, // miscellaneous code - vtable replacement. 56 n_regions = 4 57 }; 58 59 static void set_max_alignment(int alignment) KERNEL_RETURN; 60 static int max_alignment() KERNEL_RETURN_(0); 61 62 static void preload_and_dump(TRAPS) KERNEL_RETURN; 63 static ReservedSpace* shared_rs(); 64 static void set_shared_rs(ReservedSpace* rs) KERNEL_RETURN; 65 66 static bool map_shared_spaces(FileMapInfo* mapinfo) KERNEL_RETURN_(false); 67 static void initialize_shared_spaces() KERNEL_RETURN; 68 69 // Return true if given address is in the mapped shared space. 70 static bool is_in_shared_space(const void* p) KERNEL_RETURN_(false); 71 72 static void generate_vtable_methods(void** vtbl_list, 73 void** vtable, 74 char** md_top, char* md_end, 75 char** mc_top, char* mc_end); 76 static void serialize(SerializeClosure* sc); 77 78 // JVM/TI RedefineClasses() support: 79 // Remap the shared readonly space to shared readwrite, private if 80 // sharing is enabled. Simply returns true if sharing is not enabled 81 // or if the remapping has already been done by a prior call. 82 static bool remap_shared_readonly_as_readwrite() KERNEL_RETURN_(true); 83 84 static void print_shared_spaces(); 85 }; 86 #endif // SHARE_VM_MEMORY_METASPACE_SHARED_HPP | 39 static ReservedSpace* _shared_rs; 40 static int _max_alignment; 41 42 public: 43 enum { 44 vtbl_list_size = 17, // number of entries in the shared space vtable list. 45 num_virtuals = 200 // maximum number of virtual functions 46 // If virtual functions are added to Metadata, 47 // this number needs to be increased. Also, 48 // SharedMiscCodeSize will need to be increased. 49 }; 50 51 enum { 52 ro = 0, // read-only shared space in the heap 53 rw = 1, // read-write shared space in the heap 54 md = 2, // miscellaneous data for initializing tables, etc. 55 mc = 3, // miscellaneous code - vtable replacement. 56 n_regions = 4 57 }; 58 59 // Accessor functions to save shared space created for metadata, which has 60 // extra space allocated at the end for miscellaneous data and code. 61 static void set_max_alignment(int alignment) { 62 CDS_ONLY(_max_alignment = alignment); 63 } 64 65 static int max_alignment() { 66 CDS_ONLY(return _max_alignment); 67 NOT_CDS(return 0); 68 } 69 70 static void preload_and_dump(TRAPS) NOT_CDS_RETURN; 71 72 static ReservedSpace* shared_rs() { 73 CDS_ONLY(return _shared_rs); 74 NOT_CDS(return NULL); 75 } 76 77 static void set_shared_rs(ReservedSpace* rs) { 78 CDS_ONLY(_shared_rs = rs;) 79 } 80 81 static bool map_shared_spaces(FileMapInfo* mapinfo) NOT_CDS_RETURN_(false); 82 static void initialize_shared_spaces() NOT_CDS_RETURN; 83 84 // Return true if given address is in the mapped shared space. 85 static bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false); 86 87 static void generate_vtable_methods(void** vtbl_list, 88 void** vtable, 89 char** md_top, char* md_end, 90 char** mc_top, char* mc_end); 91 static void serialize(SerializeClosure* sc); 92 93 // JVM/TI RedefineClasses() support: 94 // Remap the shared readonly space to shared readwrite, private if 95 // sharing is enabled. Simply returns true if sharing is not enabled 96 // or if the remapping has already been done by a prior call. 97 static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true); 98 99 static void print_shared_spaces(); 100 }; 101 #endif // SHARE_VM_MEMORY_METASPACE_SHARED_HPP |