| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdarg.h> | 5 #include <stdarg.h> |
| 6 | 6 |
| 7 #include "v8.h" | 7 #include "v8.h" |
| 8 | 8 |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 313 |
| 314 void LogWriteBytes(const char* bytes, int size); | 314 void LogWriteBytes(const char* bytes, int size); |
| 315 void LogWriteHeader(); | 315 void LogWriteHeader(); |
| 316 | 316 |
| 317 static const uint32_t kJitHeaderMagic = 0x4F74496A; | 317 static const uint32_t kJitHeaderMagic = 0x4F74496A; |
| 318 static const uint32_t kJitHeaderVersion = 0x2; | 318 static const uint32_t kJitHeaderVersion = 0x2; |
| 319 static const uint32_t kElfMachIA32 = 3; | 319 static const uint32_t kElfMachIA32 = 3; |
| 320 static const uint32_t kElfMachX64 = 62; | 320 static const uint32_t kElfMachX64 = 62; |
| 321 static const uint32_t kElfMachARM = 40; | 321 static const uint32_t kElfMachARM = 40; |
| 322 static const uint32_t kElfMachMIPS = 10; | 322 static const uint32_t kElfMachMIPS = 10; |
| 323 static const uint32_t kElfMachX87 = 3; |
| 323 | 324 |
| 324 struct jitheader { | 325 struct jitheader { |
| 325 uint32_t magic; | 326 uint32_t magic; |
| 326 uint32_t version; | 327 uint32_t version; |
| 327 uint32_t total_size; | 328 uint32_t total_size; |
| 328 uint32_t elf_mach; | 329 uint32_t elf_mach; |
| 329 uint32_t pad1; | 330 uint32_t pad1; |
| 330 uint32_t pid; | 331 uint32_t pid; |
| 331 uint64_t timestamp; | 332 uint64_t timestamp; |
| 332 }; | 333 }; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 352 | 353 |
| 353 uint32_t GetElfMach() { | 354 uint32_t GetElfMach() { |
| 354 #if V8_TARGET_ARCH_IA32 | 355 #if V8_TARGET_ARCH_IA32 |
| 355 return kElfMachIA32; | 356 return kElfMachIA32; |
| 356 #elif V8_TARGET_ARCH_X64 | 357 #elif V8_TARGET_ARCH_X64 |
| 357 return kElfMachX64; | 358 return kElfMachX64; |
| 358 #elif V8_TARGET_ARCH_ARM | 359 #elif V8_TARGET_ARCH_ARM |
| 359 return kElfMachARM; | 360 return kElfMachARM; |
| 360 #elif V8_TARGET_ARCH_MIPS | 361 #elif V8_TARGET_ARCH_MIPS |
| 361 return kElfMachMIPS; | 362 return kElfMachMIPS; |
| 363 #elif V8_TARGET_ARCH_X87 |
| 364 return kElfMachX87; |
| 362 #else | 365 #else |
| 363 UNIMPLEMENTED(); | 366 UNIMPLEMENTED(); |
| 364 return 0; | 367 return 0; |
| 365 #endif | 368 #endif |
| 366 } | 369 } |
| 367 | 370 |
| 368 FILE* perf_output_handle_; | 371 FILE* perf_output_handle_; |
| 369 }; | 372 }; |
| 370 | 373 |
| 371 const char PerfJitLogger::kFilenameFormatString[] = "/tmp/jit-%d.dump"; | 374 const char PerfJitLogger::kFilenameFormatString[] = "/tmp/jit-%d.dump"; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 | 550 |
| 548 void LowLevelLogger::LogCodeInfo() { | 551 void LowLevelLogger::LogCodeInfo() { |
| 549 #if V8_TARGET_ARCH_IA32 | 552 #if V8_TARGET_ARCH_IA32 |
| 550 const char arch[] = "ia32"; | 553 const char arch[] = "ia32"; |
| 551 #elif V8_TARGET_ARCH_X64 | 554 #elif V8_TARGET_ARCH_X64 |
| 552 const char arch[] = "x64"; | 555 const char arch[] = "x64"; |
| 553 #elif V8_TARGET_ARCH_ARM | 556 #elif V8_TARGET_ARCH_ARM |
| 554 const char arch[] = "arm"; | 557 const char arch[] = "arm"; |
| 555 #elif V8_TARGET_ARCH_MIPS | 558 #elif V8_TARGET_ARCH_MIPS |
| 556 const char arch[] = "mips"; | 559 const char arch[] = "mips"; |
| 560 #elif V8_TARGET_ARCH_X87 |
| 561 const char arch[] = "x87"; |
| 557 #else | 562 #else |
| 558 const char arch[] = "unknown"; | 563 const char arch[] = "unknown"; |
| 559 #endif | 564 #endif |
| 560 LogWriteBytes(arch, sizeof(arch)); | 565 LogWriteBytes(arch, sizeof(arch)); |
| 561 } | 566 } |
| 562 | 567 |
| 563 | 568 |
| 564 void LowLevelLogger::LogRecordedBuffer(Code* code, | 569 void LowLevelLogger::LogRecordedBuffer(Code* code, |
| 565 SharedFunctionInfo*, | 570 SharedFunctionInfo*, |
| 566 const char* name, | 571 const char* name, |
| (...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2089 if (jit_logger_) { | 2094 if (jit_logger_) { |
| 2090 removeCodeEventListener(jit_logger_); | 2095 removeCodeEventListener(jit_logger_); |
| 2091 delete jit_logger_; | 2096 delete jit_logger_; |
| 2092 jit_logger_ = NULL; | 2097 jit_logger_ = NULL; |
| 2093 } | 2098 } |
| 2094 | 2099 |
| 2095 return log_->Close(); | 2100 return log_->Close(); |
| 2096 } | 2101 } |
| 2097 | 2102 |
| 2098 } } // namespace v8::internal | 2103 } } // namespace v8::internal |
| OLD | NEW |