7197906: BlockOffsetArray::power_to_cards_back() needs to handle > 32 bit shifts
Reviewed-by: brutisso, johnc, ysr
Contributed-by: Hal Mo <kungu.mjh@taobao.com>
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Fri Sep 14 22:00:41 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Sep 13 21:20:26 2012 +0200
@@ -110,7 +110,7 @@
#ifndef PRODUCT
bool CMBitMapRO::covers(ReservedSpace rs) const {
// assert(_bm.map() == _virtual_space.low(), "map inconsistency");
- assert(((size_t)_bm.size() * (size_t)(1 << _shifter)) == _bmWordSize,
+ assert(((size_t)_bm.size() * ((size_t)1 << _shifter)) == _bmWordSize,
"size inconsistency");
return _bmStartWord == (HeapWord*)(rs.base()) &&
_bmWordSize == rs.size()>>LogHeapWordSize;
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Fri Sep 14 22:00:41 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Thu Sep 13 21:20:26 2012 +0200
@@ -273,7 +273,7 @@
if (_max_fine_entries == 0) {
assert(_mod_max_fine_entries_mask == 0, "Both or none.");
size_t max_entries_log = (size_t)log2_long((jlong)G1RSetRegionEntries);
- _max_fine_entries = (size_t)(1 << max_entries_log);
+ _max_fine_entries = (size_t)1 << max_entries_log;
_mod_max_fine_entries_mask = _max_fine_entries - 1;
assert(_fine_eviction_sample_size == 0
--- a/hotspot/src/share/vm/memory/blockOffsetTable.hpp Fri Sep 14 22:00:41 2012 -0700
+++ b/hotspot/src/share/vm/memory/blockOffsetTable.hpp Thu Sep 13 21:20:26 2012 +0200
@@ -285,7 +285,7 @@
};
static size_t power_to_cards_back(uint i) {
- return (size_t)(1 << (LogBase * i));
+ return (size_t)1 << (LogBase * i);
}
static size_t power_to_words_back(uint i) {
return power_to_cards_back(i) * N_words;