Lines Matching refs:Unique
47 // Creating a Unique<T> requires first dereferencing the handle to obtain
55 class Unique V8_FINAL {
58 explicit Unique(Handle<T> handle) {
62 // This is a best-effort check to prevent comparing Unique<T>'s created
66 // assurance is required for creating a Unique<Map>.
75 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
76 Unique(Address raw_address, Handle<T> handle)
80 // Eg. Unique<JSFunction> can be passed when Unique<Object> is expected.
81 template <class S> Unique(Unique<S> uniq) {
93 inline bool operator==(const Unique<U>& other) const {
99 inline bool operator!=(const Unique<U>& other) const {
123 template <class S> static Unique<T> cast(Unique<S> that) {
124 return Unique<T>(that.raw_address_, Handle<T>::cast(that.handle_));
131 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
132 static Unique<T> CreateUninitialized(Handle<T> handle) {
133 return Unique<T>(reinterpret_cast<Address>(NULL), handle);
136 static Unique<T> CreateImmovable(Handle<T> handle) {
137 return Unique<T>(reinterpret_cast<Address>(*handle), handle);
142 friend class Unique; // For comparing raw_address values.
156 // Add a new element to this unique set. Mutates this set. O(|this|).
157 void Add(Unique<T> uniq, Zone* zone) {
159 // Keep the set sorted by the {raw_address} of the unique elements.
177 void Remove(Unique<T> uniq) {
199 bool Contains(Unique<U> elem) const {
211 Unique<T> sought = this->array_[i];
231 Unique<T> a = this->array_[i];
232 Unique<T> b = that->array_[j];
259 Unique<T> a = this->array_[i];
260 Unique<T> b = that->array_[j];
286 copy->array_ = zone->NewArray<Unique<T> >(this->size_);
287 memcpy(copy->array_, this->array_, this->size_ * sizeof(Unique<T>));
299 inline Unique<T> at(int index) const {
311 Unique<T>* array_;
319 Unique<T>* new_array = zone->NewArray<Unique<T> >(new_capacity);
321 memcpy(new_array, array_, size_ * sizeof(Unique<T>));