comparison src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents dde53abda3d6
children f81a7c0c618d
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
87 // a mismash of precise marks and beginning of object marks. This means 87 // a mismash of precise marks and beginning of object marks. This means
88 // we test for missing precise marks first. If any are found, we don't 88 // we test for missing precise marks first. If any are found, we don't
89 // fail unless the object head is also unmarked. 89 // fail unless the object head is also unmarked.
90 virtual void do_object(oop obj) { 90 virtual void do_object(oop obj) {
91 CheckForUnmarkedOops object_check(_young_gen, _card_table); 91 CheckForUnmarkedOops object_check(_young_gen, _card_table);
92 obj->oop_iterate(&object_check); 92 obj->oop_iterate_no_header(&object_check);
93 if (object_check.has_unmarked_oop()) { 93 if (object_check.has_unmarked_oop()) {
94 assert(_card_table->addr_is_marked_imprecise(obj), "Found unmarked young_gen object"); 94 assert(_card_table->addr_is_marked_imprecise(obj), "Found unmarked young_gen object");
95 } 95 }
96 } 96 }
97 }; 97 };
227 uint stripe_total) { 227 uint stripe_total) {
228 int ssize = 128; // Naked constant! Work unit = 64k. 228 int ssize = 128; // Naked constant! Work unit = 64k.
229 int dirty_card_count = 0; 229 int dirty_card_count = 0;
230 230
231 oop* sp_top = (oop*)space_top; 231 oop* sp_top = (oop*)space_top;
232 oop* sp_last = sp->bottom() == space_top ? sp_top : sp_top - 1;
232 jbyte* start_card = byte_for(sp->bottom()); 233 jbyte* start_card = byte_for(sp->bottom());
233 jbyte* end_card = byte_for(sp_top - 1) + 1; 234 jbyte* end_card = byte_for(sp_last) + 1;
234 oop* last_scanned = NULL; // Prevent scanning objects more than once 235 oop* last_scanned = NULL; // Prevent scanning objects more than once
235 // The width of the stripe ssize*stripe_total must be 236 // The width of the stripe ssize*stripe_total must be
236 // consistent with the number of stripes so that the complete slice 237 // consistent with the number of stripes so that the complete slice
237 // is covered. 238 // is covered.
238 size_t slice_width = ssize * stripe_total; 239 size_t slice_width = ssize * stripe_total;
404 405
405 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); 406 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
406 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); 407 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
407 408
408 PSOldGen* old_gen = heap->old_gen(); 409 PSOldGen* old_gen = heap->old_gen();
409 PSPermGen* perm_gen = heap->perm_gen();
410 410
411 old_gen->object_iterate(&check); 411 old_gen->object_iterate(&check);
412 perm_gen->object_iterate(&check);
413 } 412 }
414 413
415 // This should be called immediately after a scavenge, before mutators resume. 414 // This should be called immediately after a scavenge, before mutators resume.
416 void CardTableExtension::verify_all_young_refs_precise() { 415 void CardTableExtension::verify_all_young_refs_precise() {
417 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); 416 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
418 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); 417 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
419 418
420 PSOldGen* old_gen = heap->old_gen(); 419 PSOldGen* old_gen = heap->old_gen();
421 PSPermGen* perm_gen = heap->perm_gen();
422 420
423 CheckForPreciseMarks check(heap->young_gen(), (CardTableExtension*)heap->barrier_set()); 421 CheckForPreciseMarks check(heap->young_gen(), (CardTableExtension*)heap->barrier_set());
424 422
425 old_gen->oop_iterate(&check); 423 old_gen->oop_iterate_no_header(&check);
426 perm_gen->oop_iterate(&check);
427 424
428 verify_all_young_refs_precise_helper(old_gen->object_space()->used_region()); 425 verify_all_young_refs_precise_helper(old_gen->object_space()->used_region());
429 verify_all_young_refs_precise_helper(perm_gen->object_space()->used_region());
430 } 426 }
431 427
432 void CardTableExtension::verify_all_young_refs_precise_helper(MemRegion mr) { 428 void CardTableExtension::verify_all_young_refs_precise_helper(MemRegion mr) {
433 CardTableExtension* card_table = (CardTableExtension*)Universe::heap()->barrier_set(); 429 CardTableExtension* card_table = (CardTableExtension*)Universe::heap()->barrier_set();
434 // FIX ME ASSERT HERE 430 // FIX ME ASSERT HERE