OLD | NEW |
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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 double OS::LocalTimeOffset() { | 214 double OS::LocalTimeOffset() { |
215 time_t tv = time(NULL); | 215 time_t tv = time(NULL); |
216 struct tm* t = localtime(&tv); | 216 struct tm* t = localtime(&tv); |
217 // tm_gmtoff includes any daylight savings offset, so subtract it. | 217 // tm_gmtoff includes any daylight savings offset, so subtract it. |
218 return static_cast<double>(t->tm_gmtoff * msPerSecond - | 218 return static_cast<double>(t->tm_gmtoff * msPerSecond - |
219 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); | 219 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); |
220 } | 220 } |
221 | 221 |
222 | 222 |
223 int OS::StackWalk(Vector<StackFrame> frames) { | |
224 // If weak link to execinfo lib has failed, ie because we are on 10.4, abort. | |
225 if (backtrace == NULL) return 0; | |
226 | |
227 return POSIXBacktraceHelper<backtrace, backtrace_symbols>::StackWalk(frames); | |
228 } | |
229 | |
230 | |
231 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } | 223 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } |
232 | 224 |
233 | 225 |
234 VirtualMemory::VirtualMemory(size_t size) | 226 VirtualMemory::VirtualMemory(size_t size) |
235 : address_(ReserveRegion(size)), size_(size) { } | 227 : address_(ReserveRegion(size)), size_(size) { } |
236 | 228 |
237 | 229 |
238 VirtualMemory::VirtualMemory(size_t size, size_t alignment) | 230 VirtualMemory::VirtualMemory(size_t size, size_t alignment) |
239 : address_(NULL), size_(0) { | 231 : address_(NULL), size_(0) { |
240 ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment()))); | 232 ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment()))); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { | 346 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { |
355 return munmap(address, size) == 0; | 347 return munmap(address, size) == 0; |
356 } | 348 } |
357 | 349 |
358 | 350 |
359 bool VirtualMemory::HasLazyCommits() { | 351 bool VirtualMemory::HasLazyCommits() { |
360 return false; | 352 return false; |
361 } | 353 } |
362 | 354 |
363 } } // namespace v8::internal | 355 } } // namespace v8::internal |
OLD | NEW |