OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return 0; // FreeBSD runs on anything. | 88 return 0; // FreeBSD runs on anything. |
89 } | 89 } |
90 | 90 |
91 | 91 |
92 int OS::ActivationFrameAlignment() { | 92 int OS::ActivationFrameAlignment() { |
93 // 16 byte alignment on FreeBSD | 93 // 16 byte alignment on FreeBSD |
94 return 16; | 94 return 16; |
95 } | 95 } |
96 | 96 |
97 | 97 |
| 98 const char* OS::LocalTimezone(double time) { |
| 99 if (isnan(time)) return ""; |
| 100 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |
| 101 struct tm* t = localtime(&tv); |
| 102 if (NULL == t) return ""; |
| 103 return t->tm_zone; |
| 104 } |
| 105 |
| 106 |
| 107 double OS::LocalTimeOffset() { |
| 108 time_t tv = time(NULL); |
| 109 struct tm* t = localtime(&tv); |
| 110 // tm_gmtoff includes any daylight savings offset, so subtract it. |
| 111 return static_cast<double>(t->tm_gmtoff * msPerSecond - |
| 112 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); |
| 113 } |
| 114 |
| 115 |
98 // We keep the lowest and highest addresses mapped as a quick way of | 116 // We keep the lowest and highest addresses mapped as a quick way of |
99 // determining that pointers are outside the heap (used mostly in assertions | 117 // determining that pointers are outside the heap (used mostly in assertions |
100 // and verification). The estimate is conservative, ie, not all addresses in | 118 // and verification). The estimate is conservative, ie, not all addresses in |
101 // 'allocated' space are actually allocated to our heap. The range is | 119 // 'allocated' space are actually allocated to our heap. The range is |
102 // [lowest, highest), inclusive on the low and and exclusive on the high end. | 120 // [lowest, highest), inclusive on the low and and exclusive on the high end. |
103 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); | 121 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); |
104 static void* highest_ever_allocated = reinterpret_cast<void*>(0); | 122 static void* highest_ever_allocated = reinterpret_cast<void*>(0); |
105 | 123 |
106 | 124 |
107 static void UpdateAllocatedSpaceLimits(void* address, int size) { | 125 static void UpdateAllocatedSpaceLimits(void* address, int size) { |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 } | 654 } |
637 | 655 |
638 // This sampler is no longer the active sampler. | 656 // This sampler is no longer the active sampler. |
639 active_sampler_ = NULL; | 657 active_sampler_ = NULL; |
640 active_ = false; | 658 active_ = false; |
641 } | 659 } |
642 | 660 |
643 #endif // ENABLE_LOGGING_AND_PROFILING | 661 #endif // ENABLE_LOGGING_AND_PROFILING |
644 | 662 |
645 } } // namespace v8::internal | 663 } } // namespace v8::internal |
OLD | NEW |