1 /*
2 * Copyright (c) 2003, 2008, 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 // All heaps contains a "permanent generation," containing permanent
26 // (reflective) objects. This is like a regular generation in some ways,
27 // but unlike one in others, and so is split apart.
28
29 class PermanentGenerationSpec;
30
31 // This is the "generation" view of a CompactingPermGen.
32 // NOTE: the shared spaces used for CDS are here handled in
33 // a somewhat awkward and potentially buggy fashion, see CR 6801625.
34 // This infelicity should be fixed, see CR 6897789.
35 class CompactingPermGenGen: public OneContigSpaceCardGeneration {
36 friend class VMStructs;
37 // Abstractly, this is a subtype that gets access to protected fields.
38 friend class CompactingPermGen;
39
40 private:
41 // Shared spaces
42 PermanentGenerationSpec* _spec;
43 size_t _shared_space_size;
44 VirtualSpace _ro_vs;
230 void** vtable,
231 char** md_top, char* md_end,
232 char** mc_top, char* mc_end);
233
234 void verify(bool allow_dirty);
235
236 // Serialization
237 static void initialize_oops() KERNEL_RETURN;
238 static void serialize_oops(SerializeOopClosure* soc);
239 void serialize_bts(SerializeOopClosure* soc);
240
241 // Initiate dumping of shared file.
242 static jint dump_shared(GrowableArray<oop>* class_promote_order, TRAPS);
243
244 // JVM/TI RedefineClasses() support:
245 // Remap the shared readonly space to shared readwrite, private if
246 // sharing is enabled. Simply returns true if sharing is not enabled
247 // or if the remapping has already been done by a prior call.
248 static bool remap_shared_readonly_as_readwrite();
249 };
|
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_COMPACTINGPERMGENGEN_HPP
26 #define SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
27
28 #include "gc_implementation/shared/generationCounters.hpp"
29 #include "memory/space.hpp"
30
31 // All heaps contains a "permanent generation," containing permanent
32 // (reflective) objects. This is like a regular generation in some ways,
33 // but unlike one in others, and so is split apart.
34
35 class PermanentGenerationSpec;
36
37 // This is the "generation" view of a CompactingPermGen.
38 // NOTE: the shared spaces used for CDS are here handled in
39 // a somewhat awkward and potentially buggy fashion, see CR 6801625.
40 // This infelicity should be fixed, see CR 6897789.
41 class CompactingPermGenGen: public OneContigSpaceCardGeneration {
42 friend class VMStructs;
43 // Abstractly, this is a subtype that gets access to protected fields.
44 friend class CompactingPermGen;
45
46 private:
47 // Shared spaces
48 PermanentGenerationSpec* _spec;
49 size_t _shared_space_size;
50 VirtualSpace _ro_vs;
236 void** vtable,
237 char** md_top, char* md_end,
238 char** mc_top, char* mc_end);
239
240 void verify(bool allow_dirty);
241
242 // Serialization
243 static void initialize_oops() KERNEL_RETURN;
244 static void serialize_oops(SerializeOopClosure* soc);
245 void serialize_bts(SerializeOopClosure* soc);
246
247 // Initiate dumping of shared file.
248 static jint dump_shared(GrowableArray<oop>* class_promote_order, TRAPS);
249
250 // JVM/TI RedefineClasses() support:
251 // Remap the shared readonly space to shared readwrite, private if
252 // sharing is enabled. Simply returns true if sharing is not enabled
253 // or if the remapping has already been done by a prior call.
254 static bool remap_shared_readonly_as_readwrite();
255 };
256
257 #endif // SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
|