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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 fclose(file_); | 204 fclose(file_); |
205 } | 205 } |
206 | 206 |
207 | 207 |
208 void OS::LogSharedLibraryAddresses() { | 208 void OS::LogSharedLibraryAddresses() { |
209 #ifdef ENABLE_LOGGING_AND_PROFILING | 209 #ifdef ENABLE_LOGGING_AND_PROFILING |
210 unsigned int images_count = _dyld_image_count(); | 210 unsigned int images_count = _dyld_image_count(); |
211 for (unsigned int i = 0; i < images_count; ++i) { | 211 for (unsigned int i = 0; i < images_count; ++i) { |
212 const mach_header* header = _dyld_get_image_header(i); | 212 const mach_header* header = _dyld_get_image_header(i); |
213 if (header == NULL) continue; | 213 if (header == NULL) continue; |
| 214 #if V8_HOST_ARCH_X64 |
| 215 uint64_t size; |
| 216 char* code_ptr = getsectdatafromheader_64( |
| 217 (mach_header_64*)header, SEG_TEXT, SECT_TEXT, &size); |
| 218 #else |
214 unsigned int size; | 219 unsigned int size; |
215 char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size); | 220 char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size); |
| 221 #endif |
216 if (code_ptr == NULL) continue; | 222 if (code_ptr == NULL) continue; |
217 const uintptr_t slide = _dyld_get_image_vmaddr_slide(i); | 223 const uintptr_t slide = _dyld_get_image_vmaddr_slide(i); |
218 const uintptr_t start = reinterpret_cast<uintptr_t>(code_ptr) + slide; | 224 const uintptr_t start = reinterpret_cast<uintptr_t>(code_ptr) + slide; |
219 LOG(SharedLibraryEvent(_dyld_get_image_name(i), start, start + size)); | 225 LOG(SharedLibraryEvent(_dyld_get_image_name(i), start, start + size)); |
220 } | 226 } |
221 #endif // ENABLE_LOGGING_AND_PROFILING | 227 #endif // ENABLE_LOGGING_AND_PROFILING |
222 } | 228 } |
223 | 229 |
224 | 230 |
225 double OS::nan_value() { | 231 double OS::nan_value() { |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 618 |
613 // Deallocate Mach port for thread. | 619 // Deallocate Mach port for thread. |
614 if (IsProfiling()) { | 620 if (IsProfiling()) { |
615 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); | 621 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); |
616 } | 622 } |
617 } | 623 } |
618 | 624 |
619 #endif // ENABLE_LOGGING_AND_PROFILING | 625 #endif // ENABLE_LOGGING_AND_PROFILING |
620 | 626 |
621 } } // namespace v8::internal | 627 } } // namespace v8::internal |
OLD | NEW |