annotate src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp @ 196:d1605aabd0a1

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents ba764ed4b6f2
children c18cbe5936b8
rev   line source
duke@0 1 /*
xdono@196 2 * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
duke@0 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 21 * have any questions.
duke@0 22 *
duke@0 23 */
duke@0 24
duke@0 25 class MutableSpace;
duke@0 26 class ObjectStartArray;
duke@0 27 class PSPromotionManager;
duke@0 28 class GCTaskQueue;
duke@0 29
duke@0 30 class CardTableExtension : public CardTableModRefBS {
duke@0 31 private:
duke@0 32 // Support methods for resizing the card table.
duke@0 33 void resize_commit_uncommit(int changed_region, MemRegion new_region);
duke@0 34 void resize_update_card_table_entries(int changed_region,
duke@0 35 MemRegion new_region);
duke@0 36 void resize_update_committed_table(int changed_region, MemRegion new_region);
duke@0 37 void resize_update_covered_table(int changed_region, MemRegion new_region);
duke@0 38
duke@0 39 protected:
duke@0 40
duke@0 41 static void verify_all_young_refs_precise_helper(MemRegion mr);
duke@0 42
duke@0 43 public:
duke@0 44 enum ExtendedCardValue {
duke@0 45 youngergen_card = CardTableModRefBS::CT_MR_BS_last_reserved + 1,
duke@0 46 verify_card = CardTableModRefBS::CT_MR_BS_last_reserved + 5
duke@0 47 };
duke@0 48
duke@0 49 CardTableExtension(MemRegion whole_heap, int max_covered_regions) :
duke@0 50 CardTableModRefBS(whole_heap, max_covered_regions) { }
duke@0 51
duke@0 52 // Too risky for the 4/10/02 putback
duke@0 53 // BarrierSet::Name kind() { return BarrierSet::CardTableExtension; }
duke@0 54
duke@0 55 // Scavenge support
duke@0 56 void scavenge_contents(ObjectStartArray* start_array,
duke@0 57 MutableSpace* sp,
duke@0 58 HeapWord* space_top,
duke@0 59 PSPromotionManager* pm);
duke@0 60
duke@0 61 void scavenge_contents_parallel(ObjectStartArray* start_array,
duke@0 62 MutableSpace* sp,
duke@0 63 HeapWord* space_top,
duke@0 64 PSPromotionManager* pm,
duke@0 65 uint stripe_number);
duke@0 66
duke@0 67 // Verification
duke@0 68 static void verify_all_young_refs_imprecise();
duke@0 69 static void verify_all_young_refs_precise();
duke@0 70
duke@0 71 bool addr_is_marked_imprecise(void *addr);
duke@0 72 bool addr_is_marked_precise(void *addr);
duke@0 73
duke@0 74 void set_card_newgen(void* addr) { jbyte* p = byte_for(addr); *p = verify_card; }
duke@0 75
duke@0 76 // Testers for entries
duke@0 77 static bool card_is_dirty(int value) { return value == dirty_card; }
duke@0 78 static bool card_is_newgen(int value) { return value == youngergen_card; }
duke@0 79 static bool card_is_clean(int value) { return value == clean_card; }
duke@0 80 static bool card_is_verify(int value) { return value == verify_card; }
duke@0 81
duke@0 82 // Card marking
coleenp@113 83 void inline_write_ref_field_gc(void* field, oop new_val) {
duke@0 84 jbyte* byte = byte_for(field);
duke@0 85 *byte = youngergen_card;
duke@0 86 }
duke@0 87
duke@0 88 // Adaptive size policy support
duke@0 89 // Allows adjustment of the base and size of the covered regions
duke@0 90 void resize_covered_region(MemRegion new_region);
duke@0 91 // Finds the covered region to resize based on the start address
duke@0 92 // of the covered regions.
duke@0 93 void resize_covered_region_by_start(MemRegion new_region);
duke@0 94 // Finds the covered region to resize based on the end address
duke@0 95 // of the covered regions.
duke@0 96 void resize_covered_region_by_end(int changed_region, MemRegion new_region);
duke@0 97 // Finds the lowest start address of a covered region that is
duke@0 98 // previous (i.e., lower index) to the covered region with index "ind".
duke@0 99 HeapWord* lowest_prev_committed_start(int ind) const;
duke@0 100
duke@0 101 #ifdef ASSERT
duke@0 102
duke@0 103 bool is_valid_card_address(jbyte* addr) {
duke@0 104 return (addr >= _byte_map) && (addr < _byte_map + _byte_map_size);
duke@0 105 }
duke@0 106
duke@0 107 #endif // ASSERT
duke@0 108 };