Revision: 14361
Author:   [email protected]
Date:     Fri Apr 19 09:38:19 2013
Log: OS::MemMove/OS::MemCopy: Don't call through to generated code when size == 0 to avoid prefetching invalid memory

BUG=chromium:233500

Review URL: https://codereview.chromium.org/14365011
http://code.google.com/p/v8/source/detail?r=14361

Modified:
 /branches/bleeding_edge/src/ia32/codegen-ia32.cc
 /branches/bleeding_edge/src/platform-posix.cc
 /branches/bleeding_edge/src/platform-win32.cc

=======================================
--- /branches/bleeding_edge/src/ia32/codegen-ia32.cc Tue Apr 16 06:17:47 2013 +++ /branches/bleeding_edge/src/ia32/codegen-ia32.cc Fri Apr 19 09:38:19 2013
@@ -635,6 +635,8 @@
   ASSERT(!RelocInfo::RequiresRelocation(desc));
   CPU::FlushICache(buffer, actual_size);
   OS::ProtectCode(buffer, actual_size);
+  // TODO(jkummerow): It would be nice to register this code creation event
+  // with the PROFILE / GDBJIT system.
   return FUNCTION_CAST<OS::MemMoveFunction>(buffer);
 }

=======================================
--- /branches/bleeding_edge/src/platform-posix.cc       Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/platform-posix.cc       Fri Apr 19 09:38:19 2013
@@ -334,6 +334,7 @@

 // Copy memory area. No restrictions.
 void OS::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);
=======================================
--- /branches/bleeding_edge/src/platform-win32.cc       Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/platform-win32.cc       Fri Apr 19 09:38:19 2013
@@ -160,6 +160,7 @@

 // Copy memory area to disjoint memory area.
 void OS::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);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to