Do not use wide reads in CopyCharsUnsigned.
authoryangguo@chromium.org <yangguo@chromium.org>
Thu, 11 Sep 2014 12:51:05 +0000 (12:51 +0000)
committeryangguo@chromium.org <yangguo@chromium.org>
Thu, 11 Sep 2014 12:51:05 +0000 (12:51 +0000)
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

index 6e5e77a..07b6490 100644 (file)
@@ -1287,20 +1287,10 @@ template <typename sourcechar, typename sinkchar>
 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<int>(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<uintptr_t*>(dest) =
-          *reinterpret_cast<const uintptr_t*>(src);
-      dest += kStepSize;
-      src += kStepSize;
-    }
+  if ((sizeof(*dest) == sizeof(*src)) &&
+      (chars >= static_cast<int>(kMinComplexMemCopy / sizeof(*dest)))) {
+    MemCopy(dest, src, chars * sizeof(*dest));
+    return;
   }
 #endif
   while (dest < limit) {