| 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 |
| 223 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } | 231 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } |
| 224 | 232 |
| 225 | 233 |
| 226 VirtualMemory::VirtualMemory(size_t size) | 234 VirtualMemory::VirtualMemory(size_t size) |
| 227 : address_(ReserveRegion(size)), size_(size) { } | 235 : address_(ReserveRegion(size)), size_(size) { } |
| 228 | 236 |
| 229 | 237 |
| 230 VirtualMemory::VirtualMemory(size_t size, size_t alignment) | 238 VirtualMemory::VirtualMemory(size_t size, size_t alignment) |
| 231 : address_(NULL), size_(0) { | 239 : address_(NULL), size_(0) { |
| 232 ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment()))); | 240 ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment()))); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { | 354 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { |
| 347 return munmap(address, size) == 0; | 355 return munmap(address, size) == 0; |
| 348 } | 356 } |
| 349 | 357 |
| 350 | 358 |
| 351 bool VirtualMemory::HasLazyCommits() { | 359 bool VirtualMemory::HasLazyCommits() { |
| 352 return false; | 360 return false; |
| 353 } | 361 } |
| 354 | 362 |
| 355 } } // namespace v8::internal | 363 } } // namespace v8::internal |
| OLD | NEW |