v8  4.2.77(io.js2.5.0)
V8 is Google's open source JavaScript engine
ArrayBuffer Class Reference

#include <v8.h>

Inheritance diagram for ArrayBuffer:
Collaboration diagram for ArrayBuffer:

Data Structures

class  Allocator
class  Contents

Public Member Functions

size_t ByteLength () const
bool IsExternal () const
bool IsNeuterable () const
void Neuter ()
Contents Externalize ()
- Public Member Functions inherited from Object
bool Set (Handle< Value > key, Handle< Value > value)
bool Set (uint32_t index, Handle< Value > value)
bool ForceSet (Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
Local< ValueGet (Handle< Value > key)
Local< ValueGet (uint32_t index)
PropertyAttribute GetPropertyAttributes (Handle< Value > key)
Local< ValueGetOwnPropertyDescriptor (Local< String > key)
bool Has (Handle< Value > key)
bool Delete (Handle< Value > key)
bool Has (uint32_t index)
bool Delete (uint32_t index)
bool SetAccessor (Handle< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)
bool SetAccessor (Handle< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)
void SetAccessorProperty (Local< Name > name, Local< Function > getter, Handle< Function > setter=Handle< Function >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
bool HasPrivate (Handle< Private > key)
bool SetPrivate (Handle< Private > key, Handle< Value > value)
bool DeletePrivate (Handle< Private > key)
Local< ValueGetPrivate (Handle< Private > key)
Local< ArrayGetPropertyNames ()
Local< ArrayGetOwnPropertyNames ()
Local< ValueGetPrototype ()
bool SetPrototype (Handle< Value > prototype)
Local< ObjectFindInstanceInPrototypeChain (Handle< FunctionTemplate > tmpl)
Local< StringObjectProtoToString ()
Local< StringGetConstructorName ()
int InternalFieldCount ()
V8_INLINE Local< ValueGetInternalField (int index)
void SetInternalField (int index, Handle< Value > value)
V8_INLINE void * GetAlignedPointerFromInternalField (int index)
void SetAlignedPointerInInternalField (int index, void *value)
bool HasOwnProperty (Handle< String > key)
bool HasRealNamedProperty (Handle< String > key)
bool HasRealIndexedProperty (uint32_t index)
bool HasRealNamedCallbackProperty (Handle< String > key)
Local< ValueGetRealNamedPropertyInPrototypeChain (Handle< String > key)
Local< ValueGetRealNamedProperty (Handle< String > key)
bool HasNamedLookupInterceptor ()
bool HasIndexedLookupInterceptor ()
void TurnOnAccessCheck ()
int GetIdentityHash ()
bool SetHiddenValue (Handle< String > key, Handle< Value > value)
Local< ValueGetHiddenValue (Handle< String > key)
bool DeleteHiddenValue (Handle< String > key)
Local< ObjectClone ()
Local< ContextCreationContext ()
void SetIndexedPropertiesToPixelData (uint8_t *data, int length)
bool HasIndexedPropertiesInPixelData ()
uint8_t * GetIndexedPropertiesPixelData ()
int GetIndexedPropertiesPixelDataLength ()
void SetIndexedPropertiesToExternalArrayData (void *data, ExternalArrayType array_type, int number_of_elements)
bool HasIndexedPropertiesInExternalArrayData ()
void * GetIndexedPropertiesExternalArrayData ()
ExternalArrayType GetIndexedPropertiesExternalArrayDataType ()
int GetIndexedPropertiesExternalArrayDataLength ()
bool IsCallable ()
Local< ValueCallAsFunction (Handle< Value > recv, int argc, Handle< Value > argv[])
Local< ValueCallAsConstructor (int argc, Handle< Value > argv[])
IsolateGetIsolate ()
- Public Member Functions inherited from Value
V8_INLINE bool IsUndefined () const
V8_INLINE bool IsNull () const
bool IsTrue () const
bool IsFalse () const
bool IsName () const
V8_INLINE bool IsString () const
bool IsSymbol () const
bool IsFunction () const
bool IsArray () const
bool IsObject () const
bool IsBoolean () const
bool IsNumber () const
bool IsExternal () const
bool IsInt32 () const
bool IsUint32 () const
bool IsDate () const
bool IsArgumentsObject () const
bool IsBooleanObject () const
bool IsNumberObject () const
bool IsStringObject () const
bool IsSymbolObject () const
bool IsNativeError () const
bool IsRegExp () const
bool IsGeneratorFunction () const
bool IsGeneratorObject () const
bool IsPromise () const
bool IsMap () const
bool IsSet () const
bool IsMapIterator () const
bool IsSetIterator () const
bool IsWeakMap () const
bool IsWeakSet () const
bool IsArrayBuffer () const
bool IsArrayBufferView () const
bool IsTypedArray () const
bool IsUint8Array () const
bool IsUint8ClampedArray () const
bool IsInt8Array () const
bool IsUint16Array () const
bool IsInt16Array () const
bool IsUint32Array () const
bool IsInt32Array () const
bool IsFloat32Array () const
bool IsFloat64Array () const
bool IsDataView () const
Local< BooleanToBoolean (Isolate *isolate) const
Local< NumberToNumber (Isolate *isolate) const
Local< StringToString (Isolate *isolate) const
Local< StringToDetailString (Isolate *isolate) const
Local< ObjectToObject (Isolate *isolate) const
Local< IntegerToInteger (Isolate *isolate) const
Local< Uint32ToUint32 (Isolate *isolate) const
Local< Int32ToInt32 (Isolate *isolate) const
Local< BooleanToBoolean () const
Local< NumberToNumber () const
Local< StringToString () const
Local< StringToDetailString () const
Local< ObjectToObject () const
Local< IntegerToInteger () const
Local< Uint32ToUint32 () const
Local< Int32ToInt32 () const
Local< Uint32ToArrayIndex () const
bool BooleanValue () const
double NumberValue () const
int64_t IntegerValue () const
uint32_t Uint32Value () const
int32_t Int32Value () const
bool Equals (Handle< Value > that) const
bool StrictEquals (Handle< Value > that) const
bool SameValue (Handle< Value > that) const
template<class T >
ValueCast (T *value)

Static Public Member Functions

static Local< ArrayBufferNew (Isolate *isolate, size_t byte_length)
static Local< ArrayBufferNew (Isolate *isolate, void *data, size_t byte_length)
static V8_INLINE ArrayBufferCast (Value *obj)
- Static Public Member Functions inherited from Object
static V8_INLINE int InternalFieldCount (const PersistentBase< Object > &object)
static V8_INLINE void * GetAlignedPointerFromInternalField (const PersistentBase< Object > &object, int index)
static Local< ObjectNew (Isolate *isolate)
static V8_INLINE ObjectCast (Value *obj)
- Static Public Member Functions inherited from Value
template<class T >
static V8_INLINE ValueCast (T *value)

Static Public Attributes

static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT

Detailed Description

An instance of the built-in ArrayBuffer constructor (ES6 draft 15.13.5). This API is experimental and may change significantly.

Definition at line 3013 of file v8.h.

Member Function Documentation

size_t ByteLength ( ) const

Data length in bytes.

ArrayBuffer * Cast ( v8::Value value)

Definition at line 7142 of file v8.h.

Contents Externalize ( )

Make this ArrayBuffer external. The pointer to underlying memory block and byte length are returned as |Contents| structure. After ArrayBuffer had been etxrenalized, it does no longer owns the memory block. The caller should take steps to free memory when it is no longer needed.

The memory block is guaranteed to be allocated with |Allocator::Allocate| that has been set with V8::SetArrayBufferAllocator.

bool IsExternal ( ) const

Returns true if ArrayBuffer is extrenalized, that is, does not own its memory block.

bool IsNeuterable ( ) const

Returns true if this ArrayBuffer may be neutered.

void Neuter ( )

Neuters this ArrayBuffer and all its views (typed arrays). Neutering sets the byte length of the buffer and all typed arrays to zero, preventing JavaScript from ever accessing underlying backing store. ArrayBuffer should have been externalized and must be neuterable.

static Local<ArrayBuffer> New ( Isolate isolate,
size_t  byte_length 

Create a new ArrayBuffer. Allocate |byte_length| bytes. Allocated memory will be owned by a created ArrayBuffer and will be deallocated when it is garbage-collected, unless the object is externalized.

static Local<ArrayBuffer> New ( Isolate isolate,
void *  data,
size_t  byte_length 

Create a new ArrayBuffer over an existing memory block. The created array buffer is immediately in externalized state. The memory block will not be reclaimed when a created ArrayBuffer is garbage-collected.

Field Documentation

const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT

Definition at line 3123 of file v8.h.

The documentation for this class was generated from the following file: