| 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 11 matching lines...) Expand all Loading... |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 // Platform specific code for MacOS goes here. For the POSIX comaptible parts | 28 // Platform specific code for MacOS goes here. For the POSIX comaptible parts |
| 29 // the implementation is in platform-posix.cc. | 29 // the implementation is in platform-posix.cc. |
| 30 | 30 |
| 31 #include <dlfcn.h> | 31 #include <dlfcn.h> |
| 32 #include <string> | |
| 33 #include <unistd.h> | 32 #include <unistd.h> |
| 34 #include <sys/mman.h> | 33 #include <sys/mman.h> |
| 35 #include <mach/mach_init.h> | 34 #include <mach/mach_init.h> |
| 36 #include <mach-o/dyld.h> | 35 #include <mach-o/dyld.h> |
| 37 #include <mach-o/getsect.h> | 36 #include <mach-o/getsect.h> |
| 38 | 37 |
| 39 #include <AvailabilityMacros.h> | 38 #include <AvailabilityMacros.h> |
| 40 | 39 |
| 41 #include <pthread.h> | 40 #include <pthread.h> |
| 42 #include <semaphore.h> | 41 #include <semaphore.h> |
| 43 #include <signal.h> | 42 #include <signal.h> |
| 44 #include <libkern/OSAtomic.h> | 43 #include <libkern/OSAtomic.h> |
| 45 #include <mach/mach.h> | 44 #include <mach/mach.h> |
| 46 #include <mach/semaphore.h> | 45 #include <mach/semaphore.h> |
| 47 #include <mach/task.h> | 46 #include <mach/task.h> |
| 48 #include <mach/vm_statistics.h> | 47 #include <mach/vm_statistics.h> |
| 49 #include <sys/time.h> | 48 #include <sys/time.h> |
| 50 #include <sys/resource.h> | 49 #include <sys/resource.h> |
| 51 #include <sys/types.h> | 50 #include <sys/types.h> |
| 52 #include <stdarg.h> | 51 #include <stdarg.h> |
| 53 #include <stdlib.h> | 52 #include <stdlib.h> |
| 53 #include <errno.h> |
| 54 | 54 |
| 55 #include <errno.h> | 55 #include <string> |
| 56 | 56 |
| 57 #undef MAP_TYPE | 57 #undef MAP_TYPE |
| 58 | 58 |
| 59 #include "v8.h" | 59 #include "v8.h" |
| 60 | 60 |
| 61 #include "platform.h" | 61 #include "platform.h" |
| 62 #include "vm-state-inl.h" | 62 #include "vm-state-inl.h" |
| 63 | 63 |
| 64 // Manually define these here as weak imports, rather than including execinfo.h. | 64 // Manually define these here as weak imports, rather than including execinfo.h. |
| 65 // This lets us launch on 10.4 which does not have these calls. | 65 // This lets us launch on 10.4 which does not have these calls. |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 Top::WakeUpRuntimeProfilerThreadBeforeShutdown(); | 710 Top::WakeUpRuntimeProfilerThreadBeforeShutdown(); |
| 711 pthread_join(data_->sampler_thread_, NULL); | 711 pthread_join(data_->sampler_thread_, NULL); |
| 712 | 712 |
| 713 // Deallocate Mach port for thread. | 713 // Deallocate Mach port for thread. |
| 714 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); | 714 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); |
| 715 } | 715 } |
| 716 | 716 |
| 717 #endif // ENABLE_LOGGING_AND_PROFILING | 717 #endif // ENABLE_LOGGING_AND_PROFILING |
| 718 | 718 |
| 719 } } // namespace v8::internal | 719 } } // namespace v8::internal |
| OLD | NEW |