--- old/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp 2014-08-14 13:40:20.762482653 +0200 +++ new/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp 2014-08-14 13:40:20.677480155 +0200 @@ -35,7 +35,7 @@ void G1BlockOffsetSharedArrayMappingChangedListener::on_commit(uint start_idx, size_t num_regions) { // Nothing to do. The BOT is hard-wired to be part of the HeapRegion, and we cannot // retrieve it here since this would cause firing of several asserts. The code - // exacuted after commit of a region already needs to do some re-initialization of + // executed after commit of a region already needs to do some re-initialization of // the HeapRegion, so we combine that. } --- old/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp 2014-08-14 13:40:21.237496610 +0200 +++ new/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp 2014-08-14 13:40:21.157494259 +0200 @@ -49,8 +49,7 @@ #define check_index(index, msg) \ assert((index) < (_reserved.word_size() >> LogN_words), \ - err_msg("%s - " \ - "index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT, \ + err_msg("%s - index: "SIZE_FORMAT", _vs.committed_size: "SIZE_FORMAT, \ msg, (index), (_reserved.word_size() >> LogN_words))); \ assert(G1CollectedHeap::heap()->is_in_exact(address_for_index_raw(index)), \ err_msg("Index "SIZE_FORMAT" corresponding to "PTR_FORMAT \ --- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-08-14 13:40:21.721510831 +0200 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-08-14 13:40:21.620507864 +0200 @@ -2003,7 +2003,6 @@ HeapRegion::GrainBytes, G1BlockOffsetSharedArray::N_bytes, mtGC); - g1_barrier_set()->initialize(cardtable_storage); // Reserve space for the card counts table. ReservedSpace card_counts_rs(G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize)); @@ -2034,7 +2033,7 @@ mtGC); _hrs.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage); - + g1_barrier_set()->initialize(cardtable_storage); // Do later initialization work for concurrent refinement. _cg1r->init(card_counts_storage); --- old/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp 2014-08-14 13:40:22.307528050 +0200 +++ new/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp 2014-08-14 13:40:22.217525405 +0200 @@ -52,8 +52,11 @@ size_t _pages_per_region; public: - G1RegionsLargerThanCommitSizeMapper(ReservedSpace rs, size_t os_commit_granularity, - size_t alloc_granularity, size_t commit_factor, MemoryType type) : + G1RegionsLargerThanCommitSizeMapper(ReservedSpace rs, + size_t os_commit_granularity, + size_t alloc_granularity, + size_t commit_factor, + MemoryType type) : G1RegionToSpaceMapper(rs, os_commit_granularity, alloc_granularity, type), _pages_per_region(alloc_granularity / (os_commit_granularity * commit_factor)) { @@ -93,10 +96,10 @@ public: G1RegionsSmallerThanCommitSizeMapper(ReservedSpace rs, - size_t os_commit_granularity, - size_t alloc_granularity, - size_t commit_factor, - MemoryType type) : + size_t os_commit_granularity, + size_t alloc_granularity, + size_t commit_factor, + MemoryType type) : G1RegionToSpaceMapper(rs, os_commit_granularity, alloc_granularity, type), _regions_per_page((os_commit_granularity * commit_factor) / alloc_granularity), _refcounts() { @@ -141,7 +144,10 @@ } G1RegionToSpaceMapper* G1RegionToSpaceMapper::create_mapper(ReservedSpace rs, - size_t os_commit_granularity, size_t region_granularity, size_t commit_factor, MemoryType type) { + size_t os_commit_granularity, + size_t region_granularity, + size_t commit_factor, + MemoryType type) { if (region_granularity >= (os_commit_granularity * commit_factor)) { return new G1RegionsLargerThanCommitSizeMapper(rs, os_commit_granularity, region_granularity, commit_factor, type); --- old/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp 2014-08-14 13:40:22.795542389 +0200 +++ new/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp 2014-08-14 13:40:22.699539568 +0200 @@ -30,6 +30,8 @@ class G1MappingChangedListener VALUE_OBJ_CLASS_SPEC { public: + // Fired after commit of the memory, i.e. the memory this listener is registered + // for can be accessed. virtual void on_commit(uint start_idx, size_t num_regions) = 0; }; @@ -65,6 +67,11 @@ virtual void commit_regions(uintptr_t start_idx, size_t num_regions = 1) = 0; virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions = 1) = 0; + // Creates an appropriate G1RegionToSpaceMapper for the given parameters. + // The byte_translation_factor defines how many bytes in a region correspond to + // a single byte in the data structure this mapper is for. + // Eg. in the card table, this value corresponds to the size a single card + // table entry corresponds to. static G1RegionToSpaceMapper* create_mapper(ReservedSpace rs, size_t os_commit_granularity, size_t region_granularity,