| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 ? new(zone) BitVector(1, zone) | 208 ? new(zone) BitVector(1, zone) |
| 209 : target->bits_) { } | 209 : target->bits_) { } |
| 210 bool Done() const { return it_.Done(); } | 210 bool Done() const { return it_.Done(); } |
| 211 void Advance() { it_.Advance(); } | 211 void Advance() { it_.Advance(); } |
| 212 int Current() const { return it_.Current(); } | 212 int Current() const { return it_.Current(); } |
| 213 private: | 213 private: |
| 214 BitVector::Iterator it_; | 214 BitVector::Iterator it_; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 GrowableBitVector() : bits_(NULL) { } | 217 GrowableBitVector() : bits_(NULL) { } |
| 218 GrowableBitVector(int length, Zone* zone) | |
| 219 : bits_(new(zone) BitVector(length, zone)) { } | |
| 220 | 218 |
| 221 bool Contains(int value) const { | 219 bool Contains(int value) const { |
| 222 if (!InBitsRange(value)) return false; | 220 if (!InBitsRange(value)) return false; |
| 223 return bits_->Contains(value); | 221 return bits_->Contains(value); |
| 224 } | 222 } |
| 225 | 223 |
| 226 void Add(int value, Zone* zone) { | 224 void Add(int value, Zone* zone) { |
| 227 EnsureCapacity(value, zone); | 225 EnsureCapacity(value, zone); |
| 228 bits_->Add(value); | 226 bits_->Add(value); |
| 229 } | 227 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 253 } | 251 } |
| 254 | 252 |
| 255 BitVector* bits_; | 253 BitVector* bits_; |
| 256 }; | 254 }; |
| 257 | 255 |
| 258 | 256 |
| 259 } } // namespace v8::internal | 257 } } // namespace v8::internal |
| 260 | 258 |
| 261 | 259 |
| 262 #endif // V8_DATAFLOW_H_ | 260 #endif // V8_DATAFLOW_H_ |
| OLD | NEW |