8024914: Swapped usage of idx_t and bm_word_t types in bitMap.inline.hpp

Tue, 17 Sep 2013 12:04:11 +0200

author
tschatzl
date
Tue, 17 Sep 2013 12:04:11 +0200
changeset 5713
17deed6716af
parent 5712
f9b58dbeab91
child 5715
fac394091d73

8024914: Swapped usage of idx_t and bm_word_t types in bitMap.inline.hpp
Summary: Incorrect usage of idx_t where bm_word_t is appropriate.
Reviewed-by: tschatzl, brutisso
Contributed-by: Dan Horak <dhorak@redhat.com>

src/share/vm/utilities/bitMap.inline.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/utilities/bitMap.inline.hpp	Mon Sep 16 13:32:44 2013 +0200
     1.2 +++ b/src/share/vm/utilities/bitMap.inline.hpp	Tue Sep 17 12:04:11 2013 +0200
     1.3 @@ -52,16 +52,16 @@
     1.4  
     1.5  inline bool BitMap::par_set_bit(idx_t bit) {
     1.6    verify_index(bit);
     1.7 -  volatile idx_t* const addr = word_addr(bit);
     1.8 -  const idx_t mask = bit_mask(bit);
     1.9 -  idx_t old_val = *addr;
    1.10 +  volatile bm_word_t* const addr = word_addr(bit);
    1.11 +  const bm_word_t mask = bit_mask(bit);
    1.12 +  bm_word_t old_val = *addr;
    1.13  
    1.14    do {
    1.15 -    const idx_t new_val = old_val | mask;
    1.16 +    const bm_word_t new_val = old_val | mask;
    1.17      if (new_val == old_val) {
    1.18        return false;     // Someone else beat us to it.
    1.19      }
    1.20 -    const idx_t cur_val = (idx_t) Atomic::cmpxchg_ptr((void*) new_val,
    1.21 +    const bm_word_t cur_val = (bm_word_t) Atomic::cmpxchg_ptr((void*) new_val,
    1.22                                                        (volatile void*) addr,
    1.23                                                        (void*) old_val);
    1.24      if (cur_val == old_val) {
    1.25 @@ -73,16 +73,16 @@
    1.26  
    1.27  inline bool BitMap::par_clear_bit(idx_t bit) {
    1.28    verify_index(bit);
    1.29 -  volatile idx_t* const addr = word_addr(bit);
    1.30 -  const idx_t mask = ~bit_mask(bit);
    1.31 -  idx_t old_val = *addr;
    1.32 +  volatile bm_word_t* const addr = word_addr(bit);
    1.33 +  const bm_word_t mask = ~bit_mask(bit);
    1.34 +  bm_word_t old_val = *addr;
    1.35  
    1.36    do {
    1.37 -    const idx_t new_val = old_val & mask;
    1.38 +    const bm_word_t new_val = old_val & mask;
    1.39      if (new_val == old_val) {
    1.40        return false;     // Someone else beat us to it.
    1.41      }
    1.42 -    const idx_t cur_val = (idx_t) Atomic::cmpxchg_ptr((void*) new_val,
    1.43 +    const bm_word_t cur_val = (bm_word_t) Atomic::cmpxchg_ptr((void*) new_val,
    1.44                                                        (volatile void*) addr,
    1.45                                                        (void*) old_val);
    1.46      if (cur_val == old_val) {

mercurial