Lines Matching refs:Handle
26 // Base class for Handle instantiations. Don't use directly.
32 // Check if this handle refers to the exact same object as the other handle.
73 // A Handle provides a reference to an object that survives relocation by
76 // Handles are only valid within a HandleScope. When a handle is created
81 // semantics is ambiguous between Handle location and object identity. Instead
84 class Handle final : public HandleBase {
86 V8_INLINE explicit Handle(T** location = nullptr)
93 V8_INLINE explicit Handle(T* object) : Handle(object, object->GetIsolate()) {}
94 V8_INLINE Handle(T* object, Isolate* isolate) : HandleBase(object, isolate) {}
96 // Allocate a new handle for the object, do not canonicalize.
97 V8_INLINE static Handle<T> New(T* object, Isolate* isolate);
100 // Ex. Handle<JSFunction> can be passed when Handle<Object> is expected.
102 V8_INLINE Handle(Handle<S> handle)
103 : HandleBase(handle) {
123 static const Handle<T> cast(Handle<S> that) {
125 return Handle<T>(reinterpret_cast<T**>(that.location_));
130 static const Handle<T> null() { return Handle<T>(); }
133 struct equal_to : public std::binary_function<Handle<T>, Handle<T>, bool> {
134 V8_INLINE bool operator()(Handle<T> lhs, Handle<T> rhs) const {
140 struct hash : public std::unary_function<Handle<T>, size_t> {
141 V8_INLINE size_t operator()(Handle<T> const& handle) const {
142 return base::hash<void*>()(handle.location());
149 friend class Handle;
156 inline std::ostream& operator<<(std::ostream& os, Handle<T> handle);
159 V8_INLINE Handle<T> handle(T* object, Isolate* isolate) {
160 return Handle<T>(object, isolate);
164 V8_INLINE Handle<T> handle(T* object) {
165 return Handle<T>(object);
170 // A Handle can be converted into a MaybeHandle. Converting a MaybeHandle
171 // into a Handle requires checking that it does not point to NULL. This
176 // semantics is ambiguous between Handle location and object identity.
183 // Constructor for handling automatic up casting from Handle.
184 // Ex. Handle<JSArray> can be passed when MaybeHandle<Object> is expected.
186 V8_INLINE MaybeHandle(Handle<S> handle)
187 : location_(reinterpret_cast<T**>(handle.location_)) {
195 // Ex. MaybeHandle<JSArray> can be passed when Handle<Object> is expected.
208 V8_INLINE Handle<T> ToHandleChecked() const {
210 return Handle<T>(location_);
213 // Convert to a Handle with a type that can be upcasted to.
215 V8_INLINE bool ToHandle(Handle<S>* out) const {
217 *out = Handle<T>::null();
220 *out = Handle<T>(location_);
239 // After a handle scope has been created, all local handles will be
240 // allocated within that handle scope until either the handle scope is
241 // deleted or another handle scope is created. If there is already a
242 // handle scope and a new one is created, all allocations will take
243 // place in the new handle scope until it is deleted. After that,
244 // new handles will again be allocated in the original handle scope.
246 // After the handle scope of a local handle has been deleted the
248 // handle and may deallocate it. The behavior of accessing a handle
249 // for which the handle scope has been deleted is undefined.
259 // Create a new handle or lookup a canonical handle.
262 // Creates a new handle with the given value.
274 // a Handle backed by the parent scope holding the
275 // value of the argument handle.
277 Handle<T> CloseAndEscape(Handle<T> handle_value);
281 // Limit for number of handles with --check-handle-count. This is
287 // Prevent heap allocation or illegal handle scopes.
297 // Close the handle scope resetting limits to a previous state.
302 // Extend the handle scope making room for more handles.
341 // Ordinary nested handle scopes within the current one are not canonical.