Mercurial > hg > graal-jvmci-8
comparison src/share/vm/memory/filemap.hpp @ 20527:8cb56c8cb30d
Merge
author | jiangli |
---|---|
date | Mon, 15 Sep 2014 16:39:00 -0400 |
parents | 6e0cb14ce59b ca6d25be853b |
children |
comparison
equal
deleted
inserted
replaced
20411:fe1f65b0a2d8 | 20527:8cb56c8cb30d |
---|---|
59 _current_version = 2 | 59 _current_version = 2 |
60 }; | 60 }; |
61 | 61 |
62 bool _file_open; | 62 bool _file_open; |
63 int _fd; | 63 int _fd; |
64 long _file_offset; | 64 size_t _file_offset; |
65 | 65 |
66 private: | 66 private: |
67 static SharedClassPathEntry* _classpath_entry_table; | 67 static SharedClassPathEntry* _classpath_entry_table; |
68 static int _classpath_entry_table_size; | 68 static int _classpath_entry_table_size; |
69 static size_t _classpath_entry_size; | 69 static size_t _classpath_entry_size; |
85 char* data() { | 85 char* data() { |
86 return ((char*)this) + sizeof(FileMapHeaderBase); | 86 return ((char*)this) + sizeof(FileMapHeaderBase); |
87 } | 87 } |
88 | 88 |
89 int _magic; // identify file type. | 89 int _magic; // identify file type. |
90 int _crc; // header crc checksum. | |
90 int _version; // (from enum, above.) | 91 int _version; // (from enum, above.) |
91 size_t _alignment; // how shared archive should be aligned | 92 size_t _alignment; // how shared archive should be aligned |
92 int _obj_alignment; // value of ObjectAlignmentInBytes | 93 int _obj_alignment; // value of ObjectAlignmentInBytes |
93 | 94 |
94 struct space_info { | 95 struct space_info { |
95 int _file_offset; // sizeof(this) rounded to vm page size | 96 int _crc; // crc checksum of the current space |
97 size_t _file_offset; // sizeof(this) rounded to vm page size | |
96 char* _base; // copy-on-write base address | 98 char* _base; // copy-on-write base address |
97 size_t _capacity; // for validity checking | 99 size_t _capacity; // for validity checking |
98 size_t _used; // for setting space top on read | 100 size_t _used; // for setting space top on read |
99 bool _read_only; // read only space? | 101 bool _read_only; // read only space? |
100 bool _allow_exec; // executable code in space? | 102 bool _allow_exec; // executable code in space? |
133 size_t _classpath_entry_size; | 135 size_t _classpath_entry_size; |
134 SharedClassPathEntry* _classpath_entry_table; | 136 SharedClassPathEntry* _classpath_entry_table; |
135 | 137 |
136 virtual bool validate(); | 138 virtual bool validate(); |
137 virtual void populate(FileMapInfo* info, size_t alignment); | 139 virtual void populate(FileMapInfo* info, size_t alignment); |
140 int compute_crc(); | |
138 }; | 141 }; |
139 | 142 |
140 FileMapHeader * _header; | 143 FileMapHeader * _header; |
141 | 144 |
142 const char* _full_path; | 145 const char* _full_path; |
151 public: | 154 public: |
152 FileMapInfo(); | 155 FileMapInfo(); |
153 ~FileMapInfo(); | 156 ~FileMapInfo(); |
154 | 157 |
155 static int current_version() { return _current_version; } | 158 static int current_version() { return _current_version; } |
159 int compute_header_crc(); | |
160 void set_header_crc(int crc) { _header->_crc = crc; } | |
156 void populate_header(size_t alignment); | 161 void populate_header(size_t alignment); |
157 bool validate_header(); | 162 bool validate_header(); |
158 void invalidate(); | 163 void invalidate(); |
159 int version() { return _header->_version; } | 164 int version() { return _header->_version; } |
160 size_t alignment() { return _header->_alignment; } | 165 size_t alignment() { return _header->_alignment; } |
179 size_t capacity, bool read_only, bool allow_exec); | 184 size_t capacity, bool read_only, bool allow_exec); |
180 void write_bytes(const void* buffer, int count); | 185 void write_bytes(const void* buffer, int count); |
181 void write_bytes_aligned(const void* buffer, int count); | 186 void write_bytes_aligned(const void* buffer, int count); |
182 char* map_region(int i); | 187 char* map_region(int i); |
183 void unmap_region(int i); | 188 void unmap_region(int i); |
189 bool verify_region_checksum(int i); | |
184 void close(); | 190 void close(); |
185 bool is_open() { return _file_open; } | 191 bool is_open() { return _file_open; } |
186 ReservedSpace reserve_shared_memory(); | 192 ReservedSpace reserve_shared_memory(); |
187 | 193 |
188 // JVM/TI RedefineClasses() support: | 194 // JVM/TI RedefineClasses() support: |