< prev index next >

src/hotspot/share/memory/metaspaceShared.hpp

Print this page

@@ -76,10 +76,11 @@
   static size_t  _core_spaces_size;
   static void* _shared_metaspace_static_top;
   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
     mc = 0,  // miscellaneous code for method trampolines
     rw = 1,  // read-write shared space in the heap

@@ -211,21 +212,26 @@
   static char* symbol_space_alloc(size_t num_bytes);
 
   // 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 <typename T>
   static Array<T>* new_ro_array(int length) {
-#if INCLUDE_CDS
     size_t byte_size = Array<T>::byte_sizeof(length, sizeof(T));
     Array<T>* array = (Array<T>*)read_only_space_alloc(byte_size);
     array->initialize(length);
     return array;
-#else
-    return NULL;
-#endif
+  }
+
+  template <typename T>
+  static Array<T>* new_rw_array(int length) {
+    size_t byte_size = Array<T>::byte_sizeof(length, sizeof(T));
+    Array<T>* array = (Array<T>*)read_write_space_alloc(byte_size);
+    array->initialize(length);
+    return array;
   }
 
   template <typename T>
   static size_t ro_array_bytesize(int length) {
     size_t byte_size = Array<T>::byte_sizeof(length, sizeof(T));

@@ -241,10 +247,11 @@
     return _i2i_entry_code_buffers_size;
   }
   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);
   static void initialize_ptr_marker(CHeapBitMap* ptrmap);
 

@@ -266,13 +273,17 @@
   static void write_core_archive_regions(FileMapInfo* mapinfo,
                                          GrowableArray<ArchiveHeapOopmapInfo>* closed_oopmaps,
                                          GrowableArray<ArchiveHeapOopmapInfo>* 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,
                            bool read_only,  bool allow_exec);
 #endif
< prev index next >