annotate src/share/vm/memory/compactingPermGenGen.hpp @ 1994:6cd6d394f280

7001033: assert(gch->gc_cause() == GCCause::_scavenge_alot || !gch->incremental_collection_failed()) 7002546: regression on SpecJbb2005 on 7b118 comparing to 7b117 on small heaps Summary: Relaxed assertion checking related to incremental_collection_failed flag to allow for ExplicitGCInvokesConcurrent behaviour where we do not want a failing scavenge to bail to a stop-world collection. Parameterized incremental_collection_will_fail() so we can selectively use, or not use, as appropriate, the statistical prediction at specific use sites. This essentially reverts the scavenge bail-out logic to what it was prior to some recent changes that had inadvertently started using the statistical prediction which can be noisy in the presence of bursty loads. Added some associated verbose non-product debugging messages. Reviewed-by: johnc, tonyp
author ysr
date Tue, 07 Dec 2010 21:55:53 -0800
parents f95d63e2154a
children 3582bf76420e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1051
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1051
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1051
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "gc_implementation/shared/generationCounters.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "memory/space.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // All heaps contains a "permanent generation," containing permanent
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // (reflective) objects. This is like a regular generation in some ways,
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // but unlike one in others, and so is split apart.
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 class PermanentGenerationSpec;
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // This is the "generation" view of a CompactingPermGen.
1051
26f1542097f1 6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents: 409
diff changeset
38 // NOTE: the shared spaces used for CDS are here handled in
26f1542097f1 6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents: 409
diff changeset
39 // a somewhat awkward and potentially buggy fashion, see CR 6801625.
26f1542097f1 6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents: 409
diff changeset
40 // This infelicity should be fixed, see CR 6897789.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
41 class CompactingPermGenGen: public OneContigSpaceCardGeneration {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 friend class VMStructs;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 // Abstractly, this is a subtype that gets access to protected fields.
a61af66fc99e Initial load
duke
parents:
diff changeset
44 friend class CompactingPermGen;
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // Shared spaces
a61af66fc99e Initial load
duke
parents:
diff changeset
48 PermanentGenerationSpec* _spec;
a61af66fc99e Initial load
duke
parents:
diff changeset
49 size_t _shared_space_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 VirtualSpace _ro_vs;
a61af66fc99e Initial load
duke
parents:
diff changeset
51 VirtualSpace _rw_vs;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 VirtualSpace _md_vs;
a61af66fc99e Initial load
duke
parents:
diff changeset
53 VirtualSpace _mc_vs;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 BlockOffsetSharedArray* _ro_bts;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 BlockOffsetSharedArray* _rw_bts;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 OffsetTableContigSpace* _ro_space;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 OffsetTableContigSpace* _rw_space;
a61af66fc99e Initial load
duke
parents:
diff changeset
58
1051
26f1542097f1 6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents: 409
diff changeset
59 // With shared spaces there is a dichotomy in the use of the
0
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // _virtual_space of the generation. There is a portion of the
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // _virtual_space that is used for the unshared part of the
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // permanent generation and a portion that is reserved for the shared part.
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // The _reserved field in the generation represents both the
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // unshared and shared parts of the generation. The _reserved
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // variable is initialized for only the unshared part but is
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // later extended to include the shared part during initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // if shared spaces are being used.
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // The reserved size for the _virtual_space for CompactingPermGenGen
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // is the size of the space for the permanent generation including the
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // the shared spaces. This can be seen by the use of MaxPermSize
a61af66fc99e Initial load
duke
parents:
diff changeset
71 // in the allocation of PermanentGenerationSpec. The space for the
a61af66fc99e Initial load
duke
parents:
diff changeset
72 // shared spaces is committed separately (???).
a61af66fc99e Initial load
duke
parents:
diff changeset
73 // In general at initialization only a part of the
a61af66fc99e Initial load
duke
parents:
diff changeset
74 // space for the unshared part of the permanent generation is
a61af66fc99e Initial load
duke
parents:
diff changeset
75 // committed and more is committed as the permanent generation is
a61af66fc99e Initial load
duke
parents:
diff changeset
76 // grown. In growing the permanent generation the capacity() and
a61af66fc99e Initial load
duke
parents:
diff changeset
77 // max_capacity() of the generation are used. For the permanent
a61af66fc99e Initial load
duke
parents:
diff changeset
78 // generation (implemented with a CompactingPermGenGen) the capacity()
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // is taken from the capacity of the space (_the_space variable used for the
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // unshared part of the generation) and the max_capacity() is based
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // on the size of the _reserved variable (which includes the size of the
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // shared spaces) minus the size of the shared spaces.
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // These values are redundant, but are called out separately to avoid
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // going through heap/space/gen pointers for performance.
a61af66fc99e Initial load
duke
parents:
diff changeset
86 static HeapWord* unshared_bottom;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 static HeapWord* unshared_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 static HeapWord* shared_bottom;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 static HeapWord* readonly_bottom;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 static HeapWord* readonly_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 static HeapWord* readwrite_bottom;
a61af66fc99e Initial load
duke
parents:
diff changeset
92 static HeapWord* readwrite_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
93 static HeapWord* miscdata_bottom;
a61af66fc99e Initial load
duke
parents:
diff changeset
94 static HeapWord* miscdata_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
95 static HeapWord* misccode_bottom;
a61af66fc99e Initial load
duke
parents:
diff changeset
96 static HeapWord* misccode_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 static HeapWord* shared_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 // List of klassOops whose vtbl entries are used to patch others.
a61af66fc99e Initial load
duke
parents:
diff changeset
100 static void** _vtbl_list;
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // Performance Counters
a61af66fc99e Initial load
duke
parents:
diff changeset
103 GenerationCounters* _gen_counters;
a61af66fc99e Initial load
duke
parents:
diff changeset
104 CSpaceCounters* _space_counters;
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 void initialize_performance_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
111 vtbl_list_size = 16, // number of entries in the shared space vtable list.
408
52e32c8b317e 6761092: jvm crashes when CDS is enabled.
acorn
parents: 291
diff changeset
112 num_virtuals = 200 // number of virtual methods in Klass (or
0
a61af66fc99e Initial load
duke
parents:
diff changeset
113 // subclass) objects, or greater.
a61af66fc99e Initial load
duke
parents:
diff changeset
114 };
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
117 ro = 0, // read-only shared space in the heap
a61af66fc99e Initial load
duke
parents:
diff changeset
118 rw = 1, // read-write shared space in the heap
a61af66fc99e Initial load
duke
parents:
diff changeset
119 md = 2, // miscellaneous data for initializing tables, etc.
a61af66fc99e Initial load
duke
parents:
diff changeset
120 mc = 3, // miscellaneous code - vtable replacement.
a61af66fc99e Initial load
duke
parents:
diff changeset
121 n_regions = 4
a61af66fc99e Initial load
duke
parents:
diff changeset
122 };
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 CompactingPermGenGen(ReservedSpace rs, ReservedSpace shared_rs,
a61af66fc99e Initial load
duke
parents:
diff changeset
125 size_t initial_byte_size, int level, GenRemSet* remset,
a61af66fc99e Initial load
duke
parents:
diff changeset
126 ContiguousSpace* space,
a61af66fc99e Initial load
duke
parents:
diff changeset
127 PermanentGenerationSpec* perm_spec);
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 const char* name() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
130 return "compacting perm gen";
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 const char* short_name() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
134 return "Perm";
a61af66fc99e Initial load
duke
parents:
diff changeset
135 }
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 // Return the maximum capacity for the object space. This
a61af66fc99e Initial load
duke
parents:
diff changeset
138 // explicitly does not include the shared spaces.
a61af66fc99e Initial load
duke
parents:
diff changeset
139 size_t max_capacity() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141 void update_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 void compute_new_size() {
a61af66fc99e Initial load
duke
parents:
diff changeset
144 assert(false, "Should not call this -- handled at PermGen level.");
a61af66fc99e Initial load
duke
parents:
diff changeset
145 }
a61af66fc99e Initial load
duke
parents:
diff changeset
146
a61af66fc99e Initial load
duke
parents:
diff changeset
147 bool must_be_youngest() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
148 bool must_be_oldest() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 OffsetTableContigSpace* ro_space() const { return _ro_space; }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 OffsetTableContigSpace* rw_space() const { return _rw_space; }
a61af66fc99e Initial load
duke
parents:
diff changeset
152 VirtualSpace* md_space() { return &_md_vs; }
a61af66fc99e Initial load
duke
parents:
diff changeset
153 VirtualSpace* mc_space() { return &_mc_vs; }
a61af66fc99e Initial load
duke
parents:
diff changeset
154 ContiguousSpace* unshared_space() const { return _the_space; }
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 static bool inline is_shared(const oopDesc* p) {
a61af66fc99e Initial load
duke
parents:
diff changeset
157 return (HeapWord*)p >= shared_bottom && (HeapWord*)p < shared_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
158 }
a61af66fc99e Initial load
duke
parents:
diff changeset
159 // RedefineClasses note: this tester is used to check residence of
a61af66fc99e Initial load
duke
parents:
diff changeset
160 // the specified oop in the shared readonly space and not whether
a61af66fc99e Initial load
duke
parents:
diff changeset
161 // the oop is readonly.
a61af66fc99e Initial load
duke
parents:
diff changeset
162 static bool inline is_shared_readonly(const oopDesc* p) {
a61af66fc99e Initial load
duke
parents:
diff changeset
163 return (HeapWord*)p >= readonly_bottom && (HeapWord*)p < readonly_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
164 }
a61af66fc99e Initial load
duke
parents:
diff changeset
165 // RedefineClasses note: this tester is used to check residence of
a61af66fc99e Initial load
duke
parents:
diff changeset
166 // the specified oop in the shared readwrite space and not whether
a61af66fc99e Initial load
duke
parents:
diff changeset
167 // the oop is readwrite.
a61af66fc99e Initial load
duke
parents:
diff changeset
168 static bool inline is_shared_readwrite(const oopDesc* p) {
a61af66fc99e Initial load
duke
parents:
diff changeset
169 return (HeapWord*)p >= readwrite_bottom && (HeapWord*)p < readwrite_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
170 }
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 bool is_in_unshared(const void* p) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
173 return OneContigSpaceCardGeneration::is_in(p);
a61af66fc99e Initial load
duke
parents:
diff changeset
174 }
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 bool is_in_shared(const void* p) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
177 return p >= shared_bottom && p < shared_end;
a61af66fc99e Initial load
duke
parents:
diff changeset
178 }
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 inline bool is_in(const void* p) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
181 return is_in_unshared(p) || is_in_shared(p);
a61af66fc99e Initial load
duke
parents:
diff changeset
182 }
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 inline PermanentGenerationSpec* spec() const { return _spec; }
a61af66fc99e Initial load
duke
parents:
diff changeset
185 inline void set_spec(PermanentGenerationSpec* spec) { _spec = spec; }
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 void pre_adjust_pointers();
a61af66fc99e Initial load
duke
parents:
diff changeset
188 void adjust_pointers();
a61af66fc99e Initial load
duke
parents:
diff changeset
189 void space_iterate(SpaceClosure* blk, bool usedOnly = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
190 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
191 void younger_refs_iterate(OopsInGenClosure* blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
192 void compact();
a61af66fc99e Initial load
duke
parents:
diff changeset
193 void post_compact();
a61af66fc99e Initial load
duke
parents:
diff changeset
194 size_t contiguous_available() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 void clear_remembered_set();
a61af66fc99e Initial load
duke
parents:
diff changeset
197 void invalidate_remembered_set();
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 inline bool block_is_obj(const HeapWord* addr) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 if (addr < the_space()->top()) return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
201 else if (addr < the_space()->end()) return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
202 else if (addr < ro_space()->top()) return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
203 else if (addr < ro_space()->end()) return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
204 else if (addr < rw_space()->top()) return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
205 else return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
206 }
a61af66fc99e Initial load
duke
parents:
diff changeset
207
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 inline size_t block_size(const HeapWord* addr) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
210 if (addr < the_space()->top()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
211 return oop(addr)->size();
a61af66fc99e Initial load
duke
parents:
diff changeset
212 }
a61af66fc99e Initial load
duke
parents:
diff changeset
213 else if (addr < the_space()->end()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
214 assert(addr == the_space()->top(), "non-block head arg to block_size");
a61af66fc99e Initial load
duke
parents:
diff changeset
215 return the_space()->end() - the_space()->top();
a61af66fc99e Initial load
duke
parents:
diff changeset
216 }
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218 else if (addr < ro_space()->top()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
219 return oop(addr)->size();
a61af66fc99e Initial load
duke
parents:
diff changeset
220 }
a61af66fc99e Initial load
duke
parents:
diff changeset
221 else if (addr < ro_space()->end()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 assert(addr == ro_space()->top(), "non-block head arg to block_size");
a61af66fc99e Initial load
duke
parents:
diff changeset
223 return ro_space()->end() - ro_space()->top();
a61af66fc99e Initial load
duke
parents:
diff changeset
224 }
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 else if (addr < rw_space()->top()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
227 return oop(addr)->size();
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
a61af66fc99e Initial load
duke
parents:
diff changeset
229 else {
a61af66fc99e Initial load
duke
parents:
diff changeset
230 assert(addr == rw_space()->top(), "non-block head arg to block_size");
a61af66fc99e Initial load
duke
parents:
diff changeset
231 return rw_space()->end() - rw_space()->top();
a61af66fc99e Initial load
duke
parents:
diff changeset
232 }
a61af66fc99e Initial load
duke
parents:
diff changeset
233 }
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 static void generate_vtable_methods(void** vtbl_list,
a61af66fc99e Initial load
duke
parents:
diff changeset
236 void** vtable,
a61af66fc99e Initial load
duke
parents:
diff changeset
237 char** md_top, char* md_end,
a61af66fc99e Initial load
duke
parents:
diff changeset
238 char** mc_top, char* mc_end);
a61af66fc99e Initial load
duke
parents:
diff changeset
239
a61af66fc99e Initial load
duke
parents:
diff changeset
240 void verify(bool allow_dirty);
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 // Serialization
a61af66fc99e Initial load
duke
parents:
diff changeset
243 static void initialize_oops() KERNEL_RETURN;
a61af66fc99e Initial load
duke
parents:
diff changeset
244 static void serialize_oops(SerializeOopClosure* soc);
a61af66fc99e Initial load
duke
parents:
diff changeset
245 void serialize_bts(SerializeOopClosure* soc);
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 // Initiate dumping of shared file.
a61af66fc99e Initial load
duke
parents:
diff changeset
248 static jint dump_shared(GrowableArray<oop>* class_promote_order, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
249
a61af66fc99e Initial load
duke
parents:
diff changeset
250 // JVM/TI RedefineClasses() support:
a61af66fc99e Initial load
duke
parents:
diff changeset
251 // Remap the shared readonly space to shared readwrite, private if
a61af66fc99e Initial load
duke
parents:
diff changeset
252 // sharing is enabled. Simply returns true if sharing is not enabled
a61af66fc99e Initial load
duke
parents:
diff changeset
253 // or if the remapping has already been done by a prior call.
a61af66fc99e Initial load
duke
parents:
diff changeset
254 static bool remap_shared_readonly_as_readwrite();
a61af66fc99e Initial load
duke
parents:
diff changeset
255 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
256
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
257 #endif // SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP