OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 AIX goes here. For the POSIX comaptible parts | 5 // Platform specific code for AIX goes here. For the POSIX comaptible parts |
6 // the implementation is in platform-posix.cc. | 6 // the implementation is in platform-posix.cc. |
7 | 7 |
8 #include <pthread.h> | 8 #include <pthread.h> |
9 #include <semaphore.h> | 9 #include <semaphore.h> |
10 #include <signal.h> | 10 #include <signal.h> |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 | 174 |
175 VirtualMemory::~VirtualMemory() { | 175 VirtualMemory::~VirtualMemory() { |
176 if (IsReserved()) { | 176 if (IsReserved()) { |
177 bool result = ReleaseRegion(address(), size()); | 177 bool result = ReleaseRegion(address(), size()); |
178 DCHECK(result); | 178 DCHECK(result); |
179 USE(result); | 179 USE(result); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 | 183 bool VirtualMemory::IsReserved() const { return address_ != NULL; } |
184 bool VirtualMemory::IsReserved() { return address_ != NULL; } | |
185 | |
186 | 184 |
187 void VirtualMemory::Reset() { | 185 void VirtualMemory::Reset() { |
188 address_ = NULL; | 186 address_ = NULL; |
189 size_ = 0; | 187 size_ = 0; |
190 } | 188 } |
191 | 189 |
192 | 190 |
193 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { | 191 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { |
194 return CommitRegion(address, size, is_executable); | 192 return CommitRegion(address, size, is_executable); |
195 } | 193 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 234 |
237 | 235 |
238 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { | 236 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { |
239 return munmap(base, size) == 0; | 237 return munmap(base, size) == 0; |
240 } | 238 } |
241 | 239 |
242 | 240 |
243 bool VirtualMemory::HasLazyCommits() { return true; } | 241 bool VirtualMemory::HasLazyCommits() { return true; } |
244 } // namespace base | 242 } // namespace base |
245 } // namespace v8 | 243 } // namespace v8 |
OLD | NEW |