OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return 0; // OpenBSD runs on anything. | 87 return 0; // OpenBSD runs on anything. |
88 } | 88 } |
89 | 89 |
90 | 90 |
91 int OS::ActivationFrameAlignment() { | 91 int OS::ActivationFrameAlignment() { |
92 // 16 byte alignment on OpenBSD | 92 // 16 byte alignment on OpenBSD |
93 return 16; | 93 return 16; |
94 } | 94 } |
95 | 95 |
96 | 96 |
| 97 const char* OS::LocalTimezone(double time) { |
| 98 if (isnan(time)) return ""; |
| 99 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |
| 100 struct tm* t = localtime(&tv); |
| 101 if (NULL == t) return ""; |
| 102 return t->tm_zone; |
| 103 } |
| 104 |
| 105 |
| 106 double OS::LocalTimeOffset() { |
| 107 time_t tv = time(NULL); |
| 108 struct tm* t = localtime(&tv); |
| 109 // tm_gmtoff includes any daylight savings offset, so subtract it. |
| 110 return static_cast<double>(t->tm_gmtoff * msPerSecond - |
| 111 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); |
| 112 } |
| 113 |
| 114 |
97 // We keep the lowest and highest addresses mapped as a quick way of | 115 // We keep the lowest and highest addresses mapped as a quick way of |
98 // determining that pointers are outside the heap (used mostly in assertions | 116 // determining that pointers are outside the heap (used mostly in assertions |
99 // and verification). The estimate is conservative, ie, not all addresses in | 117 // and verification). The estimate is conservative, ie, not all addresses in |
100 // 'allocated' space are actually allocated to our heap. The range is | 118 // 'allocated' space are actually allocated to our heap. The range is |
101 // [lowest, highest), inclusive on the low and and exclusive on the high end. | 119 // [lowest, highest), inclusive on the low and and exclusive on the high end. |
102 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); | 120 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); |
103 static void* highest_ever_allocated = reinterpret_cast<void*>(0); | 121 static void* highest_ever_allocated = reinterpret_cast<void*>(0); |
104 | 122 |
105 | 123 |
106 static void UpdateAllocatedSpaceLimits(void* address, int size) { | 124 static void UpdateAllocatedSpaceLimits(void* address, int size) { |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 } | 606 } |
589 | 607 |
590 // This sampler is no longer the active sampler. | 608 // This sampler is no longer the active sampler. |
591 active_sampler_ = NULL; | 609 active_sampler_ = NULL; |
592 active_ = false; | 610 active_ = false; |
593 } | 611 } |
594 | 612 |
595 #endif // ENABLE_LOGGING_AND_PROFILING | 613 #endif // ENABLE_LOGGING_AND_PROFILING |
596 | 614 |
597 } } // namespace v8::internal | 615 } } // namespace v8::internal |
OLD | NEW |