v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
runtime-typedarray.cc File Reference
#include "src/base/atomicops.h"
#include "src/common/message-template.h"
#include "src/execution/arguments-inl.h"
#include "src/heap/factory.h"
#include "src/objects/elements.h"
#include "src/objects/js-array-buffer-inl.h"
#include "src/objects/objects-inl.h"
#include "src/runtime/runtime-utils.h"
#include "src/runtime/runtime.h"
#include "third_party/fp16/src/include/fp16.h"
Include dependency graph for runtime-typedarray.cc:

Go to the source code of this file.

Namespaces

namespace  v8
 
namespace  v8::internal
 

Macros

#define TYPED_ARRAY_SORT(Type, type, TYPE, ctype)
 

Functions

 v8::internal::RUNTIME_FUNCTION (Runtime_ArrayBufferDetach)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_ArrayBufferSetDetachKey)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArrayCopyElements)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArrayGetBuffer)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_GrowableSharedArrayBufferByteLength)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArraySortFast)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArraySet)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_ArrayBufferMaxByteLength)
 

Macro Definition Documentation

◆ TYPED_ARRAY_SORT

#define TYPED_ARRAY_SORT ( Type,
type,
TYPE,
ctype )
Value:
case kExternal##Type##Array: { \
ctype* data = copy_data ? reinterpret_cast<ctype*>(data_copy_ptr) \
: static_cast<ctype*>(array->DataPtr()); \
SBXCHECK(length * sizeof(ctype) == byte_length); \
if (kExternal##Type##Array == kExternalFloat64Array || \
kExternal##Type##Array == kExternalFloat32Array) { \
if (COMPRESS_POINTERS_BOOL && alignof(ctype) > kTaggedSize) { \
/* TODO(ishell, v8:8875): See UnalignedSlot<T> for details. */ \
std::sort(UnalignedSlot<ctype>(data), \
UnalignedSlot<ctype>(data + length), CompareNum<ctype>); \
} else { \
std::sort(data, data + length, CompareNum<ctype>); \
} \
} else if (kExternal##Type##Array == kExternalFloat16Array) { \
DCHECK_IMPLIES(COMPRESS_POINTERS_BOOL, alignof(ctype) <= kTaggedSize); \
std::sort(data, data + length, LessThanFloat16RawBits); \
} else { \
if (COMPRESS_POINTERS_BOOL && alignof(ctype) > kTaggedSize) { \
/* TODO(ishell, v8:8875): See UnalignedSlot<T> for details. */ \
std::sort(UnalignedSlot<ctype>(data), \
UnalignedSlot<ctype>(data + length)); \
} else { \
std::sort(data, data + length); \
} \
} \
break; \
}
#define COMPRESS_POINTERS_BOOL
Definition globals.h:99