| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/bit_vector.h" | 5 #include "vm/bit_vector.h" |
| 6 | 6 |
| 7 #include "vm/os.h" | 7 #include "vm/os.h" |
| 8 | 8 |
| 9 namespace dart { | 9 namespace dart { |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 // Skip zero bits. | 27 // Skip zero bits. |
| 28 while ((current_word_ & 0x1) == 0) { | 28 while ((current_word_ & 0x1) == 0) { |
| 29 current_word_ >>= 1; | 29 current_word_ >>= 1; |
| 30 ++bit_index_; | 30 ++bit_index_; |
| 31 } | 31 } |
| 32 current_word_ = current_word_ >> 1; | 32 current_word_ = current_word_ >> 1; |
| 33 } | 33 } |
| 34 | 34 |
| 35 | 35 |
| 36 bool BitVector::AddAll(BitVector* from) { |
| 37 ASSERT(data_length_ == from->data_length_); |
| 38 bool changed = false; |
| 39 for (intptr_t i = 0; i < data_length_; i++) { |
| 40 const uword before = data_[i]; |
| 41 const uword after = data_[i] | from->data_[i]; |
| 42 if (before != after) changed = true; |
| 43 data_[i] = after; |
| 44 } |
| 45 return changed; |
| 46 } |
| 47 |
| 48 |
| 49 bool BitVector::KillAndAdd(BitVector* kill, BitVector* gen) { |
| 50 ASSERT(data_length_ == kill->data_length_); |
| 51 ASSERT(data_length_ == gen->data_length_); |
| 52 bool changed = false; |
| 53 for (intptr_t i = 0; i < data_length_; i++) { |
| 54 const uword before = data_[i]; |
| 55 const uword after = data_[i] | (gen->data_[i] & ~kill->data_[i]); |
| 56 if (before != after) changed = true; |
| 57 data_[i] = after; |
| 58 } |
| 59 return changed; |
| 60 } |
| 61 |
| 62 |
| 36 } // namespace dart | 63 } // namespace dart |
| OLD | NEW |