1 /*
2 * Copyright (c) 2003, 2006, 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 *
23 */
24
25 // Layout of the file:
26 // header: dump of archive instance plus versioning info, datestamp, etc.
27 // [magic # = 0xF00BABA2]
28 // ... padding to align on page-boundary
29 // read-write space from CompactingPermGenGen
30 // read-only space from CompactingPermGenGen
31 // misc data (block offset table, string table, symbols, dictionary, etc.)
32 // tag(666)
33
34 static const int JVM_SHARED_JARS_MAX = 128;
35 static const int JVM_SPACENAME_MAX = 128;
36 static const int JVM_IDENT_MAX = 256;
37 static const int JVM_ARCH_MAX = 12;
38
39
40
41 class FileMapInfo : public CHeapObj {
42 private:
43 enum {
44 _invalid_version = -1,
120 void write_bytes(const void* buffer, int count);
121 void write_bytes_aligned(const void* buffer, int count);
122 bool map_space(int i, ReservedSpace rs, ContiguousSpace *space);
123 char* map_region(int i, ReservedSpace rs);
124 char* map_region(int i, bool address_must_match);
125 void unmap_region(int i);
126 void close();
127 bool is_open() { return _file_open; }
128
129 // JVM/TI RedefineClasses() support:
130 // Remap the shared readonly space to shared readwrite, private.
131 bool remap_shared_readonly_as_readwrite();
132
133 // Errors.
134 static void fail_stop(const char *msg, ...);
135 void fail_continue(const char *msg, ...);
136
137 // Return true if given address is in the mapped shared space.
138 bool is_in_shared_space(const void* p);
139 };
|
1 /*
2 * Copyright (c) 2003, 2010, 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 *
23 */
24
25 #ifndef SHARE_VM_MEMORY_FILEMAP_HPP
26 #define SHARE_VM_MEMORY_FILEMAP_HPP
27
28 #include "memory/compactingPermGenGen.hpp"
29 #include "memory/space.hpp"
30
31 // Layout of the file:
32 // header: dump of archive instance plus versioning info, datestamp, etc.
33 // [magic # = 0xF00BABA2]
34 // ... padding to align on page-boundary
35 // read-write space from CompactingPermGenGen
36 // read-only space from CompactingPermGenGen
37 // misc data (block offset table, string table, symbols, dictionary, etc.)
38 // tag(666)
39
40 static const int JVM_SHARED_JARS_MAX = 128;
41 static const int JVM_SPACENAME_MAX = 128;
42 static const int JVM_IDENT_MAX = 256;
43 static const int JVM_ARCH_MAX = 12;
44
45
46
47 class FileMapInfo : public CHeapObj {
48 private:
49 enum {
50 _invalid_version = -1,
126 void write_bytes(const void* buffer, int count);
127 void write_bytes_aligned(const void* buffer, int count);
128 bool map_space(int i, ReservedSpace rs, ContiguousSpace *space);
129 char* map_region(int i, ReservedSpace rs);
130 char* map_region(int i, bool address_must_match);
131 void unmap_region(int i);
132 void close();
133 bool is_open() { return _file_open; }
134
135 // JVM/TI RedefineClasses() support:
136 // Remap the shared readonly space to shared readwrite, private.
137 bool remap_shared_readonly_as_readwrite();
138
139 // Errors.
140 static void fail_stop(const char *msg, ...);
141 void fail_continue(const char *msg, ...);
142
143 // Return true if given address is in the mapped shared space.
144 bool is_in_shared_space(const void* p);
145 };
146
147 #endif // SHARE_VM_MEMORY_FILEMAP_HPP
|