< prev index next >

src/share/vm/memory/filemap.hpp

Print this page




 225   void set_cds_i2i_entry_code_buffers_size(size_t s) {
 226     _header->_cds_i2i_entry_code_buffers_size = s;
 227   }
 228   void set_core_spaces_size(size_t s)    {  _header->_core_spaces_size = s; }
 229   size_t core_spaces_size()              { return _header->_core_spaces_size; }
 230 
 231   static FileMapInfo* current_info() {
 232     CDS_ONLY(return _current_info;)
 233     NOT_CDS(return NULL;)
 234   }
 235 
 236   static void assert_mark(bool check);
 237 
 238   // File manipulation.
 239   bool  initialize() NOT_CDS_RETURN_(false);
 240   bool  open_for_read();
 241   void  open_for_write();
 242   void  write_header();
 243   void  write_region(int region, char* base, size_t size,
 244                      bool read_only, bool allow_exec);
 245   void  write_string_regions(GrowableArray<MemRegion> *regions,
 246                              char** s0_start, char** s0_top, char** s0_end,
 247                              char** s1_start, char** s1_top, char** s1_end);
 248   void  write_bytes(const void* buffer, int count);
 249   void  write_bytes_aligned(const void* buffer, int count);
 250   char* map_region(int i);
 251   bool  map_string_regions();
 252   bool  verify_string_regions();
 253   void  fixup_string_regions();
 254   void  unmap_region(int i);
 255   void  dealloc_string_regions();
 256   bool  verify_region_checksum(int i);
 257   void  close();
 258   bool  is_open() { return _file_open; }
 259   ReservedSpace reserve_shared_memory();
 260 
 261   // JVM/TI RedefineClasses() support:
 262   // Remap the shared readonly space to shared readwrite, private.
 263   bool  remap_shared_readonly_as_readwrite();
 264 
 265   // Errors.
 266   static void fail_stop(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2);
 267   static void fail_continue(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2);
 268 
 269   // Return true if given address is in the mapped shared space.
 270   bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
 271   bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false);
 272   void print_shared_spaces() NOT_CDS_RETURN;
 273 
 274   // Stop CDS sharing and unmap CDS regions.
 275   static void stop_sharing_and_unmap(const char* msg);


 277   static void allocate_classpath_entry_table();
 278   bool validate_classpath_entry_table();
 279 
 280   static SharedClassPathEntry* shared_classpath(int index) {
 281     if (index < 0) {
 282       return NULL;
 283     }
 284     assert(index < _classpath_entry_table_size, "sanity");
 285     char* p = (char*)_classpath_entry_table->data();
 286     p += _classpath_entry_size * index;
 287     return (SharedClassPathEntry*)p;
 288   }
 289   static const char* shared_classpath_name(int index) {
 290     assert(index >= 0, "Sanity");
 291     return shared_classpath(index)->name();
 292   }
 293 
 294   static int get_number_of_share_classpaths() {
 295     return _classpath_entry_table_size;
 296   }






 297 };
 298 
 299 #endif // SHARE_VM_MEMORY_FILEMAP_HPP


 225   void set_cds_i2i_entry_code_buffers_size(size_t s) {
 226     _header->_cds_i2i_entry_code_buffers_size = s;
 227   }
 228   void set_core_spaces_size(size_t s)    {  _header->_core_spaces_size = s; }
 229   size_t core_spaces_size()              { return _header->_core_spaces_size; }
 230 
 231   static FileMapInfo* current_info() {
 232     CDS_ONLY(return _current_info;)
 233     NOT_CDS(return NULL;)
 234   }
 235 
 236   static void assert_mark(bool check);
 237 
 238   // File manipulation.
 239   bool  initialize() NOT_CDS_RETURN_(false);
 240   bool  open_for_read();
 241   void  open_for_write();
 242   void  write_header();
 243   void  write_region(int region, char* base, size_t size,
 244                      bool read_only, bool allow_exec);
 245   size_t write_archive_heap_regions(GrowableArray<MemRegion> *heap_mem,
 246                                     int first_region_id, int max_num_regions);

 247   void  write_bytes(const void* buffer, int count);
 248   void  write_bytes_aligned(const void* buffer, int count);
 249   char* map_region(int i);
 250   void  map_heap_regions() NOT_CDS_JAVA_HEAP_RETURN;
 251   void  fixup_mapped_heap_regions() NOT_CDS_JAVA_HEAP_RETURN;

 252   void  unmap_region(int i);

 253   bool  verify_region_checksum(int i);
 254   void  close();
 255   bool  is_open() { return _file_open; }
 256   ReservedSpace reserve_shared_memory();
 257 
 258   // JVM/TI RedefineClasses() support:
 259   // Remap the shared readonly space to shared readwrite, private.
 260   bool  remap_shared_readonly_as_readwrite();
 261 
 262   // Errors.
 263   static void fail_stop(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2);
 264   static void fail_continue(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2);
 265 
 266   // Return true if given address is in the mapped shared space.
 267   bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
 268   bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false);
 269   void print_shared_spaces() NOT_CDS_RETURN;
 270 
 271   // Stop CDS sharing and unmap CDS regions.
 272   static void stop_sharing_and_unmap(const char* msg);


 274   static void allocate_classpath_entry_table();
 275   bool validate_classpath_entry_table();
 276 
 277   static SharedClassPathEntry* shared_classpath(int index) {
 278     if (index < 0) {
 279       return NULL;
 280     }
 281     assert(index < _classpath_entry_table_size, "sanity");
 282     char* p = (char*)_classpath_entry_table->data();
 283     p += _classpath_entry_size * index;
 284     return (SharedClassPathEntry*)p;
 285   }
 286   static const char* shared_classpath_name(int index) {
 287     assert(index >= 0, "Sanity");
 288     return shared_classpath(index)->name();
 289   }
 290 
 291   static int get_number_of_share_classpaths() {
 292     return _classpath_entry_table_size;
 293   }
 294 
 295  private:
 296   bool  map_heap_data(MemRegion **heap_mem, int first, int max, int* num,
 297                       bool is_open = false) NOT_CDS_JAVA_HEAP_RETURN_(false);
 298   bool  verify_mapped_heap_regions(int first, int num) NOT_CDS_JAVA_HEAP_RETURN_(false);
 299   void  dealloc_archive_heap_regions(MemRegion* regions, int num) NOT_CDS_JAVA_HEAP_RETURN;
 300 };
 301 
 302 #endif // SHARE_VM_MEMORY_FILEMAP_HPP
< prev index next >