Revision: 21810
Author:   [email protected]
Date:     Thu Jun 12 14:11:27 2014 UTC
Log:      Don't use LOG() from platform.

All places that use OS::Allocate either CHECK() that the result is non-NULL,
or use a reasonable fallback if they can't mmap memory.

BUG=none
[email protected]
LOG=n

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

Modified:
 /branches/bleeding_edge/src/platform-cygwin.cc
 /branches/bleeding_edge/src/platform-freebsd.cc
 /branches/bleeding_edge/src/platform-linux.cc
 /branches/bleeding_edge/src/platform-macos.cc
 /branches/bleeding_edge/src/platform-openbsd.cc
 /branches/bleeding_edge/src/platform-qnx.cc
 /branches/bleeding_edge/src/platform-solaris.cc
 /branches/bleeding_edge/src/platform-win32.cc

=======================================
--- /branches/bleeding_edge/src/platform-cygwin.cc Thu Jun 12 04:30:12 2014 UTC +++ /branches/bleeding_edge/src/platform-cygwin.cc Thu Jun 12 14:11:27 2014 UTC
@@ -52,10 +52,7 @@
   const size_t msize = RoundUp(requested, sysconf(_SC_PAGESIZE));
   int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-  if (mbase == MAP_FAILED) {
-    LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed"));
-    return NULL;
-  }
+  if (mbase == MAP_FAILED) return NULL;
   *allocated = msize;
   return mbase;
 }
=======================================
--- /branches/bleeding_edge/src/platform-freebsd.cc Thu Jun 12 04:30:12 2014 UTC +++ /branches/bleeding_edge/src/platform-freebsd.cc Thu Jun 12 14:11:27 2014 UTC
@@ -61,10 +61,7 @@
   int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0);
   void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0);

-  if (mbase == MAP_FAILED) {
-    LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed"));
-    return NULL;
-  }
+  if (mbase == MAP_FAILED) return NULL;
   *allocated = msize;
   return mbase;
 }
=======================================
--- /branches/bleeding_edge/src/platform-linux.cc Thu Jun 12 04:30:12 2014 UTC +++ /branches/bleeding_edge/src/platform-linux.cc Thu Jun 12 14:11:27 2014 UTC
@@ -118,11 +118,7 @@
   int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
   void* addr = OS::GetRandomMmapAddr();
void* mbase = mmap(addr, msize, prot, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-  if (mbase == MAP_FAILED) {
-    LOG(i::Isolate::Current(),
-        StringEvent("OS::Allocate", "mmap failed"));
-    return NULL;
-  }
+  if (mbase == MAP_FAILED) return NULL;
   *allocated = msize;
   return mbase;
 }
=======================================
--- /branches/bleeding_edge/src/platform-macos.cc Tue Jun 3 08:12:43 2014 UTC +++ /branches/bleeding_edge/src/platform-macos.cc Thu Jun 12 14:11:27 2014 UTC
@@ -61,10 +61,7 @@
                      MAP_PRIVATE | MAP_ANON,
                      kMmapFd,
                      kMmapFdOffset);
-  if (mbase == MAP_FAILED) {
-    LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed"));
-    return NULL;
-  }
+  if (mbase == MAP_FAILED) return NULL;
   *allocated = msize;
   return mbase;
 }
=======================================
--- /branches/bleeding_edge/src/platform-openbsd.cc Thu Jun 12 04:30:12 2014 UTC +++ /branches/bleeding_edge/src/platform-openbsd.cc Thu Jun 12 14:11:27 2014 UTC
@@ -59,11 +59,7 @@
   int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
   void* addr = OS::GetRandomMmapAddr();
   void* mbase = mmap(addr, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0);
-  if (mbase == MAP_FAILED) {
-    LOG(i::Isolate::Current(),
-        StringEvent("OS::Allocate", "mmap failed"));
-    return NULL;
-  }
+  if (mbase == MAP_FAILED) return NULL;
   *allocated = msize;
   return mbase;
 }
=======================================
--- /branches/bleeding_edge/src/platform-qnx.cc Thu Jun 12 04:30:12 2014 UTC
+++ /branches/bleeding_edge/src/platform-qnx.cc Thu Jun 12 14:11:27 2014 UTC
@@ -110,11 +110,7 @@
   int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
   void* addr = OS::GetRandomMmapAddr();
void* mbase = mmap(addr, msize, prot, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-  if (mbase == MAP_FAILED) {
-    LOG(i::Isolate::Current(),
-        StringEvent("OS::Allocate", "mmap failed"));
-    return NULL;
-  }
+  if (mbase == MAP_FAILED) return NULL;
   *allocated = msize;
   return mbase;
 }
=======================================
--- /branches/bleeding_edge/src/platform-solaris.cc Thu Jun 12 04:30:12 2014 UTC +++ /branches/bleeding_edge/src/platform-solaris.cc Thu Jun 12 14:11:27 2014 UTC
@@ -77,10 +77,7 @@
   int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
   void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0);

-  if (mbase == MAP_FAILED) {
-    LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed"));
-    return NULL;
-  }
+  if (mbase == MAP_FAILED) return NULL;
   *allocated = msize;
   return mbase;
 }
=======================================
--- /branches/bleeding_edge/src/platform-win32.cc Wed Jun 11 18:12:03 2014 UTC +++ /branches/bleeding_edge/src/platform-win32.cc Thu Jun 12 14:11:27 2014 UTC
@@ -766,10 +766,7 @@
                                         MEM_COMMIT | MEM_RESERVE,
                                         prot);

-  if (mbase == NULL) {
- LOG(Isolate::Current(), StringEvent("OS::Allocate", "VirtualAlloc failed"));
-    return NULL;
-  }
+  if (mbase == NULL) return NULL;

ASSERT(IsAligned(reinterpret_cast<size_t>(mbase), OS::AllocateAlignment()));

--
--
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/d/optout.

Reply via email to