Home | History | Annotate | Download | only in include

Lines Matching refs:Handle

146 template <class T> class Handle;
246 * It is safe to extract the object stored in the handle by
247 * dereferencing the handle (for instance, to extract the Object* from
248 * a Handle<Object>); the value will still be governed by a handle
252 template <class T> class Handle {
255 * Creates an empty handle.
257 V8_INLINE(Handle()) : val_(0) {}
261 * Creates a new handle for the specified value.
263 V8_INLINE(explicit Handle(T* val)) : val_(val) {}
267 * Creates a handle for the contents of the specified handle. This
270 * incompatible handles, for instance from a Handle<String> to a
271 * Handle<Number> it will cause a compile-time error. Assigning
273 * Handle<String> to a variable declared as Handle<Value>, is legal
276 template <class S> V8_INLINE(Handle(Handle<S> that))
280 * handles. For example, converting from a Handle<String> to a
281 * Handle<Number>.
287 * Returns true if the handle is empty.
292 * Sets the handle to be empty. IsEmpty() will then return true.
306 template <class S> V8_INLINE(bool operator==(const Handle<S> that) const) {
331 template <class S> V8_INLINE(bool operator!=(Handle<S> that) const) {
335 template <class S> V8_INLINE(static Handle<T> Cast(Handle<S> that)) {
338 // that the handle isn't empty before doing the checked cast.
339 if (that.IsEmpty()) return Handle<T>();
341 return Handle<T>(T::Cast(*that));
344 template <class S> V8_INLINE(Handle<S> As()) {
345 return Handle<S>::Cast(*this);
349 V8_INLINE(static Handle<T> New(Isolate* isolate, Handle<T> that)) {
353 V8_INLINE(static Handle<T> New(Isolate* isolate, const Persistent<T>& that)) {
362 * Creates a new handle for the specified value.
364 V8_INLINE(explicit Handle(T* val)) : val_(val) {}
376 friend Handle<Primitive> Undefined(Isolate* isolate);
377 friend Handle<Primitive> Null(Isolate* isolate);
378 friend Handle<Boolean> True(Isolate* isolate);
379 friend Handle<Boolean> False(Isolate* isolate);
384 V8_INLINE(static Handle<T> New(Isolate* isolate, T* that));
397 * A light-weight stack-allocated object handle. All operations
400 * handle scope are destroyed when the handle scope is destroyed. Hence it
404 template <class T> class Local : public Handle<T> {
408 : Handle<T>(reinterpret_cast<T*>(*that)) {
411 * handles. For example, converting from a Handle<String> to a
412 * Handle<Number>.
419 template <class S> V8_INLINE(Local(S* that) : Handle<T>(that)) { }
425 // that the handle isn't empty before doing the checked cast.
431 template <class S> V8_INLINE(Local(Handle<S> that))
432 : Handle<T>(reinterpret_cast<T*>(*that)) {
447 * Create a local handle for the content of another handle.
448 * The referee is kept alive by the local handle even when
449 * the original handle is destroyed/disposed.
451 V8_INLINE(static Local<T> New(Handle<T> that));
452 V8_INLINE(static Local<T> New(Isolate* isolate, Handle<T> that));
461 template <class S> V8_INLINE(Local(S* that) : Handle<T>(that)) { }
467 template<class F> friend class Handle;
482 * An object reference that is independent of any handle scope. Where
483 * a Local handle only lives as long as the HandleScope in which it was
484 * allocated, a Persistent handle remains valid until it is explicitly
487 * A persistent handle contains a reference to a storage cell within
492 * are passed by value you may have many persistent handle objects
494 * persistent handle as an argument to a function you will not get two
500 : public Handle<T> {
513 // The handle should either be 0, or a pointer to a live cell.
518 * to the copy constructor, this creates a new persistent handle which needs
521 template <class S> V8_INLINE(Persistent(Isolate* isolate, Handle<S> that))
530 * Creates an empty persistent handle that doesn't point to any
533 V8_INLINE(Persistent()) : Handle<T>() { }
536 * Creates a persistent handle for the same storage cell as the
537 * specified handle. This constructor allows you to pass persistent
547 : Handle<T>(reinterpret_cast<T*>(*that)) {
550 * handles. For example, converting from a Handle<String> to a
551 * Handle<Number>.
556 template <class S> V8_INLINE(Persistent(S* that)) : Handle<T>(that) { }
560 * to the copy constructor, this creates a new persistent handle which needs
563 template <class S> V8_INLINE(Persistent(Isolate* isolate, Handle<S> that))
564 : Handle<T>(New(isolate, that)) { }
567 * "Casts" a plain handle which is known to be a persistent handle
568 * to a persistent handle.
570 template <class S> explicit V8_INLINE(Persistent(Handle<S> that))
571 : Handle<T>(*that) { }
579 // that the handle isn't empty before doing the checked cast.
594 // that the handle isn't empty before doing the checked cast.
606 V8_DEPRECATED(static Persistent<T> New(Handle<T> that));
607 V8_INLINE(static Persistent<T> New(Isolate* isolate, Handle<T> that));
621 template <class S> V8_INLINE(bool operator==(const Handle<S> that) const) {
633 * Releases the storage cell referenced by this persistent handle.
635 * This handle's reference, and any other references to the storage
677 * independent handle should not assume that it will be preceded by a global
707 /** Checks if the handle holds the only reference to an object. */
713 /** Returns true if the handle's reference is weak. */
720 * Assigns a wrapper class ID to the handle. See RetainedObjectInfo interface
731 * Returns the class ID previously assigned to this handle or 0 if no class ID
742 * Disposes the current contents of the handle and replaces it.
744 V8_INLINE(void Reset(Isolate* isolate, const Handle<T>& other));
751 * Returns the underlying raw pointer and clears the handle. The caller is
753 * Persistent handle which points to it and Disposing it). In the future,
790 template<class F> friend class Handle;
805 * After a handle scope has been created, all local handles will be
806 * allocated within that handle scope until either the handle scope is
807 * deleted or another handle scope is created. If there is already a
808 * handle scope and a new one is created, all allocations will take
809 * place in the new handle scope until it is deleted. After that,
810 * new handles will again be allocated in the original handle scope.
812 * After the handle scope of a local handle has been deleted the
814 * handle and may deallocate it. The behavior of accessing a handle
815 * for which the handle scope has been deleted is undefined.
827 * Closes the handle scope and returns the value as a handle in the
830 template <class T> Local<T> Close(Handle<T> value);
838 * Creates a new handle with the given value.
847 // Make it hard to create heap-allocated or illegal handle scopes by
874 // Allow for the active closing of HandleScopes which allows to pass a handle
921 static ScriptData* PreCompile(Handle<String> source);
956 Handle<Value> resource_name,
957 Handle<Integer> resource_line_offset = Handle<Integer>(),
958 Handle<Integer> resource_column_offset = Handle<Integer>(),
959 Handle<Boolean> resource_is_shared_cross_origin = Handle<Boolean>()))
964 V8_INLINE(Handle<Value> ResourceName() const);
965 V8_INLINE(Handle<Integer> ResourceLineOffset() const);
966 V8_INLINE(Handle<Integer> ResourceColumnOffset() const);
967 V8_INLINE(Handle<Boolean> ResourceIsSharedCrossOrigin() const);
969 Handle<Value> resource_name_;
970 Handle<Integer> resource_line_offset_;
971 Handle<Integer> resource_column_offset_;
972 Handle<Boolean> resource_is_shared_cross_origin_;
996 static Local<Script> New(Handle<String> source,
999 Handle<String> script_data = Handle<String>());
1011 static Local<Script> New(Handle<String> source,
1012 Handle<Value> file_name);
1030 static Local<Script> Compile(Handle<String> source,
1033 Handle<String> script_data = Handle<String>());
1048 static Local<Script> Compile(Handle<String> source,
1049 Handle<Value> file_name,
1050 Handle<String> script_data = Handle<String>());
1077 void SetData(Handle<String> data);
1082 Handle<Value> GetScriptName();
1106 Handle<Value> GetScriptResourceName() const;
1112 Handle<Value> GetScriptData() const;
1119 Handle<StackTrace> GetStackTrace() const;
1494 * Returns an empty handle if the conversion fails.
1505 bool Equals(Handle<Value> that) const;
1506 bool StrictEquals(Handle<Value> that) const;
1533 V8_INLINE(static Handle<Boolean> New(bool value));
1796 static Local<String> Concat(Handle<String> left, Handle<String> right);
1864 explicit Utf8Value(Handle<v8::Value> obj);
1888 explicit AsciiValue(Handle<v8::Value> obj);
1910 explicit Value(Handle<v8::Value> obj);
2033 typedef Handle<Value> (*AccessorGetter)(Local<String> property,
2075 bool Set(Handle<Value> key,
2076 Handle<Value> value,
2079 bool Set(uint32_t index, Handle<Value> value);
2089 bool ForceSet(Handle<Value> key,
2090 Handle<Value> value,
2093 Local<Value> Get(Handle<Value> key);
2102 PropertyAttribute GetPropertyAttributes(Handle<Value> key);
2104 bool Has(Handle<Value> key);
2106 bool Delete(Handle<Value> key);
2110 bool ForceDelete(Handle<Value> key);
2116 V8_DEPRECATED(bool SetAccessor(Handle<String> name,
2119 Handle<Value> data = Handle<Value>(),
2122 bool SetAccessor(Handle<String> name,
2125 Handle<Value> data = Handle<Value>(),
2130 bool SetAccessor(Handle<String> name,
2131 Handle<DeclaredAccessorDescriptor> descriptor,
2162 bool SetPrototype(Handle<Value> prototype);
2168 Local<Object> FindInstanceInPrototypeChain(Handle<FunctionTemplate> tmpl);
2195 void SetInternalField(int index, Handle<Value> value);
2212 bool HasOwnProperty(Handle<String> key);
2213 bool HasRealNamedProperty(Handle<String> key);
2215 bool HasRealNamedCallbackProperty(Handle<String> key);
2221 Local<Value> GetRealNamedPropertyInPrototypeChain(Handle<String> key);
2228 Local<Value> GetRealNamedProperty(Handle<String> key);
2258 bool SetHiddenValue(Handle<String> key, Handle<Value> value);
2259 Local<Value> GetHiddenValue(Handle<String> key);
2260 bool DeleteHiddenValue(Handle<String> key);
2320 Local<Value> CallAsFunction(Handle<Object> recv,
2322 Handle<Value> argv[]);
2329 Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]);
2351 * handle if cloning fails (for any reason).
2374 Local<Object> NewInstance(int argc, Handle<Value> argv[]) const;
2375 Local<Value> Call(Handle<Object> recv, int argc, Handle<Value> argv[]);
2376 void SetName(Handle<String> name);
2377 Handle<Value> GetName() const;
2385 Handle<Value> GetInferredName() const;
2402 Handle<Value> GetScriptId() const;
2623 static Local<Uint8Array> New(Handle<ArrayBuffer> array_buffer,
2639 static Local<Uint8ClampedArray> New(Handle<ArrayBuffer> array_buffer,
2654 static Local<Int8Array> New(Handle<ArrayBuffer> array_buffer,
2670 static Local<Uint16Array> New(Handle<ArrayBuffer> array_buffer,
2686 static Local<Int16Array> New(Handle<ArrayBuffer> array_buffer,
2702 static Local<Uint32Array> New(Handle<ArrayBuffer> array_buffer,
2718 static Local<Int32Array> New(Handle<ArrayBuffer> array_buffer,
2734 static Local<Float32Array> New(Handle<ArrayBuffer> array_buffer,
2750 static Local<Float64Array> New(Handle<ArrayBuffer> array_buffer,
2766 static Local<DataView> New(Handle<ArrayBuffer> array_buffer,
2865 static Local<Value> New(Handle<String> value);
2890 static Local<Value> New(Isolate* isolate, Handle<Symbol> value);
2934 static Local<RegExp> New(Handle<String> pattern, Flags flags);
2977 void Set(Handle<String> name, Handle<Data> value,
2979 V8_INLINE(void Set(const char* name, Handle<Data> value));
2995 // Handle setters
2996 template <typename S> V8_INLINE(void Set(const Persistent<S>& handle));
2997 template <typename S> V8_INLINE(void Set(const Handle<S> handle));
3111 typedef Handle<Value> (*InvocationCallback)(const Arguments& args);
3118 typedef Handle<Value> (*NamedPropertyGetter)(Local<String> property,
3127 * Otherwise, returns an empty handle.
3129 typedef Handle<Value> (*NamedPropertySetter)(Local<String> property,
3139 * Returns a non-empty handle if the interceptor intercepts the request.
3143 typedef Handle<Integer> (*NamedPropertyQuery)(Local<String> property,
3151 * Returns a non-empty handle if the deleter intercepts the request.
3155 typedef Handle<Boolean> (*NamedPropertyDeleter)(Local<String> property,
3166 typedef Handle<Array> (*NamedPropertyEnumerator)(const AccessorInfo& info);
3173 * request. Otherwise, returns an empty handle.
3175 typedef Handle<Value> (*IndexedPropertyGetter)(uint32_t index,
3184 * Otherwise, returns an empty handle.
3186 typedef Handle<Value> (*IndexedPropertySetter)(uint32_t index,
3196 * Returns a non-empty handle if the interceptor intercepts the request.
3199 typedef Handle<Integer> (*IndexedPropertyQuery)(uint32_t index,
3207 * Returns a non-empty handle if the deleter intercepts the request.
3211 typedef Handle<Boolean> (*IndexedPropertyDeleter)(uint32_t index,
3222 typedef Handle<Array> (*IndexedPropertyEnumerator)(const AccessorInfo& info);
3356 Handle<Value> data = Handle<Value>(),
3357 Handle<Signature> signature = Handle<Signature>(),
3361 Handle<Value> data = Handle<Value>(),
3362 Handle<Signature> signature = Handle<Signature>(),
3374 Handle<Value> data = Handle<Value>()));
3376 Handle<Value> data = Handle<Value>());
3385 void Inherit(Handle<FunctionTemplate> parent);
3398 void SetClassName(Handle<String> name);
3424 bool HasInstance(Handle<Value> object);
3430 void SetCallHandlerInternal(InvocationCallback callback, Handle<Value> data);
3479 V8_DEPRECATED(void SetAccessor(Handle<String> name,
3482 Handle<Value> data = Handle<Value>(),
3485 Handle<AccessorSignature> signature =
3486 Handle<AccessorSignature>()));
3487 void SetAccessor(Handle<String> name,
3490 Handle<Value> data = Handle<Value>(),
3493 Handle<AccessorSignature> signature =
3494 Handle<AccessorSignature>());
3497 bool SetAccessor(Handle<String> name,
3498 Handle<DeclaredAccessorDescriptor> descriptor,
3501 Handle<AccessorSignature> signature =
3502 Handle<AccessorSignature>());
3527 Handle<Value> data = Handle<Value>()));
3534 Handle<Value> data = Handle<Value>());
3558 Handle<Value> data = Handle<Value>()));
3565 Handle<Value> data = Handle<Value>());
3575 Handle<Value> data = Handle<Value>()));
3577 Handle<Value> data = Handle<Value>());
3602 Handle<Value> data = Handle<Value>(),
3619 static Local<ObjectTemplate> New(Handle<FunctionTemplate> constructor);
3630 static Local<Signature> New(Handle<FunctionTemplate> receiver =
3631 Handle<FunctionTemplate>(),
3633 Handle<FunctionTemplate> argv[] = 0);
3645 static Local<AccessorSignature> New(Handle<FunctionTemplate> receiver =
3646 Handle<FunctionTemplate>());
3713 static Local<TypeSwitch> New(Handle<FunctionTemplate> type);
3714 static Local<TypeSwitch> New(int argc, Handle<FunctionTemplate> types[]);
3715 int match(Handle<Value> value);
3750 virtual v8::Handle<v8::FunctionTemplate>
3751 GetNativeFunction(v8::Handle<v8::String> name) {
3752 return v8::Handle<v8::FunctionTemplate>();
3795 Handle<Primitive> V8_EXPORT Undefined();
3796 Handle<Primitive> V8_EXPORT Null();
3797 Handle<Boolean> V8_EXPORT True();
3798 Handle<Boolean> V8_EXPORT False();
3800 V8_INLINE(Handle<Primitive> Undefined(Isolate* isolate));
3801 V8_INLINE(Handle<Primitive> Null(Isolate* isolate));
3802 V8_INLINE(Handle<Boolean> True(Isolate* isolate));
3803 V8_INLINE(Handle<Boolean> False(Isolate* isolate));
3844 typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error);
3853 Handle<Value> V8_EXPORT ThrowException(Handle<Value> exception);
3861 static Local<Value> RangeError(Handle<String> message);
3862 static Local<Value> ReferenceError(Handle<String> message);
3863 static Local<Value> SyntaxError(Handle<String> message);
3864 static Local<Value> TypeError(Handle<String> message);
3865 static Local<Value> Error(Handle<String> message);
4247 Handle<Script> script;
4307 virtual void VisitExternalString(Handle<String> string) {}
4323 * Asserts that no action is performed that could cause a handle's value
4324 * to be modified. Useful when otherwise unsafe handle operations need to
4417 Handle<Value> data = Handle<Value>());
4707 * method allows the program embedding the engine to handle the
4793 internal::Object** handle);
4801 internal::Object** handle);
4804 template <class T> friend class Handle;
4864 Handle<Value> ReThrow();
4868 * been caught an empty handle is returned.
4870 * The returned handle is valid until this TryCatch block has been destroyed.
4876 * property is present an empty handle is returned.
4882 * no message associated an empty handle is returned.
4884 * The returned handle is valid until this TryCatch block has been
4998 void ReattachGlobal(Handle<Object> global_object);
5001 * Creates a new context and returns a handle to the newly allocated
5021 Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(),
5022 Handle<Value> global_object = Handle<Value>());
5027 Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(),
5028 Handle<Value> global_object = Handle<Value>()));
5040 * JavaScript frames an empty handle is returned.
5048 void SetSecurityToken(Handle<Value> token);
5054 Handle<Value> GetSecurityToken();
5091 void SetEmbedderData(int index, Handle<Value> value);
5134 void SetErrorMessageForCodeGenerationFromStrings(Handle<String> message);
5142 explicit V8_INLINE(Scope(Handle<Context> context)) : context_(context) {
5148 : context_(Handle<Context>::New(isolate, context)) {
5157 Handle<Context> context_;
5618 Local<T>::Local() : Handle<T>() { }
5622 Local<T> Local<T>::New(Handle<T> that) {
5635 Local<T> Local<T>::New(Isolate* isolate, Handle<T> that) {
5646 Handle<T> Handle<T>::New(Isolate* isolate, T* that) {
5647 if (that == NULL) return Handle<T>();
5650 return Handle<T>(reinterpret_cast<T*>(HandleScope::CreateHandle(
5675 internal::Object** handle =
5677 return Local<T>(T::Cast(reinterpret_cast<Value*>(handle)));
5683 Persistent<T> Persistent<T>::New(Handle<T> that) {
5689 Persistent<T> Persistent<T>::New(Isolate* isolate, Handle<T> that) {
5818 void Persistent<T>::Reset(Isolate* isolate, const Handle<T>& other) {
5888 void ReturnValue<T>::Set(const Persistent<S>& handle) {
5890 if (V8_UNLIKELY(handle.IsEmpty())) {
5893 *value_ = *reinterpret_cast<internal::Object**>(*handle);
5899 void ReturnValue<T>::Set(const Handle<S> handle) {
5901 if (V8_UNLIKELY(handle.IsEmpty())) {
5904 *value_ = *reinterpret_cast<internal::Object**>(*handle);
6061 Local<T> HandleScope::Close(Handle<T> value) {
6067 Handle<Value> ScriptOrigin::ResourceName() const {
6072 Handle<Integer> ScriptOrigin::ResourceLineOffset() const {
6077 Handle<Integer> ScriptOrigin::ResourceColumnOffset() const {
6081 Handle<Boolean> ScriptOrigin::ResourceIsSharedCrossOrigin() const {
6086 Handle<Boolean> Boolean::New(bool value) {
6091 void Template::Set(const char* name, v8::Handle<Data> value) {
6507 Handle<Primitive> Undefined(Isolate* isolate) {
6512 return Handle<Primitive>(reinterpret_cast<Primitive*>(slot));
6516 Handle<Primitive> Null(Isolate* isolate) {
6521 return Handle<Primitive>(reinterpret_cast<Primitive*>(slot));
6525 Handle<Boolean> True(Isolate* isolate) {
6530 return Handle<Boolean>(reinterpret_cast<Boolean*>(slot));
6534 Handle<Boolean> False(Isolate* isolate) {
6539 return Handle<Boolean>(reinterpret_cast<Boolean*>(slot));