--- old/src/share/vm/gc_implementation/g1/concurrentMark.hpp 2015-04-21 14:30:19.892090121 +0200 +++ new/src/share/vm/gc_implementation/g1/concurrentMark.hpp 2015-04-21 14:30:19.835088471 +0200 @@ -139,6 +139,11 @@ static size_t compute_size(size_t heap_size); // Returns the amount of bytes on the heap between two marks in the bitmap. static size_t mark_distance(); + // Returns how many bytes (or bits) of the heap a single byte (or bit) of the + // mark bitmap corresponds to. This is the same as the mark distance above. + static size_t heap_map_factor() { + return mark_distance(); + } CMBitMap() : CMBitMapRO(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); } --- old/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp 2015-04-21 14:30:20.240100195 +0200 +++ new/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp 2015-04-21 14:30:20.182098516 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -179,6 +179,11 @@ return ReservedSpace::allocation_align_size_up(number_of_slots); } + // Returns how many bytes of the heap a single byte of the BOT corresponds to. + static size_t heap_map_factor() { + return N_bytes; + } + enum SomePublicConstants { LogN = 9, LogN_words = LogN - LogHeapWordSize, --- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2015-04-21 14:30:20.601110646 +0200 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2015-04-21 14:30:20.535108735 +0200 @@ -1895,24 +1895,24 @@ G1RegionToSpaceMapper* bot_storage = create_aux_memory_mapper("Block offset table", G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize), - G1BlockOffsetSharedArray::N_bytes); + G1BlockOffsetSharedArray::heap_map_factor()); ReservedSpace cardtable_rs(G1SATBCardTableLoggingModRefBS::compute_size(g1_rs.size() / HeapWordSize)); G1RegionToSpaceMapper* cardtable_storage = create_aux_memory_mapper("Card table", G1SATBCardTableLoggingModRefBS::compute_size(g1_rs.size() / HeapWordSize), - G1BlockOffsetSharedArray::N_bytes); + G1SATBCardTableLoggingModRefBS::heap_map_factor()); G1RegionToSpaceMapper* card_counts_storage = create_aux_memory_mapper("Card counts table", G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize), - G1BlockOffsetSharedArray::N_bytes); + G1BlockOffsetSharedArray::heap_map_factor()); size_t bitmap_size = CMBitMap::compute_size(g1_rs.size()); G1RegionToSpaceMapper* prev_bitmap_storage = - create_aux_memory_mapper("Prev Bitmap", bitmap_size, CMBitMap::mark_distance()); + create_aux_memory_mapper("Prev Bitmap", bitmap_size, CMBitMap::heap_map_factor()); G1RegionToSpaceMapper* next_bitmap_storage = - create_aux_memory_mapper("Next Bitmap", bitmap_size, CMBitMap::mark_distance()); + create_aux_memory_mapper("Next Bitmap", bitmap_size, CMBitMap::heap_map_factor()); _hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage); g1_barrier_set()->initialize(cardtable_storage); --- old/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp 2015-04-21 14:30:21.021122805 +0200 +++ new/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp 2015-04-21 14:30:20.955120894 +0200 @@ -25,6 +25,7 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP #define SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP +#include "gc_implementation/g1/g1BlockOffsetTable.hpp" #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp" #include "memory/cardTableModRefBS.hpp" #include "memory/memRegion.hpp" @@ -153,6 +154,11 @@ return ReservedSpace::allocation_align_size_up(number_of_slots); } + // Returns how many bytes of the heap a single byte of the Card Table corresponds to. + static size_t heap_map_factor() { + return G1BlockOffsetSharedArray::heap_map_factor(); + } + G1SATBCardTableLoggingModRefBS(MemRegion whole_heap); virtual void initialize() { }