78 VirtualSpace MetaspaceShared::_shared_vs; |
78 VirtualSpace MetaspaceShared::_shared_vs; |
79 MetaspaceSharedStats MetaspaceShared::_stats; |
79 MetaspaceSharedStats MetaspaceShared::_stats; |
80 bool MetaspaceShared::_has_error_classes; |
80 bool MetaspaceShared::_has_error_classes; |
81 bool MetaspaceShared::_archive_loading_failed = false; |
81 bool MetaspaceShared::_archive_loading_failed = false; |
82 bool MetaspaceShared::_remapped_readwrite = false; |
82 bool MetaspaceShared::_remapped_readwrite = false; |
83 address MetaspaceShared::_cds_i2i_entry_code_buffers = NULL; |
83 address MetaspaceShared::_i2i_entry_code_buffers = NULL; |
84 size_t MetaspaceShared::_cds_i2i_entry_code_buffers_size = 0; |
84 size_t MetaspaceShared::_i2i_entry_code_buffers_size = 0; |
85 size_t MetaspaceShared::_core_spaces_size = 0; |
85 size_t MetaspaceShared::_core_spaces_size = 0; |
86 void* MetaspaceShared::_shared_metaspace_static_top = NULL; |
86 void* MetaspaceShared::_shared_metaspace_static_top = NULL; |
87 |
87 |
88 // The CDS archive is divided into the following regions: |
88 // The CDS archive is divided into the following regions: |
89 // mc - misc code (the method entry trampolines) |
89 // mc - misc code (the method entry trampolines) |
354 if (UseSharedSpaces) { |
354 if (UseSharedSpaces) { |
355 int size = FileMapInfo::get_number_of_shared_paths(); |
355 int size = FileMapInfo::get_number_of_shared_paths(); |
356 if (size > 0) { |
356 if (size > 0) { |
357 SystemDictionaryShared::allocate_shared_data_arrays(size, THREAD); |
357 SystemDictionaryShared::allocate_shared_data_arrays(size, THREAD); |
358 if (!DynamicDumpSharedSpaces) { |
358 if (!DynamicDumpSharedSpaces) { |
359 FileMapHeader* header; |
359 FileMapInfo* info; |
360 if (FileMapInfo::dynamic_info() == NULL) { |
360 if (FileMapInfo::dynamic_info() == NULL) { |
361 header = FileMapInfo::current_info()->header(); |
361 info = FileMapInfo::current_info(); |
362 } else { |
362 } else { |
363 header = FileMapInfo::dynamic_info()->header(); |
363 info = FileMapInfo::dynamic_info(); |
364 } |
364 } |
365 ClassLoaderExt::init_paths_start_index(header->_app_class_paths_start_index); |
365 ClassLoaderExt::init_paths_start_index(info->app_class_paths_start_index()); |
366 ClassLoaderExt::init_app_module_paths_start_index(header->_app_module_paths_start_index); |
366 ClassLoaderExt::init_app_module_paths_start_index(info->app_module_paths_start_index()); |
367 } |
367 } |
368 } |
368 } |
369 } |
369 } |
370 } |
370 } |
371 |
371 |
490 soc->do_tag(--tag); |
490 soc->do_tag(--tag); |
491 |
491 |
492 soc->do_tag(666); |
492 soc->do_tag(666); |
493 } |
493 } |
494 |
494 |
495 address MetaspaceShared::cds_i2i_entry_code_buffers(size_t total_size) { |
495 address MetaspaceShared::i2i_entry_code_buffers(size_t total_size) { |
496 if (DumpSharedSpaces) { |
496 if (DumpSharedSpaces) { |
497 if (_cds_i2i_entry_code_buffers == NULL) { |
497 if (_i2i_entry_code_buffers == NULL) { |
498 _cds_i2i_entry_code_buffers = (address)misc_code_space_alloc(total_size); |
498 _i2i_entry_code_buffers = (address)misc_code_space_alloc(total_size); |
499 _cds_i2i_entry_code_buffers_size = total_size; |
499 _i2i_entry_code_buffers_size = total_size; |
500 } |
500 } |
501 } else if (UseSharedSpaces) { |
501 } else if (UseSharedSpaces) { |
502 assert(_cds_i2i_entry_code_buffers != NULL, "must already been initialized"); |
502 assert(_i2i_entry_code_buffers != NULL, "must already been initialized"); |
503 } else { |
503 } else { |
504 return NULL; |
504 return NULL; |
505 } |
505 } |
506 |
506 |
507 assert(_cds_i2i_entry_code_buffers_size == total_size, "must not change"); |
507 assert(_i2i_entry_code_buffers_size == total_size, "must not change"); |
508 return _cds_i2i_entry_code_buffers; |
508 return _i2i_entry_code_buffers; |
509 } |
509 } |
510 |
510 |
511 uintx MetaspaceShared::object_delta_uintx(void* obj) { |
511 uintx MetaspaceShared::object_delta_uintx(void* obj) { |
512 assert(DumpSharedSpaces || DynamicDumpSharedSpaces, |
512 assert(DumpSharedSpaces || DynamicDumpSharedSpaces, |
513 "supported only for dumping"); |
513 "supported only for dumping"); |
1543 |
1543 |
1544 FileMapInfo* mapinfo = new FileMapInfo(true); |
1544 FileMapInfo* mapinfo = new FileMapInfo(true); |
1545 mapinfo->populate_header(os::vm_allocation_granularity()); |
1545 mapinfo->populate_header(os::vm_allocation_granularity()); |
1546 mapinfo->set_read_only_tables_start(read_only_tables_start); |
1546 mapinfo->set_read_only_tables_start(read_only_tables_start); |
1547 mapinfo->set_misc_data_patching_start(vtbl_list); |
1547 mapinfo->set_misc_data_patching_start(vtbl_list); |
1548 mapinfo->set_cds_i2i_entry_code_buffers(MetaspaceShared::cds_i2i_entry_code_buffers()); |
1548 mapinfo->set_i2i_entry_code_buffers(MetaspaceShared::i2i_entry_code_buffers(), |
1549 mapinfo->set_cds_i2i_entry_code_buffers_size(MetaspaceShared::cds_i2i_entry_code_buffers_size()); |
1549 MetaspaceShared::i2i_entry_code_buffers_size()); |
1550 mapinfo->set_core_spaces_size(core_spaces_size); |
1550 mapinfo->set_core_spaces_size(core_spaces_size); |
1551 |
1551 |
1552 for (int pass=1; pass<=2; pass++) { |
1552 for (int pass=1; pass<=2; pass++) { |
1553 bool print_archive_log = (pass==1); |
1553 bool print_archive_log = (pass==1); |
1554 if (pass == 1) { |
1554 if (pass == 1) { |
2041 // Read the miscellaneous data from the shared file, and |
2041 // Read the miscellaneous data from the shared file, and |
2042 // serialize it out to its various destinations. |
2042 // serialize it out to its various destinations. |
2043 |
2043 |
2044 void MetaspaceShared::initialize_shared_spaces() { |
2044 void MetaspaceShared::initialize_shared_spaces() { |
2045 FileMapInfo *mapinfo = FileMapInfo::current_info(); |
2045 FileMapInfo *mapinfo = FileMapInfo::current_info(); |
2046 _cds_i2i_entry_code_buffers = mapinfo->cds_i2i_entry_code_buffers(); |
2046 _i2i_entry_code_buffers = mapinfo->i2i_entry_code_buffers(); |
2047 _cds_i2i_entry_code_buffers_size = mapinfo->cds_i2i_entry_code_buffers_size(); |
2047 _i2i_entry_code_buffers_size = mapinfo->i2i_entry_code_buffers_size(); |
2048 // _core_spaces_size is loaded from the shared archive immediatelly after mapping |
2048 // _core_spaces_size is loaded from the shared archive immediatelly after mapping |
2049 assert(_core_spaces_size == mapinfo->core_spaces_size(), "sanity"); |
2049 assert(_core_spaces_size == mapinfo->core_spaces_size(), "sanity"); |
2050 char* buffer = mapinfo->misc_data_patching_start(); |
2050 char* buffer = mapinfo->misc_data_patching_start(); |
2051 clone_cpp_vtables((intptr_t*)buffer); |
2051 clone_cpp_vtables((intptr_t*)buffer); |
2052 |
2052 |