v8
3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Static Public Member Functions | |
static V8_INLINE int | InternalFieldCount (const PersistentBase< Object > &object) |
static V8_INLINE void * | GetAlignedPointerFromInternalField (const PersistentBase< Object > &object, int index) |
static Local< Object > | New (Isolate *isolate) |
static V8_INLINE Object * | Cast (Value *obj) |
Static Public Member Functions inherited from Value | |
template<class T > | |
static V8_INLINE Value * | Cast (T *value) |
Call an Object as a constructor if a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method. Note: This method behaves like the Function::NewInstance method.
Definition at line 3918 of file api.cc.
References ASSERT, Execution::Call(), Handle< T >::cast(), HandleScope::CloseAndEscape(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_BAILOUT_CHECK_DO_CALLBACK, EXCEPTION_PREAMBLE, LOG_API, Execution::New(), ON_BAILOUT, Utils::OpenHandle(), STATIC_ASSERT, Utils::ToLocal(), and Execution::TryGetConstructorDelegate().
Call an Object as a function if a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method.
Definition at line 3884 of file api.cc.
References Execution::Call(), Handle< T >::cast(), HandleScope::CloseAndEscape(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_BAILOUT_CHECK_DO_CALLBACK, EXCEPTION_PREAMBLE, LOG_API, obj, ON_BAILOUT, Utils::OpenHandle(), STATIC_ASSERT, Utils::ToLocal(), and Execution::TryGetFunctionDelegate().
Definition at line 6359 of file v8.h.
Referenced by TEST(), and THREADED_TEST().
Local< v8::Object > Clone | ( | ) |
Clone this object with a fast but shallow copy. Values will point to the same values as the original object.
Definition at line 3611 of file api.cc.
References JSObject::Copy(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
Referenced by TEST(), and THREADED_TEST().
Local< v8::Context > CreationContext | ( | ) |
Returns the context in which the object was created.
Definition at line 3639 of file api.cc.
References ENTER_V8, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
bool Delete | ( | v8::Handle< Value > | key | ) |
Definition at line 3356 of file api.cc.
References v8::internal::DeleteProperty(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by TEST(), and THREADED_TEST().
bool Delete | ( | uint32_t | index | ) |
Definition at line 3395 of file api.cc.
References JSReceiver::DeleteElement(), ENTER_V8, Value::IsTrue(), ON_BAILOUT, and Utils::OpenHandle().
Definition at line 3694 of file api.cc.
References JSObject::DeleteHiddenProperty(), ENTER_V8, Isolate::factory(), Factory::InternalizeString(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by THREADED_TEST().
bool DeletePrivate | ( | v8::Handle< Private > | key | ) |
Definition at line 3371 of file api.cc.
Referenced by THREADED_TEST().
Local< Object > FindInstanceInPrototypeChain | ( | v8::Handle< FunctionTemplate > | tmpl | ) |
Finds an instance of the given function template in the prototype chain.
Definition at line 3220 of file api.cc.
References JSObject::cast(), ENTER_V8, Object::GetPrototype(), FunctionTemplateInfo::IsTemplateFor(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
bool ForceDelete | ( | v8::Handle< Value > | key | ) |
Definition at line 3115 of file api.cc.
References Deoptimizer::DeoptimizeAll(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::ForceDeleteProperty(), Handle< T >::is_null(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by TEST(), and THREADED_TEST().
bool ForceSet | ( | v8::Handle< Value > | key, |
v8::Handle< Value > | value, | ||
v8::PropertyAttribute | attribs = None |
||
) |
Definition at line 3087 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::ForceSetProperty(), Handle< T >::is_null(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by TEST().
Local< Value > Get | ( | v8::Handle< Value > | key | ) |
Definition at line 3139 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::GetProperty(), Handle< T >::is_null(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
Referenced by Shell::ExecuteString(), Shell::GetCompletions(), TEST(), and THREADED_TEST().
Definition at line 3153 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Object::GetElement(), Handle< T >::is_null(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
void * GetAlignedPointerFromInternalField | ( | int | index | ) |
Gets a 2-byte-aligned native pointer from an internal field. This field must have been set by SetAlignedPointerInInternalField, everything else leads to undefined behavior.
Definition at line 6158 of file v8.h.
References I, v8::internal::kApiPointerSize, obj, and V8_LIKELY.
Referenced by v8::internal::DeleteNativeObjectAt().
|
inlinestatic |
Returns the function invoked as a constructor for this object. May be the null value.
Definition at line 3334 of file api.cc.
References ENTER_V8, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
Returns the name of the function invoked as a constructor for this object.
Definition at line 3345 of file api.cc.
References ENTER_V8, name, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
Definition at line 3679 of file api.cc.
References ENTER_V8, Isolate::factory(), Factory::InternalizeString(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
Referenced by TEST(), and THREADED_TEST().
int GetIdentityHash | ( | ) |
Returns the identity hash for this object. The current implementation uses a hidden property on the object to store the identity hash.
The return value will never be 0. Also, it is not guaranteed to be unique.
Definition at line 3650 of file api.cc.
References Handle< T >::cast(), ENTER_V8, JSReceiver::GetOrCreateIdentityHash(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by THREADED_TEST().
void * GetIndexedPropertiesExternalArrayData | ( | ) |
Definition at line 3831 of file api.cc.
References FixedArrayBase::cast(), NULL, ON_BAILOUT, and Utils::OpenHandle().
Referenced by ExternalArrayInfoTestHelper().
int GetIndexedPropertiesExternalArrayDataLength | ( | ) |
Definition at line 3861 of file api.cc.
References FixedArrayBase::cast(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by ExternalArrayInfoTestHelper().
ExternalArrayType GetIndexedPropertiesExternalArrayDataType | ( | ) |
Definition at line 3844 of file api.cc.
References INSTANCE_TYPE_TO_ARRAY_TYPE, ON_BAILOUT, Utils::OpenHandle(), and TYPED_ARRAYS.
Referenced by ExternalArrayInfoTestHelper().
uint8_t * GetIndexedPropertiesPixelData | ( | ) |
Definition at line 3774 of file api.cc.
References ExternalUint8ClampedArray::cast(), NULL, ON_BAILOUT, and Utils::OpenHandle().
Referenced by THREADED_TEST().
int GetIndexedPropertiesPixelDataLength | ( | ) |
Definition at line 3787 of file api.cc.
References ExternalUint8ClampedArray::cast(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by THREADED_TEST().
Gets the value from an internal field.
Definition at line 6139 of file v8.h.
References HandleScope::CreateHandle(), I, v8::internal::kApiPointerSize, and obj.
Referenced by THREADED_TEST().
This function has the same functionality as GetPropertyNames but the returned array doesn't contain the names of properties from prototype objects.
Definition at line 3259 of file api.cc.
References HandleScope::CloseAndEscape(), Factory::CopyFixedArray(), ENTER_V8, Isolate::factory(), v8::internal::GetKeysInFixedArrayFor(), v8::internal::LOCAL_ONLY, Factory::NewJSArrayWithElements(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
Referenced by CheckOwnProperties(), and THREADED_TEST().
Local< Value > GetPrivate | ( | v8::Handle< Private > | key | ) |
Definition at line 3166 of file api.cc.
Referenced by THREADED_TEST().
PropertyAttribute GetPropertyAttributes | ( | v8::Handle< Value > | key | ) |
Gets the property attributes of a property which can be None or any combination of ReadOnly, DontEnum and DontDelete. Returns None when the property doesn't exist.
Definition at line 3171 of file api.cc.
References ABSENT, Handle< T >::cast(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, JSReceiver::GetPropertyAttribute(), NONE, ON_BAILOUT, Utils::OpenHandle(), and Execution::ToString().
Referenced by THREADED_TEST().
Returns an array containing the names of the enumerable properties of this object, including properties from prototype objects. The array returned by this method contains the same values as would be enumerated by a for-in statement over this object.
Definition at line 3238 of file api.cc.
References HandleScope::CloseAndEscape(), Factory::CopyFixedArray(), ENTER_V8, Isolate::factory(), v8::internal::GetKeysInFixedArrayFor(), v8::internal::INCLUDE_PROTOS, Factory::NewJSArrayWithElements(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
Referenced by CheckProperties(), and THREADED_TEST().
Get the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.
Definition at line 3192 of file api.cc.
References ENTER_V8, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().
Referenced by Runtime::GetElementOrCharAt(), Object::GetElementWithReceiver(), v8::internal::RUNTIME_FUNCTION(), TEST(), THREADED_TEST(), and IC::TryRemoveInvalidPrototypeDependentStub().
If result.IsEmpty() no real property was located on the object or in the prototype chain. This means interceptors in the prototype chain are not called.
Definition at line 3572 of file api.cc.
References ENTER_V8, ON_BAILOUT, and Utils::OpenHandle().
If result.IsEmpty() no real property was located in the prototype chain. This means interceptors in the prototype chain are not called.
Definition at line 3557 of file api.cc.
References ENTER_V8, ON_BAILOUT, and Utils::OpenHandle().
bool Has | ( | v8::Handle< Value > | key | ) |
Definition at line 3376 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::HasProperty(), Handle< T >::is_null(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by THREADED_TEST().
bool Has | ( | uint32_t | index | ) |
Definition at line 3406 of file api.cc.
References JSReceiver::HasElement(), ON_BAILOUT, and Utils::OpenHandle().
bool HasIndexedLookupInterceptor | ( | ) |
Tests for an index lookup interceptor.
Definition at line 3526 of file api.cc.
References ON_BAILOUT, and Utils::OpenHandle().
bool HasIndexedPropertiesInExternalArrayData | ( | ) |
Definition at line 3822 of file api.cc.
References ON_BAILOUT, and Utils::OpenHandle().
Referenced by ExtArrayLimitsHelper(), and ExternalArrayInfoTestHelper().
bool HasIndexedPropertiesInPixelData | ( | ) |
Definition at line 3766 of file api.cc.
References ON_BAILOUT, and Utils::OpenHandle().
Referenced by THREADED_TEST().
bool HasNamedLookupInterceptor | ( | ) |
Tests for a named lookup interceptor.
Definition at line 3518 of file api.cc.
References ON_BAILOUT, and Utils::OpenHandle().
Definition at line 3481 of file api.cc.
References JSReceiver::HasLocalProperty(), ON_BAILOUT, and Utils::OpenHandle().
bool HasPrivate | ( | v8::Handle< Private > | key | ) |
Functionality for private properties. This is an experimental feature, use at your own risk. Note: Private properties are inherited. Do not rely on this, since it may change.
Definition at line 3390 of file api.cc.
Referenced by THREADED_TEST().
bool HasRealIndexedProperty | ( | uint32_t | index | ) |
Definition at line 3499 of file api.cc.
References JSObject::HasRealElementProperty(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by TEST(), and THREADED_TEST().
Definition at line 3507 of file api.cc.
References ENTER_V8, JSObject::HasRealNamedCallbackProperty(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by TEST().
Definition at line 3490 of file api.cc.
References JSObject::HasRealNamedProperty(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by TEST().
int InternalFieldCount | ( | ) |
Gets the number of internal fields for this Object.
Definition at line 4887 of file api.cc.
References Utils::OpenHandle().
Referenced by TEST(), and THREADED_TEST().
|
inlinestatic |
bool IsCallable | ( | ) |
Checks whether a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method. When an Object is callable this method returns true.
Definition at line 3874 of file api.cc.
References ENTER_V8, ON_BAILOUT, and Utils::OpenHandle().
bool IsDirty | ( | ) |
Returns true if this is an instance of an api function (one created from a function created from a function template) and has been modified since it was created. Note that this method is conservative and may return true for objects that haven't actually been modified.
Definition at line 3606 of file api.cc.
References Utils::OpenHandle().
|
static |
Definition at line 5589 of file api.cc.
References ENTER_V8, Isolate::factory(), LOG_API, Factory::NewJSObject(), and Utils::ToLocal().
Referenced by ExtArrayLimitsHelper(), ExternalArrayInfoTestHelper(), StatisticsExtension::GetCounters(), GraphWithImplicitRefs::GraphWithImplicitRefs(), HandleCreatingCallback(), TerminateOrReturnObject(), TEST(), and THREADED_TEST().
Call builtin Object.prototype.toString on this object. This is different from Value::ToString() that may call user-defined toString function. This one does not.
Definition at line 3280 of file api.cc.
References Handle< T >::cast(), ENTER_V8, v8::internal::kCharSize, String::kNormalString, OS::MemCopy(), name, String::NewFromUtf8(), ON_BAILOUT, Utils::OpenHandle(), Vector< T >::start(), STATIC_ASCII_VECTOR, v8::internal::StrLength(), Utils::ToLocal(), String::Utf8Length(), and String::WriteUtf8().
bool Set | ( | v8::Handle< Value > | key, |
v8::Handle< Value > | value, | ||
v8::PropertyAttribute | attribs = None |
||
) |
Definition at line 3044 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), ON_BAILOUT, Utils::OpenHandle(), Runtime::SetObjectProperty(), and v8::internal::SLOPPY.
Referenced by JSONStringifyEnumerator(), TerminateOrReturnObject(), TEST(), and THREADED_TEST().
bool Set | ( | uint32_t | index, |
v8::Handle< Value > | value | ||
) |
Definition at line 3067 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), NONE, ON_BAILOUT, Utils::OpenHandle(), JSObject::SetElement(), and v8::internal::SLOPPY.
bool SetAccessor | ( | Handle< String > | name, |
AccessorGetterCallback | getter, | ||
AccessorSetterCallback | setter = 0 , |
||
v8::Handle< Value > | data = Handle<Value>() , |
||
AccessControl | settings = DEFAULT , |
||
PropertyAttribute | attribute = None |
||
) |
void SetAccessorProperty | ( | Local< String > | name, |
Local< Function > | getter, | ||
Handle< Function > | setter = Handle<Function>() , |
||
PropertyAttribute | attribute = None , |
||
AccessControl | settings = DEFAULT |
||
) |
Definition at line 3460 of file api.cc.
References JSObject::DefineAccessor(), ENTER_V8, Isolate::factory(), Handle< T >::is_null(), ON_BAILOUT, and Utils::OpenHandle().
void SetAlignedPointerInInternalField | ( | int | index, |
void * | value | ||
) |
Sets a 2-byte-aligned native pointer in an internal field. To retrieve such a field, GetAlignedPointerFromInternalField must be used, everything else leads to undefined behavior.
Definition at line 4929 of file api.cc.
References ASSERT_EQ, and Utils::OpenHandle().
bool SetDeclaredAccessor | ( | Local< String > | name, |
Local< DeclaredAccessorDescriptor > | descriptor, | ||
PropertyAttribute | attribute = None , |
||
AccessControl | settings = DEFAULT |
||
) |
Access hidden properties on JavaScript objects. These properties are hidden from the executing JavaScript and only accessible through the V8 C++ API. Hidden properties introduced by V8 internally (for example the identity hash) are prefixed with "v8::".
Definition at line 3661 of file api.cc.
References ENTER_V8, Isolate::factory(), Factory::InternalizeString(), Handle< T >::IsEmpty(), ON_BAILOUT, Utils::OpenHandle(), and JSObject::SetHiddenProperty().
Referenced by TEST(), and THREADED_TEST().
void SetIndexedPropertiesToExternalArrayData | ( | void * | data, |
ExternalArrayType | array_type, | ||
int | number_of_elements | ||
) |
Set the backing store of the indexed properties to be managed by the embedding layer. Access to the indexed properties will follow the rules spelled out for the CanvasArray subtypes in the WebGL specification. Note: The embedding program still owns the data and needs to ensure that the backing store is preserved while V8 has a reference.
Definition at line 3799 of file api.cc.
References Utils::ApiCheck(), ENTER_V8, ExternalArray::kMaxLength, ON_BAILOUT, and Utils::OpenHandle().
Referenced by ExtArrayLimitsHelper(), and ExternalArrayInfoTestHelper().
void SetIndexedPropertiesToPixelData | ( | uint8_t * | data, |
int | length | ||
) |
Set the backing store of the indexed properties to be managed by the embedding layer. Access to the indexed properties will follow the rules spelled out in CanvasPixelArray. Note: The embedding program still owns the data and needs to ensure that the backing store is preserved while V8 has a reference.
Definition at line 3745 of file api.cc.
References Utils::ApiCheck(), ENTER_V8, v8::kExternalUint8ClampedArray, ExternalArray::kMaxLength, ON_BAILOUT, and Utils::OpenHandle().
Referenced by THREADED_TEST().
void SetInternalField | ( | int | index, |
v8::Handle< Value > | value | ||
) |
Sets the value in an internal field.
Definition at line 4911 of file api.cc.
References ASSERT_EQ, and Utils::OpenHandle().
Referenced by TEST(), and THREADED_TEST().
bool SetPrivate | ( | v8::Handle< Private > | key, |
v8::Handle< Value > | value | ||
) |
Set the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.
Definition at line 3203 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), ON_BAILOUT, Utils::OpenHandle(), and JSObject::SetPrototype().
Referenced by TEST(), and THREADED_PROFILED_TEST().
void TurnOnAccessCheck | ( | ) |
Turns on access check on the object if the object is an instance of a template that has access check callbacks. If an object has no access check info, the object cannot be accessed by anyone.
Definition at line 3588 of file api.cc.
References Factory::CopyMap(), Deoptimizer::DeoptimizeGlobalObject(), ENTER_V8, Isolate::factory(), ON_BAILOUT, and Utils::OpenHandle().
Referenced by TEST().