| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 while (i < this->size_) out->array_[k++] = this->array_[i++]; | 274 while (i < this->size_) out->array_[k++] = this->array_[i++]; |
| 275 while (j < that->size_) out->array_[k++] = that->array_[j++]; | 275 while (j < that->size_) out->array_[k++] = that->array_[j++]; |
| 276 | 276 |
| 277 out->size_ = k; | 277 out->size_ = k; |
| 278 return out; | 278 return out; |
| 279 } | 279 } |
| 280 | 280 |
| 281 // Makes an exact copy of this set. O(|this| + |that|). | 281 // Makes an exact copy of this set. O(|this|). |
| 282 UniqueSet<T>* Copy(Zone* zone) const { | 282 UniqueSet<T>* Copy(Zone* zone) const { |
| 283 UniqueSet<T>* copy = new(zone) UniqueSet<T>(); | 283 UniqueSet<T>* copy = new(zone) UniqueSet<T>(); |
| 284 copy->size_ = this->size_; | 284 copy->size_ = this->size_; |
| 285 copy->capacity_ = this->size_; | 285 copy->capacity_ = this->size_; |
| 286 copy->array_ = zone->NewArray<Unique<T> >(this->size_); | 286 copy->array_ = zone->NewArray<Unique<T> >(this->size_); |
| 287 memcpy(copy->array_, this->array_, this->size_ * sizeof(Unique<T>)); | 287 memcpy(copy->array_, this->array_, this->size_ * sizeof(Unique<T>)); |
| 288 return copy; | 288 return copy; |
| 289 } | 289 } |
| 290 | 290 |
| 291 void Clear() { | 291 void Clear() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 capacity_ = new_capacity; | 323 capacity_ = new_capacity; |
| 324 array_ = new_array; | 324 array_ = new_array; |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 | 329 |
| 330 } } // namespace v8::internal | 330 } } // namespace v8::internal |
| 331 | 331 |
| 332 #endif // V8_HYDROGEN_UNIQUE_H_ | 332 #endif // V8_HYDROGEN_UNIQUE_H_ |
| OLD | NEW |