@@ -196,7 +196,7 @@ void FileMapInfo::populate_header(size_t core_region_alignment) {
196
196
size_t c_header_size;
197
197
size_t header_size;
198
198
size_t base_archive_name_size = 0 ;
199
- size_t base_archive_path_offset = 0 ;
199
+ size_t base_archive_name_offset = 0 ;
200
200
if (is_static ()) {
201
201
c_header_size = sizeof (FileMapHeader);
202
202
header_size = c_header_size;
@@ -207,7 +207,7 @@ void FileMapInfo::populate_header(size_t core_region_alignment) {
207
207
if (!FLAG_IS_DEFAULT (SharedArchiveFile)) {
208
208
base_archive_name_size = strlen (Arguments::GetSharedArchivePath ()) + 1 ;
209
209
header_size += base_archive_name_size;
210
- base_archive_path_offset = c_header_size;
210
+ base_archive_name_offset = c_header_size;
211
211
}
212
212
}
213
213
_header = (FileMapHeader*)os::malloc (header_size, mtInternal);
@@ -216,17 +216,17 @@ void FileMapInfo::populate_header(size_t core_region_alignment) {
216
216
core_region_alignment,
217
217
header_size,
218
218
base_archive_name_size,
219
- base_archive_path_offset );
219
+ base_archive_name_offset );
220
220
}
221
221
222
222
void FileMapHeader::populate (FileMapInfo *info, size_t core_region_alignment,
223
223
size_t header_size, size_t base_archive_name_size,
224
- size_t base_archive_path_offset ) {
224
+ size_t base_archive_name_offset ) {
225
225
// 1. We require _generic_header._magic to be at the beginning of the file
226
226
// 2. FileMapHeader also assumes that _generic_header is at the beginning of the file
227
227
assert (offset_of (FileMapHeader, _generic_header) == 0 , " must be" );
228
228
set_header_size ((unsigned int )header_size);
229
- set_base_archive_path_offset ((unsigned int )base_archive_path_offset );
229
+ set_base_archive_name_offset ((unsigned int )base_archive_name_offset );
230
230
set_base_archive_name_size ((unsigned int )base_archive_name_size);
231
231
set_magic (DynamicDumpSharedSpaces ? CDS_DYNAMIC_ARCHIVE_MAGIC : CDS_ARCHIVE_MAGIC);
232
232
set_version (CURRENT_CDS_ARCHIVE_VERSION);
@@ -280,9 +280,9 @@ void FileMapHeader::populate(FileMapInfo *info, size_t core_region_alignment,
280
280
281
281
void FileMapHeader::copy_base_archive_name (const char * archive) {
282
282
assert (base_archive_name_size () != 0 , " _base_archive_name_size not set" );
283
- assert (base_archive_path_offset () != 0 , " _base_archive_path_offset not set" );
283
+ assert (base_archive_name_offset () != 0 , " _base_archive_name_offset not set" );
284
284
assert (header_size () > sizeof (*this ), " _base_archive_name_size not included in header size?" );
285
- memcpy ((char *)this + base_archive_path_offset (), archive, base_archive_name_size ());
285
+ memcpy ((char *)this + base_archive_name_offset (), archive, base_archive_name_size ());
286
286
}
287
287
288
288
void FileMapHeader::print (outputStream* st) {
@@ -292,7 +292,7 @@ void FileMapHeader::print(outputStream* st) {
292
292
st->print_cr (" - crc: 0x%08x" , crc ());
293
293
st->print_cr (" - version: %d" , version ());
294
294
st->print_cr (" - header_size: " UINT32_FORMAT, header_size ());
295
- st->print_cr (" - base_archive_path_offset : " UINT32_FORMAT, base_archive_path_offset ());
295
+ st->print_cr (" - base_archive_name_offset : " UINT32_FORMAT, base_archive_name_offset ());
296
296
st->print_cr (" - base_archive_name_size: " UINT32_FORMAT, base_archive_name_size ());
297
297
298
298
for (int i = 0 ; i < NUM_CDS_REGIONS; i++) {
@@ -1088,7 +1088,7 @@ class FileHeaderHelper {
1088
1088
size_t name_size = _header._base_archive_name_size ;
1089
1089
assert (name_size != 0 , " For non-default base archive, name size should be non-zero!" );
1090
1090
char * base_name = NEW_C_HEAP_ARRAY (char , name_size, mtInternal);
1091
- lseek (_fd, _header._base_archive_path_offset , SEEK_SET); // position to correct offset.
1091
+ lseek (_fd, _header._base_archive_name_offset , SEEK_SET); // position to correct offset.
1092
1092
size_t n = os::read (_fd, base_name, (unsigned int )name_size);
1093
1093
if (n != name_size) {
1094
1094
log_info (cds)(" Unable to read base archive name from archive" );
@@ -1124,9 +1124,9 @@ bool FileMapInfo::check_archive(const char* archive_name, bool is_static) {
1124
1124
vm_exit_during_initialization (" Not a base shared archive" , archive_name);
1125
1125
return false ;
1126
1126
}
1127
- if (header->_base_archive_path_offset != 0 ) {
1128
- log_info (cds)(" _base_archive_path_offset should be 0" );
1129
- log_info (cds)(" _base_archive_path_offset = " UINT32_FORMAT, header->_base_archive_path_offset );
1127
+ if (header->_base_archive_name_offset != 0 ) {
1128
+ log_info (cds)(" _base_archive_name_offset should be 0" );
1129
+ log_info (cds)(" _base_archive_name_offset = " UINT32_FORMAT, header->_base_archive_name_offset );
1130
1130
return false ;
1131
1131
}
1132
1132
} else {
@@ -1135,12 +1135,12 @@ bool FileMapInfo::check_archive(const char* archive_name, bool is_static) {
1135
1135
return false ;
1136
1136
}
1137
1137
unsigned int name_size = header->_base_archive_name_size ;
1138
- unsigned int path_offset = header->_base_archive_path_offset ;
1138
+ unsigned int name_offset = header->_base_archive_name_offset ;
1139
1139
unsigned int header_size = header->_header_size ;
1140
- if (path_offset + name_size != header_size) {
1141
- log_info (cds)(" _header_size should be equal to _base_archive_path_offset plus _base_archive_name_size" );
1140
+ if (name_offset + name_size != header_size) {
1141
+ log_info (cds)(" _header_size should be equal to _base_archive_name_offset plus _base_archive_name_size" );
1142
1142
log_info (cds)(" _base_archive_name_size = " UINT32_FORMAT, name_size);
1143
- log_info (cds)(" _base_archive_path_offset = " UINT32_FORMAT, path_offset );
1143
+ log_info (cds)(" _base_archive_name_offset = " UINT32_FORMAT, name_offset );
1144
1144
log_info (cds)(" _header_size = " UINT32_FORMAT, header_size);
1145
1145
return false ;
1146
1146
}
@@ -1165,13 +1165,13 @@ bool FileMapInfo::get_base_archive_name_from_header(const char* archive_name,
1165
1165
return false ;
1166
1166
}
1167
1167
1168
- if ((header->_base_archive_name_size == 0 && header->_base_archive_path_offset != 0 ) ||
1169
- (header->_base_archive_name_size != 0 && header->_base_archive_path_offset == 0 )) {
1168
+ if ((header->_base_archive_name_size == 0 && header->_base_archive_name_offset != 0 ) ||
1169
+ (header->_base_archive_name_size != 0 && header->_base_archive_name_offset == 0 )) {
1170
1170
fail_continue (" Default base archive not set correct" );
1171
1171
return false ;
1172
1172
}
1173
1173
if (header->_base_archive_name_size == 0 &&
1174
- header->_base_archive_path_offset == 0 ) {
1174
+ header->_base_archive_name_offset == 0 ) {
1175
1175
*base_archive_name = Arguments::get_default_shared_archive_path ();
1176
1176
} else {
1177
1177
// read the base archive name
@@ -1217,14 +1217,14 @@ bool FileMapInfo::init_from_file(int fd) {
1217
1217
return false ;
1218
1218
}
1219
1219
1220
- unsigned int base_offset = header ()->base_archive_path_offset ();
1220
+ unsigned int base_offset = header ()->base_archive_name_offset ();
1221
1221
unsigned int name_size = header ()->base_archive_name_size ();
1222
1222
unsigned int header_size = header ()->header_size ();
1223
1223
if (base_offset != 0 && name_size != 0 ) {
1224
1224
if (header_size != base_offset + name_size) {
1225
1225
log_info (cds)(" _header_size: " UINT32_FORMAT, header_size);
1226
1226
log_info (cds)(" base_archive_name_size: " UINT32_FORMAT, name_size);
1227
- log_info (cds)(" base_archive_path_offset : " UINT32_FORMAT, base_offset);
1227
+ log_info (cds)(" base_archive_name_offset : " UINT32_FORMAT, base_offset);
1228
1228
FileMapInfo::fail_continue (" The shared archive file has an incorrect header size." );
1229
1229
return false ;
1230
1230
}
0 commit comments