176 _oopmap_size_in_bits = size_in_bits;
177 }
178
179 void print(outputStream* st, int region_index);
180 };
181
182 class FileMapHeader: private CDSFileMapHeaderBase {
183 friend class CDSOffsets;
184 friend class VMStructs;
185
186 size_t _header_size;
187
188 // The following fields record the states of the VM during dump time.
189 // They are compared with the runtime states to see if the archive
190 // can be used.
191 size_t _core_region_alignment; // how shared archive should be aligned
192 int _obj_alignment; // value of ObjectAlignmentInBytes
193 address _narrow_oop_base; // compressed oop encoding base
194 int _narrow_oop_shift; // compressed oop encoding shift
195 bool _compact_strings; // value of CompactStrings
196 uintx _max_heap_size; // java max heap size during dumping
197 CompressedOops::Mode _narrow_oop_mode; // compressed oop encoding mode
198 int _narrow_klass_shift; // save narrow klass base and shift
199 bool _compressed_oops; // save the flag UseCompressedOops
200 bool _compressed_class_ptrs; // save the flag UseCompressedClassPointers
201 size_t _cloned_vtables_offset; // The address of the first cloned vtable
202 size_t _serialized_data_offset; // Data accessed using {ReadClosure,WriteClosure}::serialize()
203 address _heap_begin; // heap begin at dump time.
204 address _heap_end; // heap end at dump time.
205 bool _base_archive_is_default; // indicates if the base archive is the system default one
206
207 // The following fields are all sanity checks for whether this archive
208 // will function correctly with this JVM and the bootclasspath it's
209 // invoked with.
210 char _jvm_ident[JVM_IDENT_MAX]; // identifier string of the jvm that created this dump
211
212 // size of the base archive name including NULL terminator
213 size_t _base_archive_name_size;
214
215 // The following is a table of all the boot/app/module path entries that were used
241 return mapped_base_address() + offset;
242 }
243 void set_as_offset(char* p, size_t *offset);
244 public:
245 // Accessors -- fields declared in CDSFileMapHeaderBase
246 unsigned int magic() const { return _magic; }
247 int crc() const { return _crc; }
248 int version() const { return _version; }
249
250 void set_crc(int crc_value) { _crc = crc_value; }
251 void set_version(int v) { _version = v; }
252
253 // Accessors -- fields declared in FileMapHeader
254
255 size_t header_size() const { return _header_size; }
256 size_t core_region_alignment() const { return _core_region_alignment; }
257 int obj_alignment() const { return _obj_alignment; }
258 address narrow_oop_base() const { return _narrow_oop_base; }
259 int narrow_oop_shift() const { return _narrow_oop_shift; }
260 bool compact_strings() const { return _compact_strings; }
261 uintx max_heap_size() const { return _max_heap_size; }
262 CompressedOops::Mode narrow_oop_mode() const { return _narrow_oop_mode; }
263 int narrow_klass_shift() const { return _narrow_klass_shift; }
264 address narrow_klass_base() const { return (address)mapped_base_address(); }
265 char* cloned_vtables() const { return from_mapped_offset(_cloned_vtables_offset); }
266 char* serialized_data() const { return from_mapped_offset(_serialized_data_offset); }
267 address heap_begin() const { return _heap_begin; }
268 address heap_end() const { return _heap_end; }
269 bool base_archive_is_default() const { return _base_archive_is_default; }
270 const char* jvm_ident() const { return _jvm_ident; }
271 size_t base_archive_name_size() const { return _base_archive_name_size; }
272 char* requested_base_address() const { return _requested_base_address; }
273 char* mapped_base_address() const { return _mapped_base_address; }
274 bool has_platform_or_app_classes() const { return _has_platform_or_app_classes; }
275 size_t ptrmap_size_in_bits() const { return _ptrmap_size_in_bits; }
276 bool compressed_oops() const { return _compressed_oops; }
277 bool compressed_class_pointers() const { return _compressed_class_ptrs; }
278 // FIXME: These should really return int
279 jshort max_used_path_index() const { return _max_used_path_index; }
280 jshort app_module_paths_start_index() const { return _app_module_paths_start_index; }
|
176 _oopmap_size_in_bits = size_in_bits;
177 }
178
179 void print(outputStream* st, int region_index);
180 };
181
182 class FileMapHeader: private CDSFileMapHeaderBase {
183 friend class CDSOffsets;
184 friend class VMStructs;
185
186 size_t _header_size;
187
188 // The following fields record the states of the VM during dump time.
189 // They are compared with the runtime states to see if the archive
190 // can be used.
191 size_t _core_region_alignment; // how shared archive should be aligned
192 int _obj_alignment; // value of ObjectAlignmentInBytes
193 address _narrow_oop_base; // compressed oop encoding base
194 int _narrow_oop_shift; // compressed oop encoding shift
195 bool _compact_strings; // value of CompactStrings
196 bool _compact_headers; // value of UseCompactObjectHeaders
197 uintx _max_heap_size; // java max heap size during dumping
198 CompressedOops::Mode _narrow_oop_mode; // compressed oop encoding mode
199 int _narrow_klass_shift; // save narrow klass base and shift
200 bool _compressed_oops; // save the flag UseCompressedOops
201 bool _compressed_class_ptrs; // save the flag UseCompressedClassPointers
202 size_t _cloned_vtables_offset; // The address of the first cloned vtable
203 size_t _serialized_data_offset; // Data accessed using {ReadClosure,WriteClosure}::serialize()
204 address _heap_begin; // heap begin at dump time.
205 address _heap_end; // heap end at dump time.
206 bool _base_archive_is_default; // indicates if the base archive is the system default one
207
208 // The following fields are all sanity checks for whether this archive
209 // will function correctly with this JVM and the bootclasspath it's
210 // invoked with.
211 char _jvm_ident[JVM_IDENT_MAX]; // identifier string of the jvm that created this dump
212
213 // size of the base archive name including NULL terminator
214 size_t _base_archive_name_size;
215
216 // The following is a table of all the boot/app/module path entries that were used
242 return mapped_base_address() + offset;
243 }
244 void set_as_offset(char* p, size_t *offset);
245 public:
246 // Accessors -- fields declared in CDSFileMapHeaderBase
247 unsigned int magic() const { return _magic; }
248 int crc() const { return _crc; }
249 int version() const { return _version; }
250
251 void set_crc(int crc_value) { _crc = crc_value; }
252 void set_version(int v) { _version = v; }
253
254 // Accessors -- fields declared in FileMapHeader
255
256 size_t header_size() const { return _header_size; }
257 size_t core_region_alignment() const { return _core_region_alignment; }
258 int obj_alignment() const { return _obj_alignment; }
259 address narrow_oop_base() const { return _narrow_oop_base; }
260 int narrow_oop_shift() const { return _narrow_oop_shift; }
261 bool compact_strings() const { return _compact_strings; }
262 bool compact_headers() const { return _compact_headers; }
263 uintx max_heap_size() const { return _max_heap_size; }
264 CompressedOops::Mode narrow_oop_mode() const { return _narrow_oop_mode; }
265 int narrow_klass_shift() const { return _narrow_klass_shift; }
266 address narrow_klass_base() const { return (address)mapped_base_address(); }
267 char* cloned_vtables() const { return from_mapped_offset(_cloned_vtables_offset); }
268 char* serialized_data() const { return from_mapped_offset(_serialized_data_offset); }
269 address heap_begin() const { return _heap_begin; }
270 address heap_end() const { return _heap_end; }
271 bool base_archive_is_default() const { return _base_archive_is_default; }
272 const char* jvm_ident() const { return _jvm_ident; }
273 size_t base_archive_name_size() const { return _base_archive_name_size; }
274 char* requested_base_address() const { return _requested_base_address; }
275 char* mapped_base_address() const { return _mapped_base_address; }
276 bool has_platform_or_app_classes() const { return _has_platform_or_app_classes; }
277 size_t ptrmap_size_in_bits() const { return _ptrmap_size_in_bits; }
278 bool compressed_oops() const { return _compressed_oops; }
279 bool compressed_class_pointers() const { return _compressed_class_ptrs; }
280 // FIXME: These should really return int
281 jshort max_used_path_index() const { return _max_used_path_index; }
282 jshort app_module_paths_start_index() const { return _app_module_paths_start_index; }
|