v8
3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Static Public Member Functions | |
static V8EXPORT Local< Object > | New () |
static Object * | Cast (Value *obj) |
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 3591 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, 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 3559 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, ON_BAILOUT, STATIC_ASSERT, Utils::ToLocal(), and Execution::TryGetFunctionDelegate().
Definition at line 4581 of file v8.h.
Referenced by NonStrictArgsIndexedPropertyEnumerator(), 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 3256 of file api.cc.
References v8::internal::Copy(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), ON_BAILOUT, and Utils::ToLocal().
Referenced by THREADED_TEST().
Local< v8::Context > CreationContext | ( | ) |
Returns the context in which the object was created.
Definition at line 3284 of file api.cc.
References ENTER_V8, ON_BAILOUT, and Utils::ToLocal().
bool Delete | ( | v8::Handle< String > | key | ) |
Definition at line 3064 of file api.cc.
References JSObject::DeleteProperty(), ENTER_V8, Value::IsTrue(), and ON_BAILOUT.
Referenced by TEST(), and THREADED_TEST().
bool Delete | ( | uint32_t | index | ) |
Definition at line 3085 of file api.cc.
References JSObject::DeleteElement(), ENTER_V8, Value::IsTrue(), and ON_BAILOUT.
Definition at line 3336 of file api.cc.
References ENTER_V8, FACTORY, and ON_BAILOUT.
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 2928 of file api.cc.
References JSObject::cast(), ENTER_V8, Object::GetPrototype(), Object::IsInstanceOf(), ON_BAILOUT, and Utils::ToLocal().
bool ForceDelete | ( | v8::Handle< Value > | key | ) |
Definition at line 2829 of file api.cc.
References Deoptimizer::DeoptimizeAll(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::ForceDeleteProperty(), Handle< T >::is_null(), and ON_BAILOUT.
Referenced by THREADED_TEST().
bool ForceSet | ( | v8::Handle< Value > | key, |
v8::Handle< Value > | value, | ||
v8::PropertyAttribute | attribs = None |
||
) |
Definition at line 2807 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::ForceSetProperty(), Handle< T >::is_null(), and ON_BAILOUT.
Referenced by TEST().
Local< Value > Get | ( | v8::Handle< Value > | key | ) |
Definition at line 2853 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::GetProperty(), Handle< T >::is_null(), ON_BAILOUT, and Utils::ToLocal().
Referenced by TEST(), and THREADED_TEST().
Definition at line 2867 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Object::GetElement(), Handle< T >::is_null(), ON_BAILOUT, and Utils::ToLocal().
Returns the function invoked as a constructor for this object. May be the null value.
Definition at line 3042 of file api.cc.
References ENTER_V8, ON_BAILOUT, and Utils::ToLocal().
Returns the name of the function invoked as a constructor for this object.
Definition at line 3053 of file api.cc.
References ENTER_V8, ON_BAILOUT, and Utils::ToLocal().
Definition at line 3322 of file api.cc.
References ENTER_V8, FACTORY, ON_BAILOUT, 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 3295 of file api.cc.
References ENTER_V8, JSObject::GetIdentityHash(), and ON_BAILOUT.
Referenced by THREADED_TEST().
void * GetIndexedPropertiesExternalArrayData | ( | ) |
Definition at line 3492 of file api.cc.
References FixedArrayBase::cast(), NULL, and ON_BAILOUT.
Referenced by ExternalArrayInfoTestHelper().
int GetIndexedPropertiesExternalArrayDataLength | ( | ) |
Definition at line 3535 of file api.cc.
References FixedArrayBase::cast(), and ON_BAILOUT.
Referenced by ExternalArrayInfoTestHelper().
ExternalArrayType GetIndexedPropertiesExternalArrayDataType | ( | ) |
Definition at line 3505 of file api.cc.
References v8::internal::EXTERNAL_BYTE_ARRAY_TYPE, v8::internal::EXTERNAL_DOUBLE_ARRAY_TYPE, v8::internal::EXTERNAL_FLOAT_ARRAY_TYPE, v8::internal::EXTERNAL_INT_ARRAY_TYPE, v8::internal::EXTERNAL_PIXEL_ARRAY_TYPE, v8::internal::EXTERNAL_SHORT_ARRAY_TYPE, v8::internal::EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE, v8::internal::EXTERNAL_UNSIGNED_INT_ARRAY_TYPE, v8::internal::EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE, v8::kExternalByteArray, v8::kExternalDoubleArray, v8::kExternalFloatArray, v8::kExternalIntArray, v8::kExternalPixelArray, v8::kExternalShortArray, v8::kExternalUnsignedByteArray, v8::kExternalUnsignedIntArray, v8::kExternalUnsignedShortArray, and ON_BAILOUT.
Referenced by ExternalArrayInfoTestHelper().
uint8_t * GetIndexedPropertiesPixelData | ( | ) |
Definition at line 3435 of file api.cc.
References ExternalPixelArray::cast(), NULL, and ON_BAILOUT.
Referenced by THREADED_TEST().
int GetIndexedPropertiesPixelDataLength | ( | ) |
Definition at line 3448 of file api.cc.
References ExternalPixelArray::cast(), and ON_BAILOUT.
Referenced by THREADED_TEST().
Gets the value in an internal field.
Definition at line 4355 of file v8.h.
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 2967 of file api.cc.
References HandleScope::CloseAndEscape(), Factory::CopyFixedArray(), ENTER_V8, Isolate::factory(), v8::internal::GetKeysInFixedArrayFor(), v8::internal::LOCAL_ONLY, Factory::NewJSArrayWithElements(), ON_BAILOUT, and Utils::ToLocal().
Referenced by CheckOwnProperties().
|
inline |
Gets a native pointer from an internal field.
Definition at line 4398 of file v8.h.
References I, and v8::internal::kApiPointerSize.
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 2880 of file api.cc.
References ABSENT, Handle< T >::cast(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, NONE, ON_BAILOUT, and Execution::ToString().
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 2946 of file api.cc.
References HandleScope::CloseAndEscape(), Factory::CopyFixedArray(), ENTER_V8, Isolate::factory(), v8::internal::GetKeysInFixedArrayFor(), v8::internal::INCLUDE_PROTOS, Factory::NewJSArrayWithElements(), ON_BAILOUT, and Utils::ToLocal().
Referenced by CheckProperties().
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 2900 of file api.cc.
References ENTER_V8, ON_BAILOUT, and Utils::ToLocal().
Referenced by v8::internal::RUNTIME_FUNCTION(), TEST(), and THREADED_TEST().
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 3217 of file api.cc.
References ENTER_V8, and ON_BAILOUT.
Referenced by THREADED_TEST().
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 3202 of file api.cc.
References ENTER_V8, and ON_BAILOUT.
bool Has | ( | v8::Handle< String > | key | ) |
Definition at line 3075 of file api.cc.
References ENTER_V8, and ON_BAILOUT.
Referenced by THREADED_TEST().
bool Has | ( | uint32_t | index | ) |
Definition at line 3096 of file api.cc.
References ON_BAILOUT.
bool HasIndexedLookupInterceptor | ( | ) |
Tests for an index lookup interceptor.
Definition at line 3171 of file api.cc.
References ON_BAILOUT.
bool HasIndexedPropertiesInExternalArrayData | ( | ) |
Definition at line 3483 of file api.cc.
References ON_BAILOUT.
Referenced by ExternalArrayInfoTestHelper(), and ExternalArrayLimitTestHelper().
bool HasIndexedPropertiesInPixelData | ( | ) |
bool HasNamedLookupInterceptor | ( | ) |
Tests for a named lookup interceptor.
Definition at line 3163 of file api.cc.
References ON_BAILOUT.
Definition at line 3126 of file api.cc.
References ON_BAILOUT.
bool HasRealIndexedProperty | ( | uint32_t | index | ) |
int InternalFieldCount | ( | ) |
Gets the number of internal fields for this Object.
Definition at line 4185 of file api.cc.
Referenced by TEST(), and THREADED_TEST().
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 3548 of file api.cc.
References ENTER_V8, Execution::GetFunctionDelegate(), and ON_BAILOUT.
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.
|
static |
Definition at line 4957 of file api.cc.
References ENTER_V8, Isolate::factory(), LOG_API, Factory::NewJSObject(), and Utils::ToLocal().
Referenced by ExternalArrayInfoTestHelper(), ExternalArrayLimitTestHelper(), StatisticsExtension::GetCounters(), GraphWithImplicitRefs::GraphWithImplicitRefs(), HandleCreatingCallback(), HandleF(), Shell::ReadBuffer(), Shell::System(), TerminateOrReturnObject(), TEST(), THREADED_TEST(), and WhammyPropertyGetter().
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 2988 of file api.cc.
References Handle< T >::cast(), v8::internal::CStrVector(), ENTER_V8, v8::internal::kCharSize, String::Length(), String::New(), ON_BAILOUT, Vector< T >::start(), v8::internal::StrLength(), Utils::ToLocal(), and String::WriteAscii().
bool Set | ( | v8::Handle< Value > | key, |
v8::Handle< Value > | value, | ||
v8::PropertyAttribute | attribs = None |
||
) |
Definition at line 2765 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), v8::internal::kNonStrictMode, ON_BAILOUT, and v8::internal::SetProperty().
Referenced by TerminateOrReturnObject(), TEST(), and THREADED_TEST().
bool Set | ( | uint32_t | index, |
v8::Handle< Value > | value | ||
) |
Definition at line 2787 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), v8::internal::kNonStrictMode, NONE, ON_BAILOUT, and JSObject::SetElement().
bool SetAccessor | ( | Handle< String > | name, |
AccessorGetter | getter, | ||
AccessorSetter | setter = 0 , |
||
v8::Handle< Value > | data = Handle<Value>() , |
||
AccessControl | settings = DEFAULT , |
||
PropertyAttribute | attribute = None |
||
) |
Definition at line 3104 of file api.cc.
References ENTER_V8, Handle< T >::is_null(), ON_BAILOUT, v8::internal::SetAccessor(), and JSObject::TransformToFastProperties().
Referenced by TEST().
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 3305 of file api.cc.
References ENTER_V8, FACTORY, Handle< T >::IsEmpty(), ON_BAILOUT, 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 3460 of file api.cc.
References ENTER_V8, ExternalArray::kMaxLength, and ON_BAILOUT.
Referenced by ExternalArrayInfoTestHelper(), and ExternalArrayLimitTestHelper().
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 3407 of file api.cc.
References ENTER_V8, v8::kExternalPixelArray, ExternalArray::kMaxLength, and ON_BAILOUT.
Referenced by THREADED_TEST().
void SetInternalField | ( | int | index, |
v8::Handle< Value > | value | ||
) |
Sets the value in an internal field.
Definition at line 4214 of file api.cc.
References ENTER_V8.
Referenced by TEST(), and THREADED_TEST().
void SetPointerInInternalField | ( | int | index, |
void * | value | ||
) |
Sets a native pointer in an internal field.
Definition at line 4248 of file api.cc.
References ASSERT_EQ, ENTER_V8, Isolate::factory(), Handle< T >::is_null(), Factory::NewForeign(), and v8::internal::TENURED.
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 2911 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), ON_BAILOUT, and v8::internal::SetPrototype().
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 3233 of file api.cc.
References Factory::CopyMap(), Deoptimizer::DeoptimizeGlobalObject(), ENTER_V8, Isolate::factory(), and ON_BAILOUT.
Referenced by THREADED_TEST().