Lines Matching full:unique
25 // Creating a Unique<T> requires first dereferencing the handle to obtain
33 class Unique {
35 Unique<T>() : raw_address_(NULL) {}
38 explicit Unique(Handle<T> handle) {
42 // This is a best-effort check to prevent comparing Unique<T>'s created
46 // assurance is required for creating a Unique<Map>.
55 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
56 Unique(Address raw_address, Handle<T> handle)
60 // Eg. Unique<JSFunction> can be passed when Unique<Object> is expected.
61 template <class S> Unique(Unique<S> uniq) {
73 inline bool operator==(const Unique<U>& other) const {
79 inline bool operator!=(const Unique<U>& other) const {
103 template <class S> static Unique<T> cast(Unique<S> that) {
104 return Unique<T>(that.raw_address_, Handle<T>::cast(that.handle_));
111 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
112 static Unique<T> CreateUninitialized(Handle<T> handle) {
113 return Unique<T>(reinterpret_cast<Address>(NULL), handle);
116 static Unique<T> CreateImmovable(Handle<T> handle) {
117 return Unique<T>(reinterpret_cast<Address>(*handle), handle);
122 friend class Unique; // For comparing raw_address values.
141 array_(zone->NewArray<Unique<T> >(capacity)) {
146 UniqueSet(Unique<T> uniq, Zone* zone)
147 : size_(1), capacity_(1), array_(zone->NewArray<Unique<T> >(1)) {
151 // Add a new element to this unique set. Mutates this set. O(|this|).
152 void Add(Unique<T> uniq, Zone* zone) {
154 // Keep the set sorted by the {raw_address} of the unique elements.
172 void Remove(Unique<T> uniq) {
194 bool Contains(const Unique<U> elem) const {
196 Unique<T> cand = this->array_[i];
209 Unique<T> sought = this->array_[i];
229 Unique<T> a = this->array_[i];
230 Unique<T> b = that->array_[j];
257 Unique<T> a = this->array_[i];
258 Unique<T> b = that->array_[j];
288 Unique<T> cand = this->array_[i];
303 memcpy(copy->array_, this->array_, this->size_ * sizeof(Unique<T>));
315 inline Unique<T> at(int index) const {
327 Unique<T>* array_;
335 Unique<T>* new_array = zone->NewArray<Unique<T> >(new_capacity);
337 memcpy(new_array, array_, size_ * sizeof(Unique<T>));