src/share/vm/utilities/bitMap.cpp

changeset 3691
2a0172480595
parent 3156
f08d439fab8c
child 3900
d2a62e0f25eb
     1.1 --- a/src/share/vm/utilities/bitMap.cpp	Fri Mar 16 09:52:57 2012 +0100
     1.2 +++ b/src/share/vm/utilities/bitMap.cpp	Thu Apr 05 13:57:23 2012 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -179,64 +179,6 @@
    1.11    clear_range_within_word(bit_index(end_full_word), end);
    1.12  }
    1.13  
    1.14 -void BitMap::mostly_disjoint_range_union(BitMap* from_bitmap,
    1.15 -                                         idx_t   from_start_index,
    1.16 -                                         idx_t   to_start_index,
    1.17 -                                         size_t  word_num) {
    1.18 -  // Ensure that the parameters are correct.
    1.19 -  // These shouldn't be that expensive to check, hence I left them as
    1.20 -  // guarantees.
    1.21 -  guarantee(from_bitmap->bit_in_word(from_start_index) == 0,
    1.22 -            "it should be aligned on a word boundary");
    1.23 -  guarantee(bit_in_word(to_start_index) == 0,
    1.24 -            "it should be aligned on a word boundary");
    1.25 -  guarantee(word_num >= 2, "word_num should be at least 2");
    1.26 -
    1.27 -  intptr_t* from = (intptr_t*) from_bitmap->word_addr(from_start_index);
    1.28 -  intptr_t* to   = (intptr_t*) word_addr(to_start_index);
    1.29 -
    1.30 -  if (*from != 0) {
    1.31 -    // if it's 0, then there's no point in doing the CAS
    1.32 -    while (true) {
    1.33 -      intptr_t old_value = *to;
    1.34 -      intptr_t new_value = old_value | *from;
    1.35 -      intptr_t res       = Atomic::cmpxchg_ptr(new_value, to, old_value);
    1.36 -      if (res == old_value) break;
    1.37 -    }
    1.38 -  }
    1.39 -  ++from;
    1.40 -  ++to;
    1.41 -
    1.42 -  for (size_t i = 0; i < word_num - 2; ++i) {
    1.43 -    if (*from != 0) {
    1.44 -      // if it's 0, then there's no point in doing the CAS
    1.45 -      assert(*to == 0, "nobody else should be writing here");
    1.46 -      intptr_t new_value = *from;
    1.47 -      *to = new_value;
    1.48 -    }
    1.49 -
    1.50 -    ++from;
    1.51 -    ++to;
    1.52 -  }
    1.53 -
    1.54 -  if (*from != 0) {
    1.55 -    // if it's 0, then there's no point in doing the CAS
    1.56 -    while (true) {
    1.57 -      intptr_t old_value = *to;
    1.58 -      intptr_t new_value = old_value | *from;
    1.59 -      intptr_t res       = Atomic::cmpxchg_ptr(new_value, to, old_value);
    1.60 -      if (res == old_value) break;
    1.61 -    }
    1.62 -  }
    1.63 -
    1.64 -  // the -1 is because we didn't advance them after the final CAS
    1.65 -  assert(from ==
    1.66 -           (intptr_t*) from_bitmap->word_addr(from_start_index) + word_num - 1,
    1.67 -            "invariant");
    1.68 -  assert(to == (intptr_t*) word_addr(to_start_index) + word_num - 1,
    1.69 -            "invariant");
    1.70 -}
    1.71 -
    1.72  void BitMap::at_put(idx_t offset, bool value) {
    1.73    if (value) {
    1.74      set_bit(offset);

mercurial