1 /*
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
223 void set_cds_i2i_entry_code_buffers_size(size_t s) {
224 _header->_cds_i2i_entry_code_buffers_size = s;
225 }
226 void set_core_spaces_size(size_t s) { _header->_core_spaces_size = s; }
227 size_t core_spaces_size() { return _header->_core_spaces_size; }
228
229 static FileMapInfo* current_info() {
230 CDS_ONLY(return _current_info;)
231 NOT_CDS(return NULL;)
232 }
233
234 static void assert_mark(bool check);
235
236 // File manipulation.
237 bool initialize() NOT_CDS_RETURN_(false);
238 bool open_for_read();
239 void open_for_write();
240 void write_header();
241 void write_region(int region, char* base, size_t size,
242 bool read_only, bool allow_exec);
243 void write_string_regions(GrowableArray<MemRegion> *regions);
244 void write_bytes(const void* buffer, int count);
245 void write_bytes_aligned(const void* buffer, int count);
246 char* map_region(int i);
247 bool map_string_regions();
248 bool verify_string_regions();
249 void fixup_string_regions();
250 void unmap_region(int i);
251 void dealloc_string_regions();
252 bool verify_region_checksum(int i);
253 void close();
254 bool is_open() { return _file_open; }
255 ReservedSpace reserve_shared_memory();
256
257 // JVM/TI RedefineClasses() support:
258 // Remap the shared readonly space to shared readwrite, private.
259 bool remap_shared_readonly_as_readwrite();
260
261 // Errors.
262 static void fail_stop(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2);
263 static void fail_continue(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2);
|
1 /*
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
223 void set_cds_i2i_entry_code_buffers_size(size_t s) {
224 _header->_cds_i2i_entry_code_buffers_size = s;
225 }
226 void set_core_spaces_size(size_t s) { _header->_core_spaces_size = s; }
227 size_t core_spaces_size() { return _header->_core_spaces_size; }
228
229 static FileMapInfo* current_info() {
230 CDS_ONLY(return _current_info;)
231 NOT_CDS(return NULL;)
232 }
233
234 static void assert_mark(bool check);
235
236 // File manipulation.
237 bool initialize() NOT_CDS_RETURN_(false);
238 bool open_for_read();
239 void open_for_write();
240 void write_header();
241 void write_region(int region, char* base, size_t size,
242 bool read_only, bool allow_exec);
243 void write_string_regions(GrowableArray<MemRegion> *regions,
244 char** s0_start, char** s0_top, char** s0_end,
245 char** s1_start, char** s1_top, char** s1_end);
246 void write_bytes(const void* buffer, int count);
247 void write_bytes_aligned(const void* buffer, int count);
248 char* map_region(int i);
249 bool map_string_regions();
250 bool verify_string_regions();
251 void fixup_string_regions();
252 void unmap_region(int i);
253 void dealloc_string_regions();
254 bool verify_region_checksum(int i);
255 void close();
256 bool is_open() { return _file_open; }
257 ReservedSpace reserve_shared_memory();
258
259 // JVM/TI RedefineClasses() support:
260 // Remap the shared readonly space to shared readwrite, private.
261 bool remap_shared_readonly_as_readwrite();
262
263 // Errors.
264 static void fail_stop(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2);
265 static void fail_continue(const char *msg, ...) ATTRIBUTE_PRINTF(1, 2);
|