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 21 matching lines...) Expand all Loading... |
32 #include <sys/mman.h> | 32 #include <sys/mman.h> |
33 #include <mach/mach_init.h> | 33 #include <mach/mach_init.h> |
34 #include <mach-o/dyld.h> | 34 #include <mach-o/dyld.h> |
35 #include <mach-o/getsect.h> | 35 #include <mach-o/getsect.h> |
36 | 36 |
37 #include <AvailabilityMacros.h> | 37 #include <AvailabilityMacros.h> |
38 | 38 |
39 #include <pthread.h> | 39 #include <pthread.h> |
40 #include <semaphore.h> | 40 #include <semaphore.h> |
41 #include <signal.h> | 41 #include <signal.h> |
| 42 #include <libkern/OSAtomic.h> |
42 #include <mach/mach.h> | 43 #include <mach/mach.h> |
43 #include <mach/semaphore.h> | 44 #include <mach/semaphore.h> |
44 #include <mach/task.h> | 45 #include <mach/task.h> |
45 #include <mach/vm_statistics.h> | 46 #include <mach/vm_statistics.h> |
46 #include <sys/time.h> | 47 #include <sys/time.h> |
47 #include <sys/resource.h> | 48 #include <sys/resource.h> |
48 #include <sys/types.h> | 49 #include <sys/types.h> |
49 #include <stdarg.h> | 50 #include <stdarg.h> |
50 #include <stdlib.h> | 51 #include <stdlib.h> |
51 | 52 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 253 } |
253 | 254 |
254 | 255 |
255 int OS::ActivationFrameAlignment() { | 256 int OS::ActivationFrameAlignment() { |
256 // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI | 257 // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI |
257 // Function Call Guide". | 258 // Function Call Guide". |
258 return 16; | 259 return 16; |
259 } | 260 } |
260 | 261 |
261 | 262 |
| 263 void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) { |
| 264 OSMemoryBarrier(); |
| 265 *ptr = value; |
| 266 } |
| 267 |
| 268 |
262 const char* OS::LocalTimezone(double time) { | 269 const char* OS::LocalTimezone(double time) { |
263 if (isnan(time)) return ""; | 270 if (isnan(time)) return ""; |
264 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); | 271 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |
265 struct tm* t = localtime(&tv); | 272 struct tm* t = localtime(&tv); |
266 if (NULL == t) return ""; | 273 if (NULL == t) return ""; |
267 return t->tm_zone; | 274 return t->tm_zone; |
268 } | 275 } |
269 | 276 |
270 | 277 |
271 double OS::LocalTimeOffset() { | 278 double OS::LocalTimeOffset() { |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 | 656 |
650 // Deallocate Mach port for thread. | 657 // Deallocate Mach port for thread. |
651 if (IsProfiling()) { | 658 if (IsProfiling()) { |
652 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); | 659 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); |
653 } | 660 } |
654 } | 661 } |
655 | 662 |
656 #endif // ENABLE_LOGGING_AND_PROFILING | 663 #endif // ENABLE_LOGGING_AND_PROFILING |
657 | 664 |
658 } } // namespace v8::internal | 665 } } // namespace v8::internal |
OLD | NEW |