From 90dc5c9e66ef1778cb8425c43c2f37b6799260c3 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Thu, 11 Sep 2014 12:51:05 +0000 Subject: [PATCH] Do not use wide reads in CopyCharsUnsigned. R=jkummerow@chromium.org BUG=chromium:412967 LOG=Y Review URL: https://codereview.chromium.org/566583002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23876 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/utils.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/utils.h b/src/utils.h index 6e5e77a..07b6490 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1287,20 +1287,10 @@ template void CopyCharsUnsigned(sinkchar* dest, const sourcechar* src, int chars) { sinkchar* limit = dest + chars; #ifdef V8_HOST_CAN_READ_UNALIGNED - if (sizeof(*dest) == sizeof(*src)) { - if (chars >= static_cast(kMinComplexMemCopy / sizeof(*dest))) { - MemCopy(dest, src, chars * sizeof(*dest)); - return; - } - // Number of characters in a uintptr_t. - static const int kStepSize = sizeof(uintptr_t) / sizeof(*dest); // NOLINT - DCHECK(dest + kStepSize > dest); // Check for overflow. - while (dest + kStepSize <= limit) { - *reinterpret_cast(dest) = - *reinterpret_cast(src); - dest += kStepSize; - src += kStepSize; - } + if ((sizeof(*dest) == sizeof(*src)) && + (chars >= static_cast(kMinComplexMemCopy / sizeof(*dest)))) { + MemCopy(dest, src, chars * sizeof(*dest)); + return; } #endif while (dest < limit) { -- 2.7.4