175 BitMapView ptrmap_view();
176 bool has_ptrmap() { return _ptrmap_size_in_bits != 0; }
177
178 bool check_region_crc() const;
179 void print(outputStream* st, int region_index);
180 };
181
182 class FileMapHeader: private CDSFileMapHeaderBase {
183 friend class CDSConstants;
184 friend class VMStructs;
185
186 private:
187 // The following fields record the states of the VM during dump time.
188 // They are compared with the runtime states to see if the archive
189 // can be used.
190 size_t _core_region_alignment; // how shared archive should be aligned
191 int _obj_alignment; // value of ObjectAlignmentInBytes
192 address _narrow_oop_base; // compressed oop encoding base
193 int _narrow_oop_shift; // compressed oop encoding shift
194 bool _compact_strings; // value of CompactStrings
195 uintx _max_heap_size; // java max heap size during dumping
196 CompressedOops::Mode _narrow_oop_mode; // compressed oop encoding mode
197 bool _compressed_oops; // save the flag UseCompressedOops
198 bool _compressed_class_ptrs; // save the flag UseCompressedClassPointers
199 size_t _cloned_vtables_offset; // The address of the first cloned vtable
200 size_t _serialized_data_offset; // Data accessed using {ReadClosure,WriteClosure}::serialize()
201 bool _has_non_jar_in_classpath; // non-jar file entry exists in classpath
202 unsigned int _common_app_classpath_prefix_size; // size of the common prefix of app class paths
203 // 0 if no common prefix exists
204
205 // The following fields are all sanity checks for whether this archive
206 // will function correctly with this JVM and the bootclasspath it's
207 // invoked with.
208 char _jvm_ident[JVM_IDENT_MAX]; // identifier string of the jvm that created this dump
209
210 // The following is a table of all the boot/app/module path entries that were used
211 // during dumping. At run time, we validate these entries according to their
212 // SharedClassPathEntry::_type. See:
213 // check_nonempty_dir_in_shared_path_table()
214 // validate_shared_path_table()
242 int crc() const { return _generic_header._crc; }
243 int version() const { return _generic_header._version; }
244 unsigned int header_size() const { return _generic_header._header_size; }
245 unsigned int base_archive_name_offset() const { return _generic_header._base_archive_name_offset; }
246 unsigned int base_archive_name_size() const { return _generic_header._base_archive_name_size; }
247 unsigned int common_app_classpath_prefix_size() const { return _common_app_classpath_prefix_size; }
248
249 void set_magic(unsigned int m) { _generic_header._magic = m; }
250 void set_crc(int crc_value) { _generic_header._crc = crc_value; }
251 void set_version(int v) { _generic_header._version = v; }
252 void set_header_size(unsigned int s) { _generic_header._header_size = s; }
253 void set_base_archive_name_offset(unsigned int s) { _generic_header._base_archive_name_offset = s; }
254 void set_base_archive_name_size(unsigned int s) { _generic_header._base_archive_name_size = s; }
255 void set_common_app_classpath_prefix_size(unsigned int s) { _common_app_classpath_prefix_size = s; }
256
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 uintx max_heap_size() const { return _max_heap_size; }
263 CompressedOops::Mode narrow_oop_mode() const { return _narrow_oop_mode; }
264 char* cloned_vtables() const { return from_mapped_offset(_cloned_vtables_offset); }
265 char* serialized_data() const { return from_mapped_offset(_serialized_data_offset); }
266 const char* jvm_ident() const { return _jvm_ident; }
267 char* requested_base_address() const { return _requested_base_address; }
268 char* mapped_base_address() const { return _mapped_base_address; }
269 bool has_platform_or_app_classes() const { return _has_platform_or_app_classes; }
270 bool has_non_jar_in_classpath() const { return _has_non_jar_in_classpath; }
271 size_t ptrmap_size_in_bits() const { return _ptrmap_size_in_bits; }
272 bool compressed_oops() const { return _compressed_oops; }
273 bool compressed_class_pointers() const { return _compressed_class_ptrs; }
274 size_t heap_roots_offset() const { return _heap_roots_offset; }
275 // FIXME: These should really return int
276 jshort max_used_path_index() const { return _max_used_path_index; }
277 jshort app_module_paths_start_index() const { return _app_module_paths_start_index; }
278 jshort app_class_paths_start_index() const { return _app_class_paths_start_index; }
279 jshort num_module_paths() const { return _num_module_paths; }
280
281 void set_has_platform_or_app_classes(bool v) { _has_platform_or_app_classes = v; }
|
175 BitMapView ptrmap_view();
176 bool has_ptrmap() { return _ptrmap_size_in_bits != 0; }
177
178 bool check_region_crc() const;
179 void print(outputStream* st, int region_index);
180 };
181
182 class FileMapHeader: private CDSFileMapHeaderBase {
183 friend class CDSConstants;
184 friend class VMStructs;
185
186 private:
187 // The following fields record the states of the VM during dump time.
188 // They are compared with the runtime states to see if the archive
189 // can be used.
190 size_t _core_region_alignment; // how shared archive should be aligned
191 int _obj_alignment; // value of ObjectAlignmentInBytes
192 address _narrow_oop_base; // compressed oop encoding base
193 int _narrow_oop_shift; // compressed oop encoding shift
194 bool _compact_strings; // value of CompactStrings
195 bool _compact_headers; // value of UseCompactObjectHeaders
196 uintx _max_heap_size; // java max heap size during dumping
197 CompressedOops::Mode _narrow_oop_mode; // compressed oop encoding mode
198 bool _compressed_oops; // save the flag UseCompressedOops
199 bool _compressed_class_ptrs; // save the flag UseCompressedClassPointers
200 size_t _cloned_vtables_offset; // The address of the first cloned vtable
201 size_t _serialized_data_offset; // Data accessed using {ReadClosure,WriteClosure}::serialize()
202 bool _has_non_jar_in_classpath; // non-jar file entry exists in classpath
203 unsigned int _common_app_classpath_prefix_size; // size of the common prefix of app class paths
204 // 0 if no common prefix exists
205
206 // The following fields are all sanity checks for whether this archive
207 // will function correctly with this JVM and the bootclasspath it's
208 // invoked with.
209 char _jvm_ident[JVM_IDENT_MAX]; // identifier string of the jvm that created this dump
210
211 // The following is a table of all the boot/app/module path entries that were used
212 // during dumping. At run time, we validate these entries according to their
213 // SharedClassPathEntry::_type. See:
214 // check_nonempty_dir_in_shared_path_table()
215 // validate_shared_path_table()
243 int crc() const { return _generic_header._crc; }
244 int version() const { return _generic_header._version; }
245 unsigned int header_size() const { return _generic_header._header_size; }
246 unsigned int base_archive_name_offset() const { return _generic_header._base_archive_name_offset; }
247 unsigned int base_archive_name_size() const { return _generic_header._base_archive_name_size; }
248 unsigned int common_app_classpath_prefix_size() const { return _common_app_classpath_prefix_size; }
249
250 void set_magic(unsigned int m) { _generic_header._magic = m; }
251 void set_crc(int crc_value) { _generic_header._crc = crc_value; }
252 void set_version(int v) { _generic_header._version = v; }
253 void set_header_size(unsigned int s) { _generic_header._header_size = s; }
254 void set_base_archive_name_offset(unsigned int s) { _generic_header._base_archive_name_offset = s; }
255 void set_base_archive_name_size(unsigned int s) { _generic_header._base_archive_name_size = s; }
256 void set_common_app_classpath_prefix_size(unsigned int s) { _common_app_classpath_prefix_size = s; }
257
258 size_t core_region_alignment() const { return _core_region_alignment; }
259 int obj_alignment() const { return _obj_alignment; }
260 address narrow_oop_base() const { return _narrow_oop_base; }
261 int narrow_oop_shift() const { return _narrow_oop_shift; }
262 bool compact_strings() const { return _compact_strings; }
263 bool compact_headers() const { return _compact_headers; }
264 uintx max_heap_size() const { return _max_heap_size; }
265 CompressedOops::Mode narrow_oop_mode() const { return _narrow_oop_mode; }
266 char* cloned_vtables() const { return from_mapped_offset(_cloned_vtables_offset); }
267 char* serialized_data() const { return from_mapped_offset(_serialized_data_offset); }
268 const char* jvm_ident() const { return _jvm_ident; }
269 char* requested_base_address() const { return _requested_base_address; }
270 char* mapped_base_address() const { return _mapped_base_address; }
271 bool has_platform_or_app_classes() const { return _has_platform_or_app_classes; }
272 bool has_non_jar_in_classpath() const { return _has_non_jar_in_classpath; }
273 size_t ptrmap_size_in_bits() const { return _ptrmap_size_in_bits; }
274 bool compressed_oops() const { return _compressed_oops; }
275 bool compressed_class_pointers() const { return _compressed_class_ptrs; }
276 size_t heap_roots_offset() const { return _heap_roots_offset; }
277 // FIXME: These should really return int
278 jshort max_used_path_index() const { return _max_used_path_index; }
279 jshort app_module_paths_start_index() const { return _app_module_paths_start_index; }
280 jshort app_class_paths_start_index() const { return _app_class_paths_start_index; }
281 jshort num_module_paths() const { return _num_module_paths; }
282
283 void set_has_platform_or_app_classes(bool v) { _has_platform_or_app_classes = v; }
|