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

Side by Side Diff: src/platform.h

Issue 104353002: MIPS: Faster memcpy. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Rebased Created 7 years 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 unified diff | Download patch
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/platform-posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 static void MemCopyUint16Uint8Wrapper(uint16_t* dest, 358 static void MemCopyUint16Uint8Wrapper(uint16_t* dest,
359 const uint8_t* src, 359 const uint8_t* src,
360 size_t chars); 360 size_t chars);
361 // For values < 12, the assembler function is slower than the inlined C code. 361 // For values < 12, the assembler function is slower than the inlined C code.
362 static const int kMinComplexConvertMemCopy = 12; 362 static const int kMinComplexConvertMemCopy = 12;
363 static void MemCopyUint16Uint8(uint16_t* dest, 363 static void MemCopyUint16Uint8(uint16_t* dest,
364 const uint8_t* src, 364 const uint8_t* src,
365 size_t size) { 365 size_t size) {
366 (*memcopy_uint16_uint8_function)(dest, src, size); 366 (*memcopy_uint16_uint8_function)(dest, src, size);
367 } 367 }
368 #elif defined(V8_HOST_ARCH_MIPS)
369 typedef void (*MemCopyUint8Function)(uint8_t* dest,
370 const uint8_t* src,
371 size_t size);
372 static MemCopyUint8Function memcopy_uint8_function;
373 static void MemCopyUint8Wrapper(uint8_t* dest,
374 const uint8_t* src,
375 size_t chars) {
376 memcpy(dest, src, chars);
377 }
378 // For values < 16, the assembler function is slower than the inlined C code.
379 static const int kMinComplexMemCopy = 16;
380 static void MemCopy(void* dest, const void* src, size_t size) {
381 (*memcopy_uint8_function)(reinterpret_cast<uint8_t*>(dest),
382 reinterpret_cast<const uint8_t*>(src),
383 size);
384 }
385 static void MemMove(void* dest, const void* src, size_t size) {
386 memmove(dest, src, size);
387 }
368 #else 388 #else
369 // Copy memory area to disjoint memory area. 389 // Copy memory area to disjoint memory area.
370 static void MemCopy(void* dest, const void* src, size_t size) { 390 static void MemCopy(void* dest, const void* src, size_t size) {
371 memcpy(dest, src, size); 391 memcpy(dest, src, size);
372 } 392 }
373 static void MemMove(void* dest, const void* src, size_t size) { 393 static void MemMove(void* dest, const void* src, size_t size) {
374 memmove(dest, src, size); 394 memmove(dest, src, size);
375 } 395 }
376 static const int kMinComplexMemCopy = 16 * kPointerSize; 396 static const int kMinComplexMemCopy = 16 * kPointerSize;
377 #endif // V8_TARGET_ARCH_IA32 397 #endif // V8_TARGET_ARCH_IA32
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 char name_[kMaxThreadNameLength]; 608 char name_[kMaxThreadNameLength];
589 int stack_size_; 609 int stack_size_;
590 Semaphore* start_semaphore_; 610 Semaphore* start_semaphore_;
591 611
592 DISALLOW_COPY_AND_ASSIGN(Thread); 612 DISALLOW_COPY_AND_ASSIGN(Thread);
593 }; 613 };
594 614
595 } } // namespace v8::internal 615 } } // namespace v8::internal
596 616
597 #endif // V8_PLATFORM_H_ 617 #endif // V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/platform-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698