Skip to content

Commit 35bfbfd

Browse files
committed
8231278: Rename FileMapHeader::_read_only_tables_start to _serialized_data_start
Reviewed-by: ccheung
1 parent 7c2de83 commit 35bfbfd

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

src/hotspot/share/memory/dynamicArchive.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ class DynamicArchiveBuilder : ResourceObj {
470470
void sort_methods(InstanceKlass* ik) const;
471471
void set_symbols_permanent();
472472
void relocate_buffer_to_target();
473-
void write_archive(char* read_only_tables_start);
473+
void write_archive(char* serialized_data_start);
474474
void write_regions(FileMapInfo* dynamic_info);
475475

476476
void init_first_dump_space(address reserved_bottom) {
@@ -596,7 +596,7 @@ class DynamicArchiveBuilder : ResourceObj {
596596

597597
verify_estimate_size(_estimated_metsapceobj_bytes, "MetaspaceObjs");
598598

599-
char* read_only_tables_start;
599+
char* serialized_data_start;
600600
{
601601
set_symbols_permanent();
602602

@@ -609,7 +609,7 @@ class DynamicArchiveBuilder : ResourceObj {
609609
SymbolTable::write_to_archive(false);
610610
SystemDictionaryShared::write_to_archive(false);
611611

612-
read_only_tables_start = ro_space->top();
612+
serialized_data_start = ro_space->top();
613613
WriteClosure wc(ro_space);
614614
SymbolTable::serialize_shared_table_header(&wc, false);
615615
SystemDictionaryShared::serialize_dictionary_headers(&wc, false);
@@ -635,7 +635,7 @@ class DynamicArchiveBuilder : ResourceObj {
635635
relocate_buffer_to_target();
636636
}
637637

638-
write_archive(read_only_tables_start);
638+
write_archive(serialized_data_start);
639639

640640
assert(_num_dump_regions_used == _total_dump_regions, "must be");
641641
verify_universe("After CDS dynamic dump");
@@ -927,11 +927,11 @@ void DynamicArchiveBuilder::write_regions(FileMapInfo* dynamic_info) {
927927
/*read_only=*/false,/*allow_exec=*/true);
928928
}
929929

930-
void DynamicArchiveBuilder::write_archive(char* read_only_tables_start) {
930+
void DynamicArchiveBuilder::write_archive(char* serialized_data_start) {
931931
int num_klasses = _klasses->length();
932932
int num_symbols = _symbols->length();
933933

934-
_header->set_read_only_tables_start(to_target(read_only_tables_start));
934+
_header->set_serialized_data_start(to_target(serialized_data_start));
935935

936936
FileMapInfo* dynamic_info = FileMapInfo::dynamic_info();
937937
assert(dynamic_info != NULL, "Sanity");
@@ -1102,7 +1102,7 @@ address DynamicArchive::map_impl(FileMapInfo* mapinfo) {
11021102
return NULL;
11031103
}
11041104

1105-
intptr_t* buffer = (intptr_t*)_dynamic_header->read_only_tables_start();
1105+
intptr_t* buffer = (intptr_t*)_dynamic_header->serialized_data_start();
11061106
ReadClosure rc(&buffer);
11071107
SymbolTable::serialize_shared_table_header(&rc, false);
11081108
SystemDictionaryShared::serialize_dictionary_headers(&rc, false);

src/hotspot/share/memory/filemap.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,8 @@ class FileMapHeader: private CDSFileMapHeaderBase {
179179
CompressedOops::Mode _narrow_oop_mode; // compressed oop encoding mode
180180
int _narrow_klass_shift; // save narrow klass base and shift
181181
address _narrow_klass_base;
182-
183-
184182
char* _misc_data_patching_start;
185-
char* _read_only_tables_start;
183+
char* _serialized_data_start; // Data accessed using {ReadClosure,WriteClosure}::serialize()
186184
address _i2i_entry_code_buffers;
187185
size_t _i2i_entry_code_buffers_size;
188186
size_t _core_spaces_size; // number of bytes allocated by the core spaces
@@ -238,7 +236,7 @@ class FileMapHeader: private CDSFileMapHeaderBase {
238236
int narrow_klass_shift() const { return _narrow_klass_shift; }
239237
address narrow_klass_base() const { return _narrow_klass_base; }
240238
char* misc_data_patching_start() const { return _misc_data_patching_start; }
241-
char* read_only_tables_start() const { return _read_only_tables_start; }
239+
char* serialized_data_start() const { return _serialized_data_start; }
242240
address i2i_entry_code_buffers() const { return _i2i_entry_code_buffers; }
243241
size_t i2i_entry_code_buffers_size() const { return _i2i_entry_code_buffers_size; }
244242
size_t core_spaces_size() const { return _core_spaces_size; }
@@ -259,7 +257,7 @@ class FileMapHeader: private CDSFileMapHeaderBase {
259257
void set_core_spaces_size(size_t s) { _core_spaces_size = s; }
260258
void set_has_platform_or_app_classes(bool v) { _has_platform_or_app_classes = v; }
261259
void set_misc_data_patching_start(char* p) { _misc_data_patching_start = p; }
262-
void set_read_only_tables_start(char* p) { _read_only_tables_start = p; }
260+
void set_serialized_data_start(char* p) { _serialized_data_start = p; }
263261
void set_base_archive_name_size(size_t s) { _base_archive_name_size = s; }
264262
void set_base_archive_is_default(bool b) { _base_archive_is_default = b; }
265263
void set_header_size(size_t s) { _header_size = s; }
@@ -360,8 +358,8 @@ class FileMapInfo : public CHeapObj<mtInternal> {
360358

361359
char* misc_data_patching_start() const { return header()->misc_data_patching_start(); }
362360
void set_misc_data_patching_start(char* p) const { header()->set_misc_data_patching_start(p); }
363-
char* read_only_tables_start() const { return header()->read_only_tables_start(); }
364-
void set_read_only_tables_start(char* p) const { header()->set_read_only_tables_start(p); }
361+
char* serialized_data_start() const { return header()->serialized_data_start(); }
362+
void set_serialized_data_start(char* p) const { header()->set_serialized_data_start(p); }
365363

366364
bool is_file_position_aligned() const;
367365
void align_file_position();

src/hotspot/share/memory/metaspaceShared.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,12 +1427,11 @@ char* VM_PopulateDumpSharedSpace::dump_read_only_tables() {
14271427

14281428
SystemDictionaryShared::write_to_archive();
14291429

1430-
char* start = _ro_region.top();
1431-
14321430
size_t vtptrs_bytes = _num_cloned_vtable_kinds * sizeof(intptr_t*);
14331431
_cloned_cpp_vtptrs = (intptr_t**)_ro_region.allocate(vtptrs_bytes, sizeof(intptr_t*));
14341432

14351433
// Write the other data to the output array.
1434+
char* start = _ro_region.top();
14361435
WriteClosure wc(&_ro_region);
14371436
MetaspaceShared::serialize(&wc);
14381437

@@ -1515,7 +1514,7 @@ void VM_PopulateDumpSharedSpace::doit() {
15151514

15161515
ArchiveCompactor::relocate_well_known_klasses();
15171516

1518-
char* read_only_tables_start = dump_read_only_tables();
1517+
char* serialized_data_start = dump_read_only_tables();
15191518
_ro_region.pack(&_md_region);
15201519

15211520
char* vtbl_list = _md_region.top();
@@ -1540,7 +1539,7 @@ void VM_PopulateDumpSharedSpace::doit() {
15401539

15411540
FileMapInfo* mapinfo = new FileMapInfo(true);
15421541
mapinfo->populate_header(os::vm_allocation_granularity());
1543-
mapinfo->set_read_only_tables_start(read_only_tables_start);
1542+
mapinfo->set_serialized_data_start(serialized_data_start);
15441543
mapinfo->set_misc_data_patching_start(vtbl_list);
15451544
mapinfo->set_i2i_entry_code_buffers(MetaspaceShared::i2i_entry_code_buffers(),
15461545
MetaspaceShared::i2i_entry_code_buffers_size());
@@ -2033,14 +2032,9 @@ void MetaspaceShared::initialize_shared_spaces() {
20332032
char* buffer = mapinfo->misc_data_patching_start();
20342033
clone_cpp_vtables((intptr_t*)buffer);
20352034

2036-
// The rest of the data is now stored in the RW region
2037-
buffer = mapinfo->read_only_tables_start();
2038-
2039-
// Skip over _cloned_cpp_vtptrs;
2040-
buffer += _num_cloned_vtable_kinds * sizeof(intptr_t*);
2041-
20422035
// Verify various attributes of the archive, plus initialize the
20432036
// shared string/symbol tables
2037+
buffer = mapinfo->serialized_data_start();
20442038
intptr_t* array = (intptr_t*)buffer;
20452039
ReadClosure rc(&array);
20462040
serialize(&rc);

0 commit comments

Comments
 (0)