src/share/vm/memory/compactingPermGenGen.cpp

Wed, 01 Dec 2010 15:04:06 +0100

author
stefank
date
Wed, 01 Dec 2010 15:04:06 +0100
changeset 2325
c760f78e0a53
parent 2314
f95d63e2154a
child 2497
3582bf76420e
permissions
-rw-r--r--

7003125: precompiled.hpp is included when precompiled headers are not used
Summary: Added an ifndef DONT_USE_PRECOMPILED_HEADER to precompiled.hpp. Set up DONT_USE_PRECOMPILED_HEADER when compiling with Sun Studio or when the user specifies USE_PRECOMPILED_HEADER=0. Fixed broken include dependencies.
Reviewed-by: coleenp, kvn

duke@435 1 /*
stefank@2314 2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
stefank@2314 25 #include "precompiled.hpp"
stefank@2314 26 #include "classfile/symbolTable.hpp"
stefank@2314 27 #include "classfile/systemDictionary.hpp"
stefank@2314 28 #include "memory/compactingPermGenGen.hpp"
stefank@2314 29 #include "memory/filemap.hpp"
stefank@2314 30 #include "memory/genOopClosures.inline.hpp"
stefank@2314 31 #include "memory/generation.inline.hpp"
stefank@2314 32 #include "memory/generationSpec.hpp"
stefank@2314 33 #include "oops/oop.inline.hpp"
stefank@2314 34 #include "runtime/java.hpp"
stefank@2314 35 #ifndef SERIALGC
stefank@2314 36 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
stefank@2314 37 #endif
duke@435 38
duke@435 39
dcubed@482 40 // An ObjectClosure helper: Recursively adjust all pointers in an object
dcubed@482 41 // and all objects by referenced it. Clear marks on objects in order to
dcubed@482 42 // prevent visiting any object twice. This helper is used when the
dcubed@482 43 // RedefineClasses() API has been called.
dcubed@482 44
dcubed@482 45 class AdjustSharedObjectClosure : public ObjectClosure {
dcubed@482 46 public:
dcubed@482 47 void do_object(oop obj) {
dcubed@482 48 if (obj->is_shared_readwrite()) {
dcubed@482 49 if (obj->mark()->is_marked()) {
dcubed@482 50 obj->init_mark(); // Don't revisit this object.
dcubed@482 51 obj->adjust_pointers(); // Adjust this object's references.
dcubed@482 52 }
dcubed@482 53 }
dcubed@482 54 }
dcubed@482 55 };
dcubed@482 56
dcubed@482 57
dcubed@482 58 // An OopClosure helper: Recursively adjust all pointers in an object
dcubed@482 59 // and all objects by referenced it. Clear marks on objects in order
dcubed@482 60 // to prevent visiting any object twice.
duke@435 61
duke@435 62 class RecursiveAdjustSharedObjectClosure : public OopClosure {
coleenp@548 63 protected:
coleenp@548 64 template <class T> inline void do_oop_work(T* p) {
coleenp@548 65 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
duke@435 66 if (obj->is_shared_readwrite()) {
duke@435 67 if (obj->mark()->is_marked()) {
duke@435 68 obj->init_mark(); // Don't revisit this object.
duke@435 69 obj->oop_iterate(this); // Recurse - adjust objects referenced.
duke@435 70 obj->adjust_pointers(); // Adjust this object's references.
duke@435 71
duke@435 72 // Special case: if a class has a read-only constant pool,
duke@435 73 // then the read-write objects referenced by the pool must
duke@435 74 // have their marks reset.
duke@435 75
duke@435 76 if (obj->klass() == Universe::instanceKlassKlassObj()) {
duke@435 77 instanceKlass* ik = instanceKlass::cast((klassOop)obj);
duke@435 78 constantPoolOop cp = ik->constants();
duke@435 79 if (cp->is_shared_readonly()) {
duke@435 80 cp->oop_iterate(this);
duke@435 81 }
duke@435 82 }
duke@435 83 }
duke@435 84 }
coleenp@548 85 }
coleenp@548 86 public:
coleenp@548 87 virtual void do_oop(oop* p) { RecursiveAdjustSharedObjectClosure::do_oop_work(p); }
coleenp@548 88 virtual void do_oop(narrowOop* p) { RecursiveAdjustSharedObjectClosure::do_oop_work(p); }
duke@435 89 };
duke@435 90
duke@435 91
duke@435 92 // We need to go through all placeholders in the system dictionary and
duke@435 93 // try to resolve them into shared classes. Other threads might be in
duke@435 94 // the process of loading a shared class and have strong roots on
duke@435 95 // their stack to the class without having added the class to the
duke@435 96 // dictionary yet. This means the class will be marked during phase 1
duke@435 97 // but will not be unmarked during the application of the
duke@435 98 // RecursiveAdjustSharedObjectClosure to the SystemDictionary. Note
duke@435 99 // that we must not call find_shared_class with non-read-only symbols
duke@435 100 // as doing so can cause hash codes to be computed, destroying
duke@435 101 // forwarding pointers.
duke@435 102 class TraversePlaceholdersClosure : public OopClosure {
coleenp@548 103 protected:
coleenp@548 104 template <class T> inline void do_oop_work(T* p) {
coleenp@548 105 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
duke@435 106 if (obj->klass() == Universe::symbolKlassObj() &&
duke@435 107 obj->is_shared_readonly()) {
duke@435 108 symbolHandle sym((symbolOop) obj);
duke@435 109 oop k = SystemDictionary::find_shared_class(sym);
duke@435 110 if (k != NULL) {
duke@435 111 RecursiveAdjustSharedObjectClosure clo;
duke@435 112 clo.do_oop(&k);
duke@435 113 }
duke@435 114 }
duke@435 115 }
coleenp@548 116 public:
coleenp@548 117 virtual void do_oop(oop* p) { TraversePlaceholdersClosure::do_oop_work(p); }
coleenp@548 118 virtual void do_oop(narrowOop* p) { TraversePlaceholdersClosure::do_oop_work(p); }
coleenp@548 119
duke@435 120 };
duke@435 121
duke@435 122
duke@435 123 void CompactingPermGenGen::initialize_performance_counters() {
duke@435 124
duke@435 125 const char* gen_name = "perm";
duke@435 126
duke@435 127 // Generation Counters - generation 2, 1 subspace
duke@435 128 _gen_counters = new GenerationCounters(gen_name, 2, 1, &_virtual_space);
duke@435 129
duke@435 130 _space_counters = new CSpaceCounters(gen_name, 0,
duke@435 131 _virtual_space.reserved_size(),
duke@435 132 _the_space, _gen_counters);
duke@435 133 }
duke@435 134
duke@435 135 void CompactingPermGenGen::update_counters() {
duke@435 136 if (UsePerfData) {
duke@435 137 _space_counters->update_all();
duke@435 138 _gen_counters->update_all();
duke@435 139 }
duke@435 140 }
duke@435 141
duke@435 142
duke@435 143 CompactingPermGenGen::CompactingPermGenGen(ReservedSpace rs,
duke@435 144 ReservedSpace shared_rs,
duke@435 145 size_t initial_byte_size,
duke@435 146 int level, GenRemSet* remset,
duke@435 147 ContiguousSpace* space,
duke@435 148 PermanentGenerationSpec* spec_) :
duke@435 149 OneContigSpaceCardGeneration(rs, initial_byte_size, MinPermHeapExpansion,
duke@435 150 level, remset, space) {
duke@435 151
duke@435 152 set_spec(spec_);
duke@435 153 if (!UseSharedSpaces && !DumpSharedSpaces) {
duke@435 154 spec()->disable_sharing();
duke@435 155 }
duke@435 156
duke@435 157 // Break virtual space into address ranges for all spaces.
duke@435 158
duke@435 159 if (spec()->enable_shared_spaces()) {
duke@435 160 shared_end = (HeapWord*)(shared_rs.base() + shared_rs.size());
duke@435 161 misccode_end = shared_end;
duke@435 162 misccode_bottom = misccode_end - heap_word_size(spec()->misc_code_size());
duke@435 163 miscdata_end = misccode_bottom;
duke@435 164 miscdata_bottom = miscdata_end - heap_word_size(spec()->misc_data_size());
duke@435 165 readwrite_end = miscdata_bottom;
duke@435 166 readwrite_bottom =
duke@435 167 readwrite_end - heap_word_size(spec()->read_write_size());
duke@435 168 readonly_end = readwrite_bottom;
duke@435 169 readonly_bottom =
duke@435 170 readonly_end - heap_word_size(spec()->read_only_size());
duke@435 171 shared_bottom = readonly_bottom;
duke@435 172 unshared_end = shared_bottom;
duke@435 173 assert((char*)shared_bottom == shared_rs.base(), "shared space mismatch");
duke@435 174 } else {
duke@435 175 shared_end = (HeapWord*)(rs.base() + rs.size());
duke@435 176 misccode_end = shared_end;
duke@435 177 misccode_bottom = shared_end;
duke@435 178 miscdata_end = shared_end;
duke@435 179 miscdata_bottom = shared_end;
duke@435 180 readwrite_end = shared_end;
duke@435 181 readwrite_bottom = shared_end;
duke@435 182 readonly_end = shared_end;
duke@435 183 readonly_bottom = shared_end;
duke@435 184 shared_bottom = shared_end;
duke@435 185 unshared_end = shared_bottom;
duke@435 186 }
duke@435 187 unshared_bottom = (HeapWord*) rs.base();
duke@435 188
duke@435 189 // Verify shared and unshared spaces adjacent.
duke@435 190 assert((char*)shared_bottom == rs.base()+rs.size(), "shared space mismatch");
duke@435 191 assert(unshared_end > unshared_bottom, "shared space mismatch");
duke@435 192
duke@435 193 // Split reserved memory into pieces.
duke@435 194
duke@435 195 ReservedSpace ro_rs = shared_rs.first_part(spec()->read_only_size(),
duke@435 196 UseSharedSpaces);
duke@435 197 ReservedSpace tmp_rs1 = shared_rs.last_part(spec()->read_only_size());
duke@435 198 ReservedSpace rw_rs = tmp_rs1.first_part(spec()->read_write_size(),
duke@435 199 UseSharedSpaces);
duke@435 200 ReservedSpace tmp_rs2 = tmp_rs1.last_part(spec()->read_write_size());
duke@435 201 ReservedSpace md_rs = tmp_rs2.first_part(spec()->misc_data_size(),
duke@435 202 UseSharedSpaces);
duke@435 203 ReservedSpace mc_rs = tmp_rs2.last_part(spec()->misc_data_size());
duke@435 204
duke@435 205 _shared_space_size = spec()->read_only_size()
duke@435 206 + spec()->read_write_size()
duke@435 207 + spec()->misc_data_size()
duke@435 208 + spec()->misc_code_size();
duke@435 209
duke@435 210 // Allocate the unshared (default) space.
duke@435 211 _the_space = new ContigPermSpace(_bts,
duke@435 212 MemRegion(unshared_bottom, heap_word_size(initial_byte_size)));
duke@435 213 if (_the_space == NULL)
duke@435 214 vm_exit_during_initialization("Could not allocate an unshared"
duke@435 215 " CompactingPermGen Space");
duke@435 216
duke@435 217 // Allocate shared spaces
duke@435 218 if (spec()->enable_shared_spaces()) {
duke@435 219
duke@435 220 // If mapping a shared file, the space is not committed, don't
duke@435 221 // mangle.
duke@435 222 NOT_PRODUCT(bool old_ZapUnusedHeapArea = ZapUnusedHeapArea;)
duke@435 223 NOT_PRODUCT(if (UseSharedSpaces) ZapUnusedHeapArea = false;)
duke@435 224
duke@435 225 // Commit the memory behind the shared spaces if dumping (not
duke@435 226 // mapping).
duke@435 227 if (DumpSharedSpaces) {
duke@435 228 _ro_vs.initialize(ro_rs, spec()->read_only_size());
duke@435 229 _rw_vs.initialize(rw_rs, spec()->read_write_size());
duke@435 230 _md_vs.initialize(md_rs, spec()->misc_data_size());
duke@435 231 _mc_vs.initialize(mc_rs, spec()->misc_code_size());
duke@435 232 }
duke@435 233
duke@435 234 // Allocate the shared spaces.
duke@435 235 _ro_bts = new BlockOffsetSharedArray(
duke@435 236 MemRegion(readonly_bottom,
duke@435 237 heap_word_size(spec()->read_only_size())),
duke@435 238 heap_word_size(spec()->read_only_size()));
duke@435 239 _ro_space = new OffsetTableContigSpace(_ro_bts,
duke@435 240 MemRegion(readonly_bottom, readonly_end));
duke@435 241 _rw_bts = new BlockOffsetSharedArray(
duke@435 242 MemRegion(readwrite_bottom,
duke@435 243 heap_word_size(spec()->read_write_size())),
duke@435 244 heap_word_size(spec()->read_write_size()));
duke@435 245 _rw_space = new OffsetTableContigSpace(_rw_bts,
duke@435 246 MemRegion(readwrite_bottom, readwrite_end));
duke@435 247
duke@435 248 // Restore mangling flag.
duke@435 249 NOT_PRODUCT(ZapUnusedHeapArea = old_ZapUnusedHeapArea;)
duke@435 250
duke@435 251 if (_ro_space == NULL || _rw_space == NULL)
duke@435 252 vm_exit_during_initialization("Could not allocate a shared space");
duke@435 253
duke@435 254 // Cover both shared spaces entirely with cards.
duke@435 255 _rs->resize_covered_region(MemRegion(readonly_bottom, readwrite_end));
duke@435 256
duke@435 257 if (UseSharedSpaces) {
duke@435 258
duke@435 259 // Map in the regions in the shared file.
duke@435 260 FileMapInfo* mapinfo = FileMapInfo::current_info();
duke@435 261 size_t image_alignment = mapinfo->alignment();
duke@435 262 CollectedHeap* ch = Universe::heap();
duke@435 263 if ((!mapinfo->map_space(ro, ro_rs, _ro_space)) ||
duke@435 264 (!mapinfo->map_space(rw, rw_rs, _rw_space)) ||
duke@435 265 (!mapinfo->map_space(md, md_rs, NULL)) ||
duke@435 266 (!mapinfo->map_space(mc, mc_rs, NULL)) ||
duke@435 267 // check the alignment constraints
duke@435 268 (ch == NULL || ch->kind() != CollectedHeap::GenCollectedHeap ||
duke@435 269 image_alignment !=
duke@435 270 ((GenCollectedHeap*)ch)->gen_policy()->max_alignment())) {
duke@435 271 // Base addresses didn't match; skip sharing, but continue
duke@435 272 shared_rs.release();
duke@435 273 spec()->disable_sharing();
duke@435 274 // If -Xshare:on is specified, print out the error message and exit VM,
duke@435 275 // otherwise, set UseSharedSpaces to false and continue.
duke@435 276 if (RequireSharedSpaces) {
duke@435 277 vm_exit_during_initialization("Unable to use shared archive.", NULL);
duke@435 278 } else {
duke@435 279 FLAG_SET_DEFAULT(UseSharedSpaces, false);
duke@435 280 }
duke@435 281
duke@435 282 // Note: freeing the block offset array objects does not
duke@435 283 // currently free up the underlying storage.
duke@435 284 delete _ro_bts;
duke@435 285 _ro_bts = NULL;
duke@435 286 delete _ro_space;
duke@435 287 _ro_space = NULL;
duke@435 288 delete _rw_bts;
duke@435 289 _rw_bts = NULL;
duke@435 290 delete _rw_space;
duke@435 291 _rw_space = NULL;
duke@435 292 shared_end = (HeapWord*)(rs.base() + rs.size());
duke@435 293 _rs->resize_covered_region(MemRegion(shared_bottom, shared_bottom));
duke@435 294 }
duke@435 295 }
duke@435 296
duke@435 297 // Reserved region includes shared spaces for oop.is_in_reserved().
duke@435 298 _reserved.set_end(shared_end);
duke@435 299
duke@435 300 } else {
duke@435 301 _ro_space = NULL;
duke@435 302 _rw_space = NULL;
duke@435 303 }
duke@435 304 }
duke@435 305
duke@435 306
duke@435 307 // Do a complete scan of the shared read write space to catch all
duke@435 308 // objects which contain references to any younger generation. Forward
duke@435 309 // the pointers. Avoid space_iterate, as actually visiting all the
duke@435 310 // objects in the space will page in more objects than we need.
duke@435 311 // Instead, use the system dictionary as strong roots into the read
duke@435 312 // write space.
dcubed@482 313 //
dcubed@482 314 // If a RedefineClasses() call has been made, then we have to iterate
dcubed@482 315 // over the entire shared read-write space in order to find all the
dcubed@482 316 // objects that need to be forwarded. For example, it is possible for
dcubed@482 317 // an nmethod to be found and marked in GC phase-1 only for the nmethod
dcubed@482 318 // to be freed by the time we reach GC phase-3. The underlying method
dcubed@482 319 // is still marked, but we can't (easily) find it in GC phase-3 so we
dcubed@482 320 // blow up in GC phase-4. With RedefineClasses() we want replaced code
dcubed@482 321 // (EMCP or obsolete) to go away (i.e., be collectible) once it is no
dcubed@482 322 // longer being executed by any thread so we keep minimal attachments
dcubed@482 323 // to the replaced code. However, we can't guarantee when those EMCP
dcubed@482 324 // or obsolete methods will be collected so they may still be out there
dcubed@482 325 // even after we've severed our minimal attachments.
duke@435 326
duke@435 327 void CompactingPermGenGen::pre_adjust_pointers() {
duke@435 328 if (spec()->enable_shared_spaces()) {
dcubed@482 329 if (JvmtiExport::has_redefined_a_class()) {
dcubed@482 330 // RedefineClasses() requires a brute force approach
dcubed@482 331 AdjustSharedObjectClosure blk;
dcubed@482 332 rw_space()->object_iterate(&blk);
dcubed@482 333 } else {
dcubed@482 334 RecursiveAdjustSharedObjectClosure blk;
dcubed@482 335 Universe::oops_do(&blk);
dcubed@482 336 StringTable::oops_do(&blk);
dcubed@482 337 SystemDictionary::always_strong_classes_do(&blk);
dcubed@482 338 TraversePlaceholdersClosure tpc;
dcubed@482 339 SystemDictionary::placeholders_do(&tpc);
dcubed@482 340 }
duke@435 341 }
duke@435 342 }
duke@435 343
duke@435 344
duke@435 345 #ifdef ASSERT
duke@435 346 class VerifyMarksClearedClosure : public ObjectClosure {
duke@435 347 public:
duke@435 348 void do_object(oop obj) {
duke@435 349 assert(SharedSkipVerify || !obj->mark()->is_marked(),
duke@435 350 "Shared oop still marked?");
duke@435 351 }
duke@435 352 };
duke@435 353 #endif
duke@435 354
duke@435 355
duke@435 356 void CompactingPermGenGen::post_compact() {
duke@435 357 #ifdef ASSERT
duke@435 358 if (!SharedSkipVerify && spec()->enable_shared_spaces()) {
duke@435 359 VerifyMarksClearedClosure blk;
duke@435 360 rw_space()->object_iterate(&blk);
duke@435 361 }
duke@435 362 #endif
duke@435 363 }
duke@435 364
duke@435 365
ysr@1486 366 // Do not use in time-critical operations due to the possibility of paging
ysr@1486 367 // in otherwise untouched or previously unread portions of the perm gen,
ysr@1486 368 // for instance, the shared spaces. NOTE: Because CompactingPermGenGen
ysr@1486 369 // derives from OneContigSpaceCardGeneration which is supposed to have a
ysr@1486 370 // single space, and does not override its object_iterate() method,
ysr@1486 371 // object iteration via that interface does not look at the objects in
ysr@1486 372 // the shared spaces when using CDS. This should be fixed; see CR 6897798.
duke@435 373 void CompactingPermGenGen::space_iterate(SpaceClosure* blk, bool usedOnly) {
duke@435 374 OneContigSpaceCardGeneration::space_iterate(blk, usedOnly);
duke@435 375 if (spec()->enable_shared_spaces()) {
duke@435 376 // Making the rw_space walkable will page in the entire space, and
ysr@1486 377 // is to be avoided in the case of time-critical operations.
ysr@1486 378 // However, this is required for Verify and heap dump operations.
duke@435 379 blk->do_space(ro_space());
duke@435 380 blk->do_space(rw_space());
duke@435 381 }
duke@435 382 }
duke@435 383
duke@435 384
duke@435 385 void CompactingPermGenGen::print_on(outputStream* st) const {
duke@435 386 OneContigSpaceCardGeneration::print_on(st);
duke@435 387 if (spec()->enable_shared_spaces()) {
duke@435 388 st->print(" ro");
duke@435 389 ro_space()->print_on(st);
duke@435 390 st->print(" rw");
duke@435 391 rw_space()->print_on(st);
duke@435 392 } else {
duke@435 393 st->print_cr("No shared spaces configured.");
duke@435 394 }
duke@435 395 }
duke@435 396
duke@435 397
duke@435 398 // References from the perm gen to the younger generation objects may
duke@435 399 // occur in static fields in Java classes or in constant pool references
duke@435 400 // to String objects.
duke@435 401
duke@435 402 void CompactingPermGenGen::younger_refs_iterate(OopsInGenClosure* blk) {
duke@435 403 OneContigSpaceCardGeneration::younger_refs_iterate(blk);
duke@435 404 if (spec()->enable_shared_spaces()) {
duke@435 405 blk->set_generation(this);
duke@435 406 // ro_space has no younger gen refs.
duke@435 407 _rs->younger_refs_in_space_iterate(rw_space(), blk);
duke@435 408 blk->reset_generation();
duke@435 409 }
duke@435 410 }
duke@435 411
duke@435 412
duke@435 413 // Shared spaces are addressed in pre_adjust_pointers.
duke@435 414 void CompactingPermGenGen::adjust_pointers() {
duke@435 415 the_space()->adjust_pointers();
duke@435 416 }
duke@435 417
duke@435 418
duke@435 419 void CompactingPermGenGen::compact() {
duke@435 420 the_space()->compact();
duke@435 421 }
duke@435 422
duke@435 423
duke@435 424 size_t CompactingPermGenGen::contiguous_available() const {
duke@435 425 // Don't include shared spaces.
duke@435 426 return OneContigSpaceCardGeneration::contiguous_available()
duke@435 427 - _shared_space_size;
duke@435 428 }
duke@435 429
duke@435 430 size_t CompactingPermGenGen::max_capacity() const {
duke@435 431 // Don't include shared spaces.
duke@435 432 assert(UseSharedSpaces || (_shared_space_size == 0),
duke@435 433 "If not used, the size of shared spaces should be 0");
duke@435 434 return OneContigSpaceCardGeneration::max_capacity()
duke@435 435 - _shared_space_size;
duke@435 436 }
duke@435 437
duke@435 438
duke@435 439 // No young generation references, clear this generation's main space's
duke@435 440 // card table entries. Do NOT clear the card table entries for the
duke@435 441 // read-only space (always clear) or the read-write space (valuable
duke@435 442 // information).
duke@435 443
duke@435 444 void CompactingPermGenGen::clear_remembered_set() {
duke@435 445 _rs->clear(MemRegion(the_space()->bottom(), the_space()->end()));
duke@435 446 }
duke@435 447
duke@435 448
duke@435 449 // Objects in this generation's main space may have moved, invalidate
duke@435 450 // that space's cards. Do NOT invalidate the card table entries for the
duke@435 451 // read-only or read-write spaces, as those objects never move.
duke@435 452
duke@435 453 void CompactingPermGenGen::invalidate_remembered_set() {
duke@435 454 _rs->invalidate(used_region());
duke@435 455 }
duke@435 456
duke@435 457
duke@435 458 void CompactingPermGenGen::verify(bool allow_dirty) {
duke@435 459 the_space()->verify(allow_dirty);
duke@435 460 if (!SharedSkipVerify && spec()->enable_shared_spaces()) {
duke@435 461 ro_space()->verify(allow_dirty);
duke@435 462 rw_space()->verify(allow_dirty);
duke@435 463 }
duke@435 464 }
duke@435 465
duke@435 466
duke@435 467 HeapWord* CompactingPermGenGen::unshared_bottom;
duke@435 468 HeapWord* CompactingPermGenGen::unshared_end;
duke@435 469 HeapWord* CompactingPermGenGen::shared_bottom;
duke@435 470 HeapWord* CompactingPermGenGen::shared_end;
duke@435 471 HeapWord* CompactingPermGenGen::readonly_bottom;
duke@435 472 HeapWord* CompactingPermGenGen::readonly_end;
duke@435 473 HeapWord* CompactingPermGenGen::readwrite_bottom;
duke@435 474 HeapWord* CompactingPermGenGen::readwrite_end;
duke@435 475 HeapWord* CompactingPermGenGen::miscdata_bottom;
duke@435 476 HeapWord* CompactingPermGenGen::miscdata_end;
duke@435 477 HeapWord* CompactingPermGenGen::misccode_bottom;
duke@435 478 HeapWord* CompactingPermGenGen::misccode_end;
duke@435 479
duke@435 480 // JVM/TI RedefineClasses() support:
duke@435 481 bool CompactingPermGenGen::remap_shared_readonly_as_readwrite() {
duke@435 482 assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
duke@435 483
duke@435 484 if (UseSharedSpaces) {
duke@435 485 // remap the shared readonly space to shared readwrite, private
duke@435 486 FileMapInfo* mapinfo = FileMapInfo::current_info();
duke@435 487 if (!mapinfo->remap_shared_readonly_as_readwrite()) {
duke@435 488 return false;
duke@435 489 }
duke@435 490 }
duke@435 491 return true;
duke@435 492 }
duke@435 493
duke@435 494 void** CompactingPermGenGen::_vtbl_list;

mercurial