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

Side by Side Diff: src/platform-macos.cc

Issue 326323002: Don't use LOG() from platform. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-openbsd.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Platform-specific code for MacOS goes here. For the POSIX-compatible 5 // Platform-specific code for MacOS goes here. For the POSIX-compatible
6 // parts, the implementation is in platform-posix.cc. 6 // parts, the implementation is in platform-posix.cc.
7 7
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #include <sys/mman.h> 10 #include <sys/mman.h>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 size_t* allocated, 54 size_t* allocated,
55 bool is_executable) { 55 bool is_executable) {
56 const size_t msize = RoundUp(requested, getpagesize()); 56 const size_t msize = RoundUp(requested, getpagesize());
57 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); 57 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
58 void* mbase = mmap(OS::GetRandomMmapAddr(), 58 void* mbase = mmap(OS::GetRandomMmapAddr(),
59 msize, 59 msize,
60 prot, 60 prot,
61 MAP_PRIVATE | MAP_ANON, 61 MAP_PRIVATE | MAP_ANON,
62 kMmapFd, 62 kMmapFd,
63 kMmapFdOffset); 63 kMmapFdOffset);
64 if (mbase == MAP_FAILED) { 64 if (mbase == MAP_FAILED) return NULL;
65 LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed"));
66 return NULL;
67 }
68 *allocated = msize; 65 *allocated = msize;
69 return mbase; 66 return mbase;
70 } 67 }
71 68
72 69
73 class PosixMemoryMappedFile : public OS::MemoryMappedFile { 70 class PosixMemoryMappedFile : public OS::MemoryMappedFile {
74 public: 71 public:
75 PosixMemoryMappedFile(FILE* file, void* memory, int size) 72 PosixMemoryMappedFile(FILE* file, void* memory, int size)
76 : file_(file), memory_(memory), size_(size) { } 73 : file_(file), memory_(memory), size_(size) { }
77 virtual ~PosixMemoryMappedFile(); 74 virtual ~PosixMemoryMappedFile();
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { 298 bool VirtualMemory::ReleaseRegion(void* address, size_t size) {
302 return munmap(address, size) == 0; 299 return munmap(address, size) == 0;
303 } 300 }
304 301
305 302
306 bool VirtualMemory::HasLazyCommits() { 303 bool VirtualMemory::HasLazyCommits() {
307 return false; 304 return false;
308 } 305 }
309 306
310 } } // namespace v8::internal 307 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698