diff options
Diffstat (limited to 'deps/v8/src/utils.cc')
-rw-r--r-- | deps/v8/src/utils.cc | 66 |
1 files changed, 1 insertions, 65 deletions
diff --git a/deps/v8/src/utils.cc b/deps/v8/src/utils.cc index e799e9ad85..e8d84e12c8 100644 --- a/deps/v8/src/utils.cc +++ b/deps/v8/src/utils.cc @@ -11,6 +11,7 @@ #include "src/base/functional.h" #include "src/base/logging.h" #include "src/base/platform/platform.h" +#include "src/memcopy.h" namespace v8 { namespace internal { @@ -335,71 +336,6 @@ void StringBuilder::AddFormattedList(const char* format, va_list list) { } } -#if V8_TARGET_ARCH_IA32 -static void MemMoveWrapper(void* dest, const void* src, size_t size) { - memmove(dest, src, size); -} - - -// Initialize to library version so we can call this at any time during startup. -static MemMoveFunction memmove_function = &MemMoveWrapper; - -// Defined in codegen-ia32.cc. -MemMoveFunction CreateMemMoveFunction(); - -// Copy memory area to disjoint memory area. -void MemMove(void* dest, const void* src, size_t size) { - if (size == 0) return; - // Note: here we rely on dependent reads being ordered. This is true - // on all architectures we currently support. - (*memmove_function)(dest, src, size); -} - -#elif V8_OS_POSIX && V8_HOST_ARCH_ARM -void MemCopyUint16Uint8Wrapper(uint16_t* dest, const uint8_t* src, - size_t chars) { - uint16_t* limit = dest + chars; - while (dest < limit) { - *dest++ = static_cast<uint16_t>(*src++); - } -} - -V8_EXPORT_PRIVATE MemCopyUint8Function memcopy_uint8_function = - &MemCopyUint8Wrapper; -MemCopyUint16Uint8Function memcopy_uint16_uint8_function = - &MemCopyUint16Uint8Wrapper; -// Defined in codegen-arm.cc. -MemCopyUint8Function CreateMemCopyUint8Function(MemCopyUint8Function stub); -MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function( - MemCopyUint16Uint8Function stub); - -#elif V8_OS_POSIX && V8_HOST_ARCH_MIPS -V8_EXPORT_PRIVATE MemCopyUint8Function memcopy_uint8_function = - &MemCopyUint8Wrapper; -// Defined in codegen-mips.cc. -MemCopyUint8Function CreateMemCopyUint8Function(MemCopyUint8Function stub); -#endif - - -static bool g_memcopy_functions_initialized = false; - -void init_memcopy_functions() { - if (g_memcopy_functions_initialized) return; - g_memcopy_functions_initialized = true; -#if V8_TARGET_ARCH_IA32 - MemMoveFunction generated_memmove = CreateMemMoveFunction(); - if (generated_memmove != nullptr) { - memmove_function = generated_memmove; - } -#elif V8_OS_POSIX && V8_HOST_ARCH_ARM - memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper); - memcopy_uint16_uint8_function = - CreateMemCopyUint16Uint8Function(&MemCopyUint16Uint8Wrapper); -#elif V8_OS_POSIX && V8_HOST_ARCH_MIPS - memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper); -#endif -} - // Returns false iff d is NaN, +0, or -0. bool DoubleToBoolean(double d) { IeeeDoubleArchType u; |