OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_DATAFLOW_H_ | 5 #ifndef V8_DATAFLOW_H_ |
6 #define V8_DATAFLOW_H_ | 6 #define V8_DATAFLOW_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 return changed; | 130 return changed; |
131 } | 131 } |
132 | 132 |
133 void Intersect(const BitVector& other) { | 133 void Intersect(const BitVector& other) { |
134 DCHECK(other.length() == length()); | 134 DCHECK(other.length() == length()); |
135 for (int i = 0; i < data_length_; i++) { | 135 for (int i = 0; i < data_length_; i++) { |
136 data_[i] &= other.data_[i]; | 136 data_[i] &= other.data_[i]; |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
| 140 bool IntersectIsChanged(const BitVector& other) { |
| 141 DCHECK(other.length() == length()); |
| 142 bool changed = false; |
| 143 for (int i = 0; i < data_length_; i++) { |
| 144 uint32_t old_data = data_[i]; |
| 145 data_[i] &= other.data_[i]; |
| 146 if (data_[i] != old_data) changed = true; |
| 147 } |
| 148 return changed; |
| 149 } |
| 150 |
140 void Subtract(const BitVector& other) { | 151 void Subtract(const BitVector& other) { |
141 DCHECK(other.length() == length()); | 152 DCHECK(other.length() == length()); |
142 for (int i = 0; i < data_length_; i++) { | 153 for (int i = 0; i < data_length_; i++) { |
143 data_[i] &= ~other.data_[i]; | 154 data_[i] &= ~other.data_[i]; |
144 } | 155 } |
145 } | 156 } |
146 | 157 |
147 void Clear() { | 158 void Clear() { |
148 for (int i = 0; i < data_length_; i++) { | 159 for (int i = 0; i < data_length_; i++) { |
149 data_[i] = 0; | 160 data_[i] = 0; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 bits_ = new_bits; | 243 bits_ = new_bits; |
233 } | 244 } |
234 | 245 |
235 BitVector* bits_; | 246 BitVector* bits_; |
236 }; | 247 }; |
237 | 248 |
238 } // namespace internal | 249 } // namespace internal |
239 } // namespace v8 | 250 } // namespace v8 |
240 | 251 |
241 #endif // V8_DATAFLOW_H_ | 252 #endif // V8_DATAFLOW_H_ |
OLD | NEW |