78
79 public:
80 struct FileMapHeaderBase : public CHeapObj<mtClass> {
81 virtual bool validate() = 0;
82 virtual void populate(FileMapInfo* info, size_t alignment) = 0;
83 };
84 struct FileMapHeader : FileMapHeaderBase {
85 // Use data() and data_size() to memcopy to/from the FileMapHeader. We need to
86 // avoid read/writing the C++ vtable pointer.
87 static size_t data_size();
88 char* data() {
89 return ((char*)this) + sizeof(FileMapHeaderBase);
90 }
91
92 int _magic; // identify file type.
93 int _crc; // header crc checksum.
94 int _version; // (from enum, above.)
95 size_t _alignment; // how shared archive should be aligned
96 int _obj_alignment; // value of ObjectAlignmentInBytes
97 int _narrow_oop_shift; // compressed oop encoding shift
98 uintx _max_heap_size; // java max heap size during dumping
99 Universe::NARROW_OOP_MODE _narrow_oop_mode; // compressed oop encoding mode
100 int _narrow_klass_shift; // save narrow klass base and shift
101 address _narrow_klass_base;
102
103 struct space_info {
104 int _crc; // crc checksum of the current space
105 size_t _file_offset; // sizeof(this) rounded to vm page size
106 union {
107 char* _base; // copy-on-write base address
108 intx _offset; // offset from the compressed oop encoding base, only used
109 // by string space
110 } _addr;
111 size_t _capacity; // for validity checking
112 size_t _used; // for setting space top on read
113 bool _read_only; // read only space?
114 bool _allow_exec; // executable code in space?
115 } _space[MetaspaceShared::n_regions];
116
117 // The following fields are all sanity checks for whether this archive
|
78
79 public:
80 struct FileMapHeaderBase : public CHeapObj<mtClass> {
81 virtual bool validate() = 0;
82 virtual void populate(FileMapInfo* info, size_t alignment) = 0;
83 };
84 struct FileMapHeader : FileMapHeaderBase {
85 // Use data() and data_size() to memcopy to/from the FileMapHeader. We need to
86 // avoid read/writing the C++ vtable pointer.
87 static size_t data_size();
88 char* data() {
89 return ((char*)this) + sizeof(FileMapHeaderBase);
90 }
91
92 int _magic; // identify file type.
93 int _crc; // header crc checksum.
94 int _version; // (from enum, above.)
95 size_t _alignment; // how shared archive should be aligned
96 int _obj_alignment; // value of ObjectAlignmentInBytes
97 int _narrow_oop_shift; // compressed oop encoding shift
98 bool _compact_strings; // value of CompactStrings
99 uintx _max_heap_size; // java max heap size during dumping
100 Universe::NARROW_OOP_MODE _narrow_oop_mode; // compressed oop encoding mode
101 int _narrow_klass_shift; // save narrow klass base and shift
102 address _narrow_klass_base;
103
104 struct space_info {
105 int _crc; // crc checksum of the current space
106 size_t _file_offset; // sizeof(this) rounded to vm page size
107 union {
108 char* _base; // copy-on-write base address
109 intx _offset; // offset from the compressed oop encoding base, only used
110 // by string space
111 } _addr;
112 size_t _capacity; // for validity checking
113 size_t _used; // for setting space top on read
114 bool _read_only; // read only space?
115 bool _allow_exec; // executable code in space?
116 } _space[MetaspaceShared::n_regions];
117
118 // The following fields are all sanity checks for whether this archive
|