6814552: par compact - some compilers fail to optimize bitmap code

Sun, 07 Jun 2009 22:08:24 -0700

author
jcoomes
date
Sun, 07 Jun 2009 22:08:24 -0700
changeset 1243
353ba4575581
parent 1242
d44bdab1c03d
child 1244
6e2afda171db

6814552: par compact - some compilers fail to optimize bitmap code
Reviewed-by: tonyp, iveresov, jmasa, ysr

src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp	Thu Jun 11 17:19:33 2009 -0700
     1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp	Sun Jun 07 22:08:24 2009 -0700
     1.3 @@ -177,6 +177,7 @@
     1.4    // are double-word aligned in 32-bit VMs, but not in 64-bit VMs, so the 32-bit
     1.5    // granularity is 2, 64-bit is 1.
     1.6    static inline size_t obj_granularity() { return size_t(MinObjAlignment); }
     1.7 +  static inline int obj_granularity_shift() { return LogMinObjAlignment; }
     1.8  
     1.9    HeapWord*       _region_start;
    1.10    size_t          _region_size;
    1.11 @@ -299,13 +300,13 @@
    1.12  inline size_t
    1.13  ParMarkBitMap::bits_to_words(idx_t bits)
    1.14  {
    1.15 -  return bits * obj_granularity();
    1.16 +  return bits << obj_granularity_shift();
    1.17  }
    1.18  
    1.19  inline ParMarkBitMap::idx_t
    1.20  ParMarkBitMap::words_to_bits(size_t words)
    1.21  {
    1.22 -  return words / obj_granularity();
    1.23 +  return words >> obj_granularity_shift();
    1.24  }
    1.25  
    1.26  inline size_t ParMarkBitMap::obj_size(idx_t beg_bit, idx_t end_bit) const

mercurial