5#ifndef INCLUDE_V8_TYPED_ARRAY_H_
6#define INCLUDE_V8_TYPED_ARRAY_H_
27 static constexpr size_t kMaxByteLength =
28 internal::kMaxSafeBufferSizeForSandbox;
29#elif V8_HOST_ARCH_32_BIT
30 static constexpr size_t kMaxByteLength = std::numeric_limits<int>::max();
33 static constexpr size_t kMaxByteLength =
34 static_cast<size_t>((uint64_t{1} << 53) - 1);
44#ifdef V8_ENABLE_CHECKS
52 static void CheckCast(
Value* obj);
63 static constexpr size_t kMaxLength =
64 TypedArray::kMaxByteLength /
sizeof(uint8_t);
65 static_assert(
sizeof(uint8_t) == 1);
68 size_t byte_offset,
size_t length);
70 size_t byte_offset,
size_t length);
72#ifdef V8_ENABLE_CHECKS
80 static void CheckCast(
Value* obj);
91 static constexpr size_t kMaxLength =
92 TypedArray::kMaxByteLength /
sizeof(uint8_t);
93 static_assert(
sizeof(uint8_t) == 1);
96 size_t byte_offset,
size_t length);
101#ifdef V8_ENABLE_CHECKS
109 static void CheckCast(
Value* obj);
120 static constexpr size_t kMaxLength =
121 TypedArray::kMaxByteLength /
sizeof(int8_t);
122 static_assert(
sizeof(int8_t) == 1);
125 size_t byte_offset,
size_t length);
127 size_t byte_offset,
size_t length);
129#ifdef V8_ENABLE_CHECKS
137 static void CheckCast(
Value* obj);
148 static constexpr size_t kMaxLength =
149 TypedArray::kMaxByteLength /
sizeof(uint16_t);
150 static_assert(
sizeof(uint16_t) == 2);
153 size_t byte_offset,
size_t length);
155 size_t byte_offset,
size_t length);
157#ifdef V8_ENABLE_CHECKS
165 static void CheckCast(
Value* obj);
176 static constexpr size_t kMaxLength =
177 TypedArray::kMaxByteLength /
sizeof(int16_t);
178 static_assert(
sizeof(int16_t) == 2);
181 size_t byte_offset,
size_t length);
183 size_t byte_offset,
size_t length);
185#ifdef V8_ENABLE_CHECKS
193 static void CheckCast(
Value* obj);
204 static constexpr size_t kMaxLength =
205 TypedArray::kMaxByteLength /
sizeof(uint32_t);
206 static_assert(
sizeof(uint32_t) == 4);
209 size_t byte_offset,
size_t length);
211 size_t byte_offset,
size_t length);
213#ifdef V8_ENABLE_CHECKS
221 static void CheckCast(
Value* obj);
232 static constexpr size_t kMaxLength =
233 TypedArray::kMaxByteLength /
sizeof(int32_t);
234 static_assert(
sizeof(int32_t) == 4);
237 size_t byte_offset,
size_t length);
239 size_t byte_offset,
size_t length);
241#ifdef V8_ENABLE_CHECKS
249 static void CheckCast(
Value* obj);
256 static constexpr size_t kMaxLength =
257 TypedArray::kMaxByteLength /
sizeof(uint16_t);
261 size_t byte_offset,
size_t length);
263 size_t byte_offset,
size_t length);
265#ifdef V8_ENABLE_CHECKS
273 static void CheckCast(
Value* obj);
284 static constexpr size_t kMaxLength =
285 TypedArray::kMaxByteLength /
sizeof(float);
286 static_assert(
sizeof(float) == 4);
289 size_t byte_offset,
size_t length);
291 size_t byte_offset,
size_t length);
293#ifdef V8_ENABLE_CHECKS
301 static void CheckCast(
Value* obj);
312 static constexpr size_t kMaxLength =
313 TypedArray::kMaxByteLength /
sizeof(double);
314 static_assert(
sizeof(double) == 8);
317 size_t byte_offset,
size_t length);
319 size_t byte_offset,
size_t length);
321#ifdef V8_ENABLE_CHECKS
329 static void CheckCast(
Value* obj);
340 static constexpr size_t kMaxLength =
341 TypedArray::kMaxByteLength /
sizeof(int64_t);
342 static_assert(
sizeof(int64_t) == 8);
345 size_t byte_offset,
size_t length);
347 size_t byte_offset,
size_t length);
349#ifdef V8_ENABLE_CHECKS
357 static void CheckCast(
Value* obj);
368 static constexpr size_t kMaxLength =
369 TypedArray::kMaxByteLength /
sizeof(uint64_t);
370 static_assert(
sizeof(uint64_t) == 8);
373 size_t byte_offset,
size_t length);
375 size_t byte_offset,
size_t length);
377#ifdef V8_ENABLE_CHECKS
385 static void CheckCast(
Value* obj);
Definition: v8-array-buffer.h:384
Definition: v8-typed-array.h:335
static Local< BigInt64Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< BigInt64Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static BigInt64Array * Cast(Value *value)
Definition: v8-typed-array.h:348
Definition: v8-typed-array.h:363
static Local< BigUint64Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< BigUint64Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static BigUint64Array * Cast(Value *value)
Definition: v8-typed-array.h:376
Definition: v8-typed-array.h:255
static Local< Float16Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< Float16Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Float16Array * Cast(Value *value)
Definition: v8-typed-array.h:264
Definition: v8-typed-array.h:279
static Local< Float32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< Float32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Float32Array * Cast(Value *value)
Definition: v8-typed-array.h:292
Definition: v8-typed-array.h:307
static Local< Float64Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< Float64Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Float64Array * Cast(Value *value)
Definition: v8-typed-array.h:320
Definition: v8-typed-array.h:171
static Int16Array * Cast(Value *value)
Definition: v8-typed-array.h:184
static Local< Int16Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Int16Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
Definition: v8-typed-array.h:227
static Local< Int32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Int32Array * Cast(Value *value)
Definition: v8-typed-array.h:240
static Local< Int32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
Definition: v8-typed-array.h:115
static Int8Array * Cast(Value *value)
Definition: v8-typed-array.h:128
static Local< Int8Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Int8Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
Definition: v8-local-handle.h:266
Definition: v8-typed-array.h:20
static TypedArray * Cast(Value *value)
Definition: v8-typed-array.h:43
Definition: v8-typed-array.h:143
static Local< Uint16Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Uint16Array * Cast(Value *value)
Definition: v8-typed-array.h:156
static Local< Uint16Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
Definition: v8-typed-array.h:199
static Uint32Array * Cast(Value *value)
Definition: v8-typed-array.h:212
static Local< Uint32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< Uint32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
Definition: v8-typed-array.h:58
static Uint8Array * Cast(Value *value)
Definition: v8-typed-array.h:71
static Local< Uint8Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< Uint8Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
Definition: v8-typed-array.h:86
static Local< Uint8ClampedArray > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< Uint8ClampedArray > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Uint8ClampedArray * Cast(Value *value)
Definition: v8-typed-array.h:100
Definition: v8-value.h:32
Definition: libplatform.h:15
#define V8_EXPORT
Definition: v8config.h:793
#define V8_INLINE
Definition: v8config.h:499