Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: src/utils.h

Issue 2291773002: The function CopyCharsUnsigned(uint8_t* dest, const uint8_t* src, size_t chars) is now a specializa…
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index 8eca39207d4aa55b222870a2e36e7ce53a273bc8..7badfe09b138518d557bc062a2b43d3258c05e63 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -1154,7 +1154,9 @@ Vector<const char> ReadFile(FILE* file,
template <typename sourcechar, typename sinkchar>
INLINE(static void CopyCharsUnsigned(sinkchar* dest, const sourcechar* src,
size_t chars));
-#if defined(V8_HOST_ARCH_ARM)
+#if defined(V8_HOST_ARCH_X64)
+INLINE(void CopyCharsUnsigned(uint8_t* dest, const uint8_t* src, size_t chars));
+#elif defined(V8_HOST_ARCH_ARM)
INLINE(void CopyCharsUnsigned(uint8_t* dest, const uint8_t* src, size_t chars));
INLINE(void CopyCharsUnsigned(uint16_t* dest, const uint8_t* src,
size_t chars));
@@ -1213,7 +1215,16 @@ void CopyCharsUnsigned(sinkchar* dest, const sourcechar* src, size_t chars) {
}
-#if defined(V8_HOST_ARCH_ARM)
+#if defined(V8_HOST_ARCH_X64)
+void CopyCharsUnsigned(uint8_t* dest, const uint8_t* src, size_t chars) {
+ uint8_t* limit = dest + chars;
+ if (sizeof(*dest) == sizeof(*src)) {
Jakob Kummerow 2016/08/30 13:29:28 Well, this check is pretty pointless, because alwa
+ MemCopy(dest, src, chars * sizeof(*dest));
+ } else {
+ while (dest < limit) *dest++ = *src++;
+ }
+}
+#elif defined(V8_HOST_ARCH_ARM)
void CopyCharsUnsigned(uint8_t* dest, const uint8_t* src, size_t chars) {
switch (static_cast<unsigned>(chars)) {
case 0:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698