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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally. | 123 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally. |
124 static Unique<T> CreateUninitialized(Handle<T> handle) { | 124 static Unique<T> CreateUninitialized(Handle<T> handle) { |
125 return Unique<T>(NULL, handle); | 125 return Unique<T>(NULL, handle); |
126 } | 126 } |
127 | 127 |
128 static Unique<T> CreateImmovable(Handle<T> handle) { | 128 static Unique<T> CreateImmovable(Handle<T> handle) { |
129 return Unique<T>(reinterpret_cast<Address>(*handle), handle); | 129 return Unique<T>(reinterpret_cast<Address>(*handle), handle); |
130 } | 130 } |
131 | 131 |
| 132 T* GetRawAddress() const { |
| 133 DCHECK(IsInitialized()); |
| 134 return reinterpret_cast<T*>(raw_address_); |
| 135 } |
| 136 |
132 friend class UniqueSet<T>; // Uses internal details for speed. | 137 friend class UniqueSet<T>; // Uses internal details for speed. |
133 template <class U> | 138 template <class U> |
134 friend class Unique; // For comparing raw_address values. | 139 friend class Unique; // For comparing raw_address values. |
135 | 140 |
136 protected: | 141 protected: |
137 Address raw_address_; | 142 Address raw_address_; |
138 Handle<T> handle_; | 143 Handle<T> handle_; |
139 | 144 |
140 friend class SideEffectsTracker; | 145 friend class SideEffectsTracker; |
141 }; | 146 }; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 } | 360 } |
356 capacity_ = new_capacity; | 361 capacity_ = new_capacity; |
357 array_ = new_array; | 362 array_ = new_array; |
358 } | 363 } |
359 } | 364 } |
360 }; | 365 }; |
361 | 366 |
362 } } // namespace v8::internal | 367 } } // namespace v8::internal |
363 | 368 |
364 #endif // V8_HYDROGEN_UNIQUE_H_ | 369 #endif // V8_HYDROGEN_UNIQUE_H_ |
OLD | NEW |