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);
static Local< BigInt64Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static V8_INLINE BigInt64Array * Cast(Value *value)
static Local< BigInt64Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static V8_INLINE BigUint64Array * Cast(Value *value)
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 Local< Float16Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Float16Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static V8_INLINE Float16Array * Cast(Value *value)
static Local< Float32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Float32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static V8_INLINE Float32Array * Cast(Value *value)
static V8_INLINE Float64Array * Cast(Value *value)
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 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)
static V8_INLINE Int16Array * Cast(Value *value)
static V8_INLINE Int32Array * Cast(Value *value)
static Local< Int32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Int32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< Int8Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static V8_INLINE Int8Array * Cast(Value *value)
static Local< Int8Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static V8_INLINE TypedArray * Cast(Value *value)
static Local< Uint16Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static V8_INLINE Uint16Array * Cast(Value *value)
static Local< Uint16Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static V8_INLINE Uint32Array * Cast(Value *value)
static Local< Uint32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Uint32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static V8_INLINE Uint8Array * Cast(Value *value)
static Local< Uint8Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Uint8Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
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 V8_INLINE Uint8ClampedArray * Cast(Value *value)