Lines Matching full:handle
13 // A Handle can be converted into a MaybeHandle. Converting a MaybeHandle
14 // into a Handle requires checking that it does not point to NULL. This
23 // Constructor for handling automatic up casting from Handle.
24 // Ex. Handle<JSArray> can be passed when MaybeHandle<Object> is expected.
25 template <class S> MaybeHandle(Handle<S> handle) {
32 this->location_ = reinterpret_cast<T**>(handle.location());
36 // Ex. MaybeHandle<JSArray> can be passed when Handle<Object> is expected.
50 INLINE(Handle<T> ToHandleChecked()) const {
52 return Handle<T>(location_);
55 // Convert to a Handle with a type that can be upcasted to.
56 template <class S> INLINE(bool ToHandle(Handle<S>* out)) {
58 *out = Handle<T>::null();
61 *out = Handle<T>(location_);
77 // A Handle provides a reference to an object that survives relocation by
80 // When a handle is created for an object a cell is allocated in the heap.
83 class Handle {
85 INLINE(explicit Handle(T** location)) { location_ = location; }
86 INLINE(explicit Handle(T* obj));
87 INLINE(Handle(T* obj, Isolate* isolate));
91 INLINE(Handle()) : location_(NULL) { }
94 // Ex. Handle<JSFunction> can be passed when Handle<Object> is expected.
95 template <class S> Handle(Handle<S> handle) {
102 location_ = reinterpret_cast<T**>(handle.location_);
107 // Check if this handle refers to the exact same object as the other handle.
108 INLINE(bool is_identical_to(const Handle<T> other) const);
116 template <class S> static Handle<T> cast(Handle<S> that) {
118 return Handle<T>(reinterpret_cast<T**>(that.location_));
123 static Handle<T> null() { return Handle<T>(); }
126 // Closes the given scope, but lets this handle escape. See
128 inline Handle<T> EscapeFrom(v8::EscapableHandleScope* scope);
140 template<class S> friend class Handle;
146 inline Handle<T> handle(T* t, Isolate* isolate) {
147 return Handle<T>(t, isolate);
153 inline Handle<T> handle(T* t) {
154 return Handle<T>(t, t->GetIsolate());
159 inline bool operator<(const Handle<Map>& lhs, const Handle<Map>& rhs) {
170 // After a handle scope has been created, all local handles will be
171 // allocated within that handle scope until either the handle scope is
172 // deleted or another handle scope is created. If there is already a
173 // handle scope and a new one is created, all allocations will take
174 // place in the new handle scope until it is deleted. After that,
175 // new handles will again be allocated in the original handle scope.
177 // After the handle scope of a local handle has been deleted the
179 // handle and may deallocate it. The behavior of accessing a handle
180 // for which the handle scope has been deleted is undefined.
190 // Creates a new handle with the given value.
203 // a Handle backed by the parent scope holding the
204 // value of the argument handle.
206 Handle<T> CloseAndEscape(Handle<T> handle_value);
211 // Prevent heap allocation or illegal handle scopes.
221 // Close the handle scope resetting limits to a previous state.
226 // Extend the handle scope making room for more handles.