127 narrowPtr _early_serialized_data; // Data accessed using {ReadClosure,WriteClosure}::serialize()
128 narrowPtr _serialized_data; // Data accessed using {ReadClosure,WriteClosure}::serialize()
129
130 // The following fields are all sanity checks for whether this archive
131 // will function correctly with this JVM and the bootclasspath it's
132 // invoked with.
133 char _jvm_ident[JVM_IDENT_MAX]; // identifier string of the jvm that created this dump
134
135 narrowPtr _class_location_config;
136
137 bool _verify_local; // BytecodeVerificationLocal setting
138 bool _verify_remote; // BytecodeVerificationRemote setting
139 bool _has_platform_or_app_classes; // Archive contains app or platform classes
140 char* _requested_base_address; // Archive relocation is not necessary if we map with this base address.
141 char* _mapped_base_address; // Actual base address where archive is mapped.
142
143 bool _use_optimized_module_handling;// No module-relation VM options were specified, so we can skip
144 // some expensive operations.
145 bool _has_aot_linked_classes; // Was the CDS archive created with -XX:+AOTClassLinking
146 bool _has_full_module_graph; // Does this CDS archive contain the full archived module graph?
147 size_t _rw_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the rw region
148 size_t _ro_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the ro region
149
150 AOTMappedHeapHeader _mapped_heap_header;
151 AOTStreamedHeapHeader _streamed_heap_header;
152
153 // The following are parameters that affect MethodData layout.
154 u1 _compiler_type;
155 uint _type_profile_level;
156 int _type_profile_args_limit;
157 int _type_profile_parms_limit;
158 intx _type_profile_width;
159 intx _bci_profile_width;
160 bool _profile_traps;
161 bool _type_profile_casts;
162 int _spec_trap_limit_extra_entries;
163
164 template <typename T> T decode(narrowPtr narrowp) const {
165 return AOTCompressedPointers::decode_not_null<T>(narrowp, reinterpret_cast<address>(mapped_base_address()));
166 }
182 void set_base_archive_name_size(unsigned int s) { _generic_header._base_archive_name_size = s; }
183
184 bool is_static() const { return magic() == CDS_ARCHIVE_MAGIC; }
185 size_t core_region_alignment() const { return _core_region_alignment; }
186 int obj_alignment() const { return _obj_alignment; }
187 address narrow_oop_base() const { return _narrow_oop_base; }
188 int narrow_oop_shift() const { return _narrow_oop_shift; }
189 bool compact_strings() const { return _compact_strings; }
190 bool compact_headers() const { return _compact_headers; }
191 uintx max_heap_size() const { return _max_heap_size; }
192 CompressedOops::Mode narrow_oop_mode() const { return _narrow_oop_mode; }
193 char* cloned_vtables() const { return decode<char*>(_cloned_vtables); }
194 char* early_serialized_data() const { return decode<char*>(_early_serialized_data); }
195 char* serialized_data() const { return decode<char*>(_serialized_data); }
196 bool object_streaming_mode() const { return _object_streaming_mode; }
197 const char* jvm_ident() const { return _jvm_ident; }
198 char* requested_base_address() const { return _requested_base_address; }
199 char* mapped_base_address() const { return _mapped_base_address; }
200 bool has_platform_or_app_classes() const { return _has_platform_or_app_classes; }
201 bool has_aot_linked_classes() const { return _has_aot_linked_classes; }
202 bool compressed_oops() const { return _compressed_oops; }
203 bool compressed_class_pointers() const { return _compressed_class_ptrs; }
204 int narrow_klass_pointer_bits() const { return _narrow_klass_pointer_bits; }
205 int narrow_klass_shift() const { return _narrow_klass_shift; }
206 bool has_full_module_graph() const { return _has_full_module_graph; }
207 size_t rw_ptrmap_start_pos() const { return _rw_ptrmap_start_pos; }
208 size_t ro_ptrmap_start_pos() const { return _ro_ptrmap_start_pos; }
209
210 // Heap archiving
211 const AOTMappedHeapHeader* mapped_heap() const { return &_mapped_heap_header; }
212 const AOTStreamedHeapHeader* streamed_heap() const { return &_streamed_heap_header; }
213
214 void set_streamed_heap_header(AOTStreamedHeapHeader header) { _streamed_heap_header = header; }
215 void set_mapped_heap_header(AOTMappedHeapHeader header) { _mapped_heap_header = header; }
216
217 void set_has_platform_or_app_classes(bool v) { _has_platform_or_app_classes = v; }
218 void set_cloned_vtables(char* p) { _cloned_vtables = AOTCompressedPointers::encode_not_null(p); }
219 void set_early_serialized_data(char* p) { _early_serialized_data = AOTCompressedPointers::encode_not_null(p); }
220 void set_serialized_data(char* p) { _serialized_data = AOTCompressedPointers::encode_not_null(p); }
221 void set_mapped_base_address(char* p) { _mapped_base_address = p; }
354 CDS_ONLY(_current_info = info;)
355 }
356
357 static FileMapInfo* dynamic_info() {
358 CDS_ONLY(return _dynamic_archive_info;)
359 NOT_CDS(return nullptr;)
360 }
361
362 static void assert_mark(bool check);
363
364 // File manipulation.
365 bool open_as_input() NOT_CDS_RETURN_(false);
366 void open_as_output();
367 void prepare_for_writing();
368 void write_header();
369 void write_region(int region, char* base, size_t size,
370 bool read_only, bool allow_exec);
371 size_t remove_bitmap_zeros(CHeapBitMap* map);
372 char* write_bitmap_region(CHeapBitMap* rw_ptrmap,
373 CHeapBitMap* ro_ptrmap,
374 AOTMappedHeapInfo* mapped_heap_info,
375 AOTStreamedHeapInfo* streamed_heap_info,
376 size_t &size_in_bytes);
377 size_t write_mapped_heap_region(AOTMappedHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN_(0);
378 size_t write_streamed_heap_region(AOTStreamedHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN_(0);
379 void write_bytes(const void* buffer, size_t count);
380 void write_bytes_aligned(const void* buffer, size_t count);
381 size_t read_bytes(void* buffer, size_t count);
382 static size_t readonly_total();
383 MapArchiveResult map_regions(int regions[], int num_regions, char* mapped_base_address, ReservedSpace rs);
384 void unmap_regions(int regions[], int num_regions);
385
386 // Object loading support
387 void stream_heap_region() NOT_CDS_JAVA_HEAP_RETURN;
388 void map_or_load_heap_region() NOT_CDS_JAVA_HEAP_RETURN;
389
390 bool has_heap_region() NOT_CDS_JAVA_HEAP_RETURN_(false);
391 bool read_region(int i, char* base, size_t size, bool do_commit);
392 char* map_bitmap_region();
393 bool map_aot_code_region(ReservedSpace rs);
437 return header()->region_at(i);
438 }
439
440 BitMapView bitmap_view(int region_index, bool is_oopmap);
441 BitMapView oopmap_view(int region_index);
442 BitMapView ptrmap_view(int region_index);
443
444 void print(outputStream* st) const;
445
446 const char* vm_version() {
447 return header()->jvm_ident();
448 }
449 bool can_use_heap_region();
450
451 private:
452 bool open_for_read();
453 void seek_to_position(size_t pos);
454
455 MapArchiveResult map_region(int i, intx addr_delta, char* mapped_base_address, ReservedSpace rs);
456 bool relocate_pointers_in_core_regions(intx addr_delta);
457 char* map_auxiliary_region(int region_index, bool read_only);
458
459 public:
460
461 private:
462
463 #if INCLUDE_JVMTI
464 static ClassPathEntry** _classpath_entries_for_jvmti;
465 static ClassPathEntry* get_classpath_entry_for_jvmti(int i, TRAPS);
466 #endif
467 };
468
469 #endif // SHARE_CDS_FILEMAP_HPP
|
127 narrowPtr _early_serialized_data; // Data accessed using {ReadClosure,WriteClosure}::serialize()
128 narrowPtr _serialized_data; // Data accessed using {ReadClosure,WriteClosure}::serialize()
129
130 // The following fields are all sanity checks for whether this archive
131 // will function correctly with this JVM and the bootclasspath it's
132 // invoked with.
133 char _jvm_ident[JVM_IDENT_MAX]; // identifier string of the jvm that created this dump
134
135 narrowPtr _class_location_config;
136
137 bool _verify_local; // BytecodeVerificationLocal setting
138 bool _verify_remote; // BytecodeVerificationRemote setting
139 bool _has_platform_or_app_classes; // Archive contains app or platform classes
140 char* _requested_base_address; // Archive relocation is not necessary if we map with this base address.
141 char* _mapped_base_address; // Actual base address where archive is mapped.
142
143 bool _use_optimized_module_handling;// No module-relation VM options were specified, so we can skip
144 // some expensive operations.
145 bool _has_aot_linked_classes; // Was the CDS archive created with -XX:+AOTClassLinking
146 bool _has_full_module_graph; // Does this CDS archive contain the full archived module graph?
147 int _gc_kind; // Universe::heap()->kind();
148 char _gc_name[32]; // Universe::heap()->name();
149 size_t _ptrmap_size_in_bits; // Size of pointer relocation bitmap
150 size_t _rw_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the rw region
151 size_t _ro_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the ro region
152
153 AOTMappedHeapHeader _mapped_heap_header;
154 AOTStreamedHeapHeader _streamed_heap_header;
155
156 // The following are parameters that affect MethodData layout.
157 u1 _compiler_type;
158 uint _type_profile_level;
159 int _type_profile_args_limit;
160 int _type_profile_parms_limit;
161 intx _type_profile_width;
162 intx _bci_profile_width;
163 bool _profile_traps;
164 bool _type_profile_casts;
165 int _spec_trap_limit_extra_entries;
166
167 template <typename T> T decode(narrowPtr narrowp) const {
168 return AOTCompressedPointers::decode_not_null<T>(narrowp, reinterpret_cast<address>(mapped_base_address()));
169 }
185 void set_base_archive_name_size(unsigned int s) { _generic_header._base_archive_name_size = s; }
186
187 bool is_static() const { return magic() == CDS_ARCHIVE_MAGIC; }
188 size_t core_region_alignment() const { return _core_region_alignment; }
189 int obj_alignment() const { return _obj_alignment; }
190 address narrow_oop_base() const { return _narrow_oop_base; }
191 int narrow_oop_shift() const { return _narrow_oop_shift; }
192 bool compact_strings() const { return _compact_strings; }
193 bool compact_headers() const { return _compact_headers; }
194 uintx max_heap_size() const { return _max_heap_size; }
195 CompressedOops::Mode narrow_oop_mode() const { return _narrow_oop_mode; }
196 char* cloned_vtables() const { return decode<char*>(_cloned_vtables); }
197 char* early_serialized_data() const { return decode<char*>(_early_serialized_data); }
198 char* serialized_data() const { return decode<char*>(_serialized_data); }
199 bool object_streaming_mode() const { return _object_streaming_mode; }
200 const char* jvm_ident() const { return _jvm_ident; }
201 char* requested_base_address() const { return _requested_base_address; }
202 char* mapped_base_address() const { return _mapped_base_address; }
203 bool has_platform_or_app_classes() const { return _has_platform_or_app_classes; }
204 bool has_aot_linked_classes() const { return _has_aot_linked_classes; }
205 int gc_kind() const { return _gc_kind; }
206 const char* gc_name() const { return _gc_name; }
207 size_t ptrmap_size_in_bits() const { return _ptrmap_size_in_bits; }
208 bool compressed_oops() const { return _compressed_oops; }
209 bool compressed_class_pointers() const { return _compressed_class_ptrs; }
210 int narrow_klass_pointer_bits() const { return _narrow_klass_pointer_bits; }
211 int narrow_klass_shift() const { return _narrow_klass_shift; }
212 bool has_full_module_graph() const { return _has_full_module_graph; }
213 size_t rw_ptrmap_start_pos() const { return _rw_ptrmap_start_pos; }
214 size_t ro_ptrmap_start_pos() const { return _ro_ptrmap_start_pos; }
215
216 // Heap archiving
217 const AOTMappedHeapHeader* mapped_heap() const { return &_mapped_heap_header; }
218 const AOTStreamedHeapHeader* streamed_heap() const { return &_streamed_heap_header; }
219
220 void set_streamed_heap_header(AOTStreamedHeapHeader header) { _streamed_heap_header = header; }
221 void set_mapped_heap_header(AOTMappedHeapHeader header) { _mapped_heap_header = header; }
222
223 void set_has_platform_or_app_classes(bool v) { _has_platform_or_app_classes = v; }
224 void set_cloned_vtables(char* p) { _cloned_vtables = AOTCompressedPointers::encode_not_null(p); }
225 void set_early_serialized_data(char* p) { _early_serialized_data = AOTCompressedPointers::encode_not_null(p); }
226 void set_serialized_data(char* p) { _serialized_data = AOTCompressedPointers::encode_not_null(p); }
227 void set_mapped_base_address(char* p) { _mapped_base_address = p; }
360 CDS_ONLY(_current_info = info;)
361 }
362
363 static FileMapInfo* dynamic_info() {
364 CDS_ONLY(return _dynamic_archive_info;)
365 NOT_CDS(return nullptr;)
366 }
367
368 static void assert_mark(bool check);
369
370 // File manipulation.
371 bool open_as_input() NOT_CDS_RETURN_(false);
372 void open_as_output();
373 void prepare_for_writing();
374 void write_header();
375 void write_region(int region, char* base, size_t size,
376 bool read_only, bool allow_exec);
377 size_t remove_bitmap_zeros(CHeapBitMap* map);
378 char* write_bitmap_region(CHeapBitMap* rw_ptrmap,
379 CHeapBitMap* ro_ptrmap,
380 CHeapBitMap* ac_ptrmap,
381 AOTMappedHeapInfo* mapped_heap_info,
382 AOTStreamedHeapInfo* streamed_heap_info,
383 size_t &size_in_bytes);
384 size_t write_mapped_heap_region(AOTMappedHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN_(0);
385 size_t write_streamed_heap_region(AOTStreamedHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN_(0);
386 void write_bytes(const void* buffer, size_t count);
387 void write_bytes_aligned(const void* buffer, size_t count);
388 size_t read_bytes(void* buffer, size_t count);
389 static size_t readonly_total();
390 MapArchiveResult map_regions(int regions[], int num_regions, char* mapped_base_address, ReservedSpace rs);
391 void unmap_regions(int regions[], int num_regions);
392
393 // Object loading support
394 void stream_heap_region() NOT_CDS_JAVA_HEAP_RETURN;
395 void map_or_load_heap_region() NOT_CDS_JAVA_HEAP_RETURN;
396
397 bool has_heap_region() NOT_CDS_JAVA_HEAP_RETURN_(false);
398 bool read_region(int i, char* base, size_t size, bool do_commit);
399 char* map_bitmap_region();
400 bool map_aot_code_region(ReservedSpace rs);
444 return header()->region_at(i);
445 }
446
447 BitMapView bitmap_view(int region_index, bool is_oopmap);
448 BitMapView oopmap_view(int region_index);
449 BitMapView ptrmap_view(int region_index);
450
451 void print(outputStream* st) const;
452
453 const char* vm_version() {
454 return header()->jvm_ident();
455 }
456 bool can_use_heap_region();
457
458 private:
459 bool open_for_read();
460 void seek_to_position(size_t pos);
461
462 MapArchiveResult map_region(int i, intx addr_delta, char* mapped_base_address, ReservedSpace rs);
463 bool relocate_pointers_in_core_regions(intx addr_delta);
464 void relocate_pointers_in_aot_code_region();
465 char* map_auxiliary_region(int region_index, bool read_only);
466
467 public:
468
469 private:
470
471 #if INCLUDE_JVMTI
472 static ClassPathEntry** _classpath_entries_for_jvmti;
473 static ClassPathEntry* get_classpath_entry_for_jvmti(int i, TRAPS);
474 #endif
475 };
476
477 #endif // SHARE_CDS_FILEMAP_HPP
|