![]() |
v8 13.6.233 (node 24.1.0)
V8 is Google's open source JavaScript engine
|
#include <v8-array-buffer.h>
Static Public Member Functions | |
static Local< SharedArrayBuffer > | New (Isolate *isolate, size_t byte_length, BackingStoreInitializationMode initialization_mode=BackingStoreInitializationMode::kZeroInitialized) |
static MaybeLocal< SharedArrayBuffer > | MaybeNew (Isolate *isolate, size_t byte_length, BackingStoreInitializationMode initialization_mode=BackingStoreInitializationMode::kZeroInitialized) |
static Local< SharedArrayBuffer > | New (Isolate *isolate, std::shared_ptr< BackingStore > backing_store) |
static std::unique_ptr< BackingStore > | NewBackingStore (Isolate *isolate, size_t byte_length, BackingStoreInitializationMode initialization_mode=BackingStoreInitializationMode::kZeroInitialized, BackingStoreOnFailureMode on_failure=BackingStoreOnFailureMode::kOutOfMemory) |
static std::unique_ptr< BackingStore > | NewBackingStore (void *data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void *deleter_data) |
static V8_INLINE SharedArrayBuffer * | Cast (Value *value) |
![]() | |
static V8_INLINE int | InternalFieldCount (const PersistentBase< Object > &object) |
static V8_INLINE int | InternalFieldCount (const BasicTracedReference< Object > &object) |
static V8_INLINE void * | GetAlignedPointerFromInternalField (const PersistentBase< Object > &object, int index) |
static V8_INLINE void * | GetAlignedPointerFromInternalField (const BasicTracedReference< Object > &object, int index) |
template<CppHeapPointerTag tag, typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper) |
template<CppHeapPointerTag tag, typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const PersistentBase< Object > &wrapper) |
template<CppHeapPointerTag tag, typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper) |
template<typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, CppHeapPointerTagRange tag_range) |
template<typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const PersistentBase< Object > &wrapper, CppHeapPointerTagRange tag_range) |
template<typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, CppHeapPointerTagRange tag_range) |
template<CppHeapPointerTag tag> | |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, void *wrappable) |
template<CppHeapPointerTag tag> | |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const PersistentBase< Object > &wrapper, void *wrappable) |
template<CppHeapPointerTag tag> | |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, void *wrappable) |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, void *wrappable, CppHeapPointerTag tag) |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const PersistentBase< Object > &wrapper, void *wrappable, CppHeapPointerTag tag) |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, void *wrappable, CppHeapPointerTag tag) |
static V8_INLINE MaybeLocal< Context > | GetCreationContext (v8::Isolate *isolate, const PersistentBase< Object > &object) |
static V8_INLINE MaybeLocal< Context > | GetCreationContext (const PersistentBase< Object > &object) |
static V8_INLINE Isolate * | GetIsolate (const TracedReference< Object > &handle) |
static Local< Object > | New (Isolate *isolate) |
static Local< Object > | New (Isolate *isolate, Local< Value > prototype_or_null, Local< Name > *names, Local< Value > *values, size_t length) |
static V8_INLINE Object * | Cast (Value *obj) |
![]() | |
template<class T> | |
static V8_INLINE Value * | Cast (T *value) |
Static Public Attributes | |
static constexpr int | kInternalFieldCount |
Additional Inherited Members | |
![]() | |
Local< Value > | prototype |
An instance of the built-in SharedArrayBuffer constructor.
Definition at line 499 of file v8-array-buffer.h.
size_t ByteLength | ( | ) | const |
Data length in bytes.
|
inlinestatic |
Definition at line 598 of file v8-array-buffer.h.
References V8_INLINE.
void * Data | ( | ) | const |
More efficient shortcut for GetBackingStore()->Data(). The returned pointer is valid as long as the ArrayBuffer is alive.
std::shared_ptr< BackingStore > GetBackingStore | ( | ) |
Get a shared pointer to the backing store of this array buffer. This pointer coordinates the lifetime management of the internal storage with any live ArrayBuffers on the heap, even across isolates. The embedder should not attempt to manage lifetime of the storage through other means.
size_t MaxByteLength | ( | ) | const |
Maximum length in bytes.
|
static |
Create a new SharedArrayBuffer. Allocate |byte_length| bytes, which are either zero-initialized or uninitialized. Allocated memory will be owned by a created SharedArrayBuffer and will be deallocated when it is garbage-collected, unless the object is externalized. If allocation fails, the Maybe returned will be empty.
References v8::kZeroInitialized.
|
static |
Create a new SharedArrayBuffer. Allocate |byte_length| bytes, which are either zero-initialized or uninitialized. Allocated memory will be owned by a created SharedArrayBuffer and will be deallocated when it is garbage-collected, unless the object is externalized.
References v8::kZeroInitialized.
|
static |
Create a new SharedArrayBuffer with an existing backing store. The created array keeps a reference to the backing store until the array is garbage collected. Note that the IsExternal bit does not affect this reference from the array to the backing store.
In future IsExternal bit will be removed. Until then the bit is set as follows. If the backing store does not own the underlying buffer, then the array is created in externalized state. Otherwise, the array is created in internalized state. In the latter case the array can be transitioned to the externalized state using Externalize(backing_store).
|
static |
Returns a new standalone BackingStore that is allocated using the array buffer allocator of the isolate. The allocation can either be zero initialized, or uninitialized. The result can be later passed to SharedArrayBuffer::New.
If the allocator returns nullptr, then the function may cause GCs in the given isolate and re-try the allocation.
If on_failure is kOutOfMemory and GCs do not help, then the function will crash with an out-of-memory error.
Otherwise, if on_failure is kReturnNull and GCs do not help (or the byte_length is so large that the allocation cannot succeed), then a null result is returned.
References v8::kOutOfMemory, and v8::kZeroInitialized.
|
static |
Returns a new standalone BackingStore that takes over the ownership of the given buffer. The destructor of the BackingStore invokes the given deleter callback.
The result can be later passed to SharedArrayBuffer::New. The raw pointer to the buffer must not be passed again to any V8 functions.
|
staticconstexpr |
Definition at line 605 of file v8-array-buffer.h.