# HG changeset patch # User ehelin # Date 1416309002 0 # Node ID e6eb4f61a1c0d593a1f2bf08735b0acd4837895c # Parent f91c482793e6c4e04db6bd69740c3e5e53adedef# Parent 3a6367d7110b8ef2076e162696f8337de6fd4008 Merge diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Nov 18 11:10:02 2014 +0000 @@ -1888,7 +1888,7 @@ initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size())); // Create the gen rem set (and barrier set) for the entire reserved region. - _rem_set = collector_policy()->create_rem_set(reserved_region(), 2); + _rem_set = collector_policy()->create_rem_set(reserved_region()); set_barrier_set(rem_set()->bs()); if (!barrier_set()->is_a(BarrierSet::G1SATBCTLogging)) { vm_exit_during_initialization("G1 requires a G1SATBLoggingCardTableModRefBS"); diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp Tue Nov 18 11:10:02 2014 +0000 @@ -32,9 +32,8 @@ #include "runtime/orderAccess.inline.hpp" #include "runtime/thread.inline.hpp" -G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, - int max_covered_regions) : - CardTableModRefBSForCTRS(whole_heap, max_covered_regions) +G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap) : + CardTableModRefBSForCTRS(whole_heap) { _kind = G1SATBCT; } @@ -132,9 +131,8 @@ } G1SATBCardTableLoggingModRefBS:: -G1SATBCardTableLoggingModRefBS(MemRegion whole_heap, - int max_covered_regions) : - G1SATBCardTableModRefBS(whole_heap, max_covered_regions), +G1SATBCardTableLoggingModRefBS(MemRegion whole_heap) : + G1SATBCardTableModRefBS(whole_heap), _dcqs(JavaThread::dirty_card_queue_set()), _listener() { diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -50,8 +50,7 @@ // pre-marking object graph. static void enqueue(oop pre_val); - G1SATBCardTableModRefBS(MemRegion whole_heap, - int max_covered_regions); + G1SATBCardTableModRefBS(MemRegion whole_heap); bool is_a(BarrierSet::Name bsn) { return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn); @@ -152,8 +151,7 @@ return ReservedSpace::allocation_align_size_up(number_of_slots); } - G1SATBCardTableLoggingModRefBS(MemRegion whole_heap, - int max_covered_regions); + G1SATBCardTableLoggingModRefBS(MemRegion whole_heap); virtual void initialize() { } virtual void initialize(G1RegionToSpaceMapper* mapper); diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -53,8 +53,8 @@ verify_card = CardTableModRefBS::CT_MR_BS_last_reserved + 5 }; - CardTableExtension(MemRegion whole_heap, int max_covered_regions) : - CardTableModRefBS(whole_heap, max_covered_regions) { } + CardTableExtension(MemRegion whole_heap) : + CardTableModRefBS(whole_heap) { } // Too risky for the 4/10/02 putback // BarrierSet::Name kind() { return BarrierSet::CardTableExtension; } diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Tue Nov 18 11:10:02 2014 +0000 @@ -76,7 +76,7 @@ initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size())); - CardTableExtension* const barrier_set = new CardTableExtension(reserved_region(), 3); + CardTableExtension* const barrier_set = new CardTableExtension(reserved_region()); barrier_set->initialize(); _barrier_set = barrier_set; oopDesc::set_bs(_barrier_set); diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/barrierSet.hpp --- a/hotspot/src/share/vm/memory/barrierSet.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/barrierSet.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -49,7 +49,12 @@ TargetUninitialized = 1 }; protected: - int _max_covered_regions; + // Some barrier sets create tables whose elements correspond to parts of + // the heap; the CardTableModRefBS is an example. Such barrier sets will + // normally reserve space for such tables, and commit parts of the table + // "covering" parts of the heap that are committed. At most one covered + // region per generation is needed. + static const int _max_covered_regions = 2; Name _kind; public: @@ -159,18 +164,6 @@ protected: virtual void write_region_work(MemRegion mr) = 0; public: - - // Some barrier sets create tables whose elements correspond to parts of - // the heap; the CardTableModRefBS is an example. Such barrier sets will - // normally reserve space for such tables, and commit parts of the table - // "covering" parts of the heap that are committed. The constructor is - // passed the maximum number of independently committable subregions to - // be covered, and the "resize_covered_region" function allows the - // sub-parts of the heap to inform the barrier set of changes of their - // sizes. - BarrierSet(int max_covered_regions) : - _max_covered_regions(max_covered_regions) {} - // Inform the BarrierSet that the the covered heap region that starts // with "base" has been changed to have the given size (possibly from 0, // for initialization.) diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/cardTableModRefBS.cpp --- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp Tue Nov 18 11:10:02 2014 +0000 @@ -53,9 +53,8 @@ return align_size_up(_guard_index + 1, MAX2(_page_size, granularity)); } -CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, - int max_covered_regions): - ModRefBarrierSet(max_covered_regions), +CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) : + ModRefBarrierSet(), _whole_heap(whole_heap), _guard_index(0), _guard_region(), diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/cardTableModRefBS.hpp --- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -284,7 +284,7 @@ return bsn == BarrierSet::CardTableModRef || ModRefBarrierSet::is_a(bsn); } - CardTableModRefBS(MemRegion whole_heap, int max_covered_regions); + CardTableModRefBS(MemRegion whole_heap); ~CardTableModRefBS(); virtual void initialize(); @@ -482,9 +482,8 @@ bool card_will_be_scanned(jbyte cv); bool card_may_have_been_dirty(jbyte cv); public: - CardTableModRefBSForCTRS(MemRegion whole_heap, - int max_covered_regions) : - CardTableModRefBS(whole_heap, max_covered_regions) {} + CardTableModRefBSForCTRS(MemRegion whole_heap) : + CardTableModRefBS(whole_heap) {} void set_CTRS(CardTableRS* rs) { _rs = rs; } }; diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/cardTableRS.cpp --- a/hotspot/src/share/vm/memory/cardTableRS.cpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/cardTableRS.cpp Tue Nov 18 11:10:02 2014 +0000 @@ -38,21 +38,18 @@ #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" #endif // INCLUDE_ALL_GCS -CardTableRS::CardTableRS(MemRegion whole_heap, - int max_covered_regions) : +CardTableRS::CardTableRS(MemRegion whole_heap) : GenRemSet(), - _cur_youngergen_card_val(youngergenP1_card), - _regions_to_iterate(max_covered_regions - 1) + _cur_youngergen_card_val(youngergenP1_card) { #if INCLUDE_ALL_GCS if (UseG1GC) { - _ct_bs = new G1SATBCardTableLoggingModRefBS(whole_heap, - max_covered_regions); + _ct_bs = new G1SATBCardTableLoggingModRefBS(whole_heap); } else { - _ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions); + _ct_bs = new CardTableModRefBSForCTRS(whole_heap); } #else - _ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions); + _ct_bs = new CardTableModRefBSForCTRS(whole_heap); #endif _ct_bs->initialize(); set_bs(_ct_bs); diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/cardTableRS.hpp --- a/hotspot/src/share/vm/memory/cardTableRS.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/cardTableRS.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -83,7 +83,8 @@ jbyte _cur_youngergen_card_val; - int _regions_to_iterate; + // Number of generations, plus one for lingering PermGen issues in CardTableRS. + static const int _regions_to_iterate = 3; jbyte cur_youngergen_card_val() { return _cur_youngergen_card_val; @@ -101,7 +102,7 @@ jbyte find_unused_youngergenP_card_value(); public: - CardTableRS(MemRegion whole_heap, int max_covered_regions); + CardTableRS(MemRegion whole_heap); ~CardTableRS(); // *** GenRemSet functions. diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/collectorPolicy.cpp --- a/hotspot/src/share/vm/memory/collectorPolicy.cpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp Tue Nov 18 11:10:02 2014 +0000 @@ -152,9 +152,8 @@ return result; } -GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, - int max_covered_regions) { - return new CardTableRS(whole_heap, max_covered_regions); +GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap) { + return new CardTableRS(whole_heap); } void CollectorPolicy::cleared_all_soft_refs() { diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/collectorPolicy.hpp --- a/hotspot/src/share/vm/memory/collectorPolicy.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/collectorPolicy.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -152,10 +152,7 @@ virtual BarrierSet::Name barrier_set_name() = 0; - // Create the remembered set (to cover the given reserved region, - // allowing breaking up into at most "max_covered_regions"). - virtual GenRemSet* create_rem_set(MemRegion reserved, - int max_covered_regions); + virtual GenRemSet* create_rem_set(MemRegion reserved); // This method controls how a collector satisfies a request // for a block of memory. "gc_time_limit_was_exceeded" will diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/genCollectedHeap.cpp --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp Tue Nov 18 11:10:02 2014 +0000 @@ -109,13 +109,11 @@ char* heap_address; size_t total_reserved = 0; - int n_covered_regions = 0; ReservedSpace heap_rs; size_t heap_alignment = collector_policy()->heap_alignment(); - heap_address = allocate(heap_alignment, &total_reserved, - &n_covered_regions, &heap_rs); + heap_address = allocate(heap_alignment, &total_reserved, &heap_rs); if (!heap_rs.is_reserved()) { vm_shutdown_during_initialization( @@ -125,7 +123,7 @@ initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size())); - _rem_set = collector_policy()->create_rem_set(reserved_region(), n_covered_regions); + _rem_set = collector_policy()->create_rem_set(reserved_region()); set_barrier_set(rem_set()->bs()); _gch = this; @@ -152,14 +150,12 @@ char* GenCollectedHeap::allocate(size_t alignment, size_t* _total_reserved, - int* _n_covered_regions, ReservedSpace* heap_rs){ const char overflow_msg[] = "The size of the object heap + VM data exceeds " "the maximum representable size"; // Now figure out the total size. size_t total_reserved = 0; - int n_covered_regions = 0; const size_t pageSize = UseLargePages ? os::large_page_size() : os::vm_page_size(); @@ -170,18 +166,12 @@ if (total_reserved < _gen_specs[i]->max_size()) { vm_exit_during_initialization(overflow_msg); } - n_covered_regions += _gen_specs[i]->n_covered_regions(); } assert(total_reserved % alignment == 0, err_msg("Gen size; total_reserved=" SIZE_FORMAT ", alignment=" SIZE_FORMAT, total_reserved, alignment)); - // Needed until the cardtable is fixed to have the right number - // of covered regions. - n_covered_regions += 2; - *_total_reserved = total_reserved; - *_n_covered_regions = n_covered_regions; *heap_rs = Universe::reserve_heap(total_reserved, alignment); return heap_rs->base(); diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/genCollectedHeap.hpp --- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -121,9 +121,7 @@ // Returns JNI_OK on success virtual jint initialize(); - char* allocate(size_t alignment, - size_t* _total_reserved, int* _n_covered_regions, - ReservedSpace* heap_rs); + char* allocate(size_t alignment, size_t* _total_reserved, ReservedSpace* heap_rs); // Does operations required after initialization has been done. void post_initialize(); diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/generationSpec.hpp --- a/hotspot/src/share/vm/memory/generationSpec.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/generationSpec.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -59,10 +59,6 @@ set_init_size(align_size_up(init_size(), alignment)); set_max_size(align_size_up(max_size(), alignment)); } - - // Return the number of regions contained in the generation which - // might need to be independently covered by a remembered set. - virtual int n_covered_regions() const { return 1; } }; typedef GenerationSpec* GenerationSpecPtr; diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/memory/modRefBarrierSet.hpp --- a/hotspot/src/share/vm/memory/modRefBarrierSet.hpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/memory/modRefBarrierSet.hpp Tue Nov 18 11:10:02 2014 +0000 @@ -95,10 +95,6 @@ // The caller guarantees that "mr" contains no references. (Perhaps it's // objects have been moved elsewhere.) virtual void clear(MemRegion mr) = 0; - - // Pass along the argument to the superclass. - ModRefBarrierSet(int max_covered_regions) : - BarrierSet(max_covered_regions) {} }; #endif // SHARE_VM_MEMORY_MODREFBARRIERSET_HPP diff -r f91c482793e6 -r e6eb4f61a1c0 hotspot/src/share/vm/runtime/vmStructs.cpp --- a/hotspot/src/share/vm/runtime/vmStructs.cpp Tue Nov 18 10:23:26 2014 +0100 +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Tue Nov 18 11:10:02 2014 +0000 @@ -473,7 +473,6 @@ \ unchecked_nonstatic_field(ageTable, sizes, sizeof(ageTable::sizes)) \ \ - nonstatic_field(BarrierSet, _max_covered_regions, int) \ nonstatic_field(BarrierSet, _kind, BarrierSet::Name) \ nonstatic_field(BlockOffsetTable, _bottom, HeapWord*) \ nonstatic_field(BlockOffsetTable, _end, HeapWord*) \