| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_HYDROGEN_UNIQUE_H_ | 5 #ifndef V8_HYDROGEN_UNIQUE_H_ |
| 6 #define V8_HYDROGEN_UNIQUE_H_ | 6 #define V8_HYDROGEN_UNIQUE_H_ |
| 7 | 7 |
| 8 #include <ostream> // NOLINT(readability/streams) | 8 #include <ostream> // NOLINT(readability/streams) |
| 9 | 9 |
| 10 #include "src/base/functional.h" | 10 #include "src/base/functional.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 template <class S> static Unique<T> cast(Unique<S> that) { | 110 template <class S> static Unique<T> cast(Unique<S> that) { |
| 111 return Unique<T>(that.raw_address_, Handle<T>::cast(that.handle_)); | 111 return Unique<T>(that.raw_address_, Handle<T>::cast(that.handle_)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 inline bool IsInitialized() const { | 114 inline bool IsInitialized() const { |
| 115 return raw_address_ != NULL || handle_.is_null(); | 115 return raw_address_ != NULL || handle_.is_null(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally. | 118 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally. |
| 119 static Unique<T> CreateUninitialized(Handle<T> handle) { | 119 static Unique<T> CreateUninitialized(Handle<T> handle) { |
| 120 return Unique<T>(reinterpret_cast<Address>(NULL), handle); | 120 return Unique<T>(NULL, handle); |
| 121 } | 121 } |
| 122 | 122 |
| 123 static Unique<T> CreateImmovable(Handle<T> handle) { | 123 static Unique<T> CreateImmovable(Handle<T> handle) { |
| 124 return Unique<T>(reinterpret_cast<Address>(*handle), handle); | 124 return Unique<T>(reinterpret_cast<Address>(*handle), handle); |
| 125 } | 125 } |
| 126 | 126 |
| 127 friend class UniqueSet<T>; // Uses internal details for speed. | 127 friend class UniqueSet<T>; // Uses internal details for speed. |
| 128 template <class U> | 128 template <class U> |
| 129 friend class Unique; // For comparing raw_address values. | 129 friend class Unique; // For comparing raw_address values. |
| 130 | 130 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 350 } |
| 351 capacity_ = new_capacity; | 351 capacity_ = new_capacity; |
| 352 array_ = new_array; | 352 array_ = new_array; |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 }; | 355 }; |
| 356 | 356 |
| 357 } } // namespace v8::internal | 357 } } // namespace v8::internal |
| 358 | 358 |
| 359 #endif // V8_HYDROGEN_UNIQUE_H_ | 359 #endif // V8_HYDROGEN_UNIQUE_H_ |
| OLD | NEW |