Home | History | Annotate | Download | only in crankshaft

Lines Matching refs:Unique

27 // Creating a Unique<T> requires first dereferencing the handle to obtain
35 class Unique final {
37 Unique<T>() : raw_address_(NULL) {}
40 explicit Unique(Handle<T> handle) {
44 // This is a best-effort check to prevent comparing Unique<T>'s created
48 // assurance is required for creating a Unique<Map>.
58 // Eg. Unique<JSFunction> can be passed when Unique<Object> is expected.
59 template <class S> Unique(Unique<S> uniq) {
71 inline bool operator==(const Unique<U>& other) const {
77 inline bool operator!=(const Unique<U>& other) const {
82 friend inline size_t hash_value(Unique<T> const& unique) {
83 DCHECK(unique.IsInitialized());
84 return base::hash<void*>()(unique.raw_address_);
106 template <class S> static Unique<T> cast(Unique<S> that) {
111 return Unique<T>(that.raw_address_,
119 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
120 static Unique<T> CreateUninitialized(Handle<T> handle) {
121 return Unique<T>(NULL, handle);
124 static Unique<T> CreateImmovable(Handle<T> handle) {
125 return Unique<T>(reinterpret_cast<Address>(*handle), handle);
129 Unique(Address raw_address, Handle<T> handle)
137 friend class Unique; // For comparing raw_address values.
141 inline std::ostream& operator<<(std::ostream& os, Unique<T> uniq) {
155 array_(zone->NewArray<Unique<T> >(capacity)) {
160 UniqueSet(Unique<T> uniq, Zone* zone)
161 : size_(1), capacity_(1), array_(zone->NewArray<Unique<T> >(1)) {
165 // Add a new element to this unique set. Mutates this set. O(|this|).
166 void Add(Unique<T> uniq, Zone* zone) {
168 // Keep the set sorted by the {raw_address} of the unique elements.
186 void Remove(Unique<T> uniq) {
208 bool Contains(const Unique<U> elem) const {
210 Unique<T> cand = this->array_[i];
223 Unique<T> sought = this->array_[i];
243 Unique<T> a = this->array_[i];
244 Unique<T> b = that->array_[j];
271 Unique<T> a = this->array_[i];
272 Unique<T> b = that->array_[j];
302 Unique<T> cand = this->array_[i];
317 memcpy(copy->array_, this->array_, this->size_ * sizeof(Unique<T>));
329 inline Unique<T> at(int index) const {
341 Unique<T>* array_;
349 Unique<T>* new_array = zone->NewArray<Unique<T> >(new_capacity);
351 memcpy(new_array, array_, size_ * sizeof(Unique<T>));