| 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 <assert.h> | 5 #include <assert.h> |
| 6 #include <stdarg.h> | 6 #include <stdarg.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_X87 | 9 #if V8_TARGET_ARCH_X87 |
| 10 | 10 |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" | 1773 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" |
| 1774 }; | 1774 }; |
| 1775 | 1775 |
| 1776 | 1776 |
| 1777 static const char* const xmm_regs[8] = { | 1777 static const char* const xmm_regs[8] = { |
| 1778 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" | 1778 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" |
| 1779 }; | 1779 }; |
| 1780 | 1780 |
| 1781 | 1781 |
| 1782 const char* NameConverter::NameOfAddress(byte* addr) const { | 1782 const char* NameConverter::NameOfAddress(byte* addr) const { |
| 1783 v8::internal::SNPrintF(tmp_buffer_, "%p", addr); | 1783 v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr)); |
| 1784 return tmp_buffer_.start(); | 1784 return tmp_buffer_.start(); |
| 1785 } | 1785 } |
| 1786 | 1786 |
| 1787 | 1787 |
| 1788 const char* NameConverter::NameOfConstant(byte* addr) const { | 1788 const char* NameConverter::NameOfConstant(byte* addr) const { |
| 1789 return NameOfAddress(addr); | 1789 return NameOfAddress(addr); |
| 1790 } | 1790 } |
| 1791 | 1791 |
| 1792 | 1792 |
| 1793 const char* NameConverter::NameOfCPURegister(int reg) const { | 1793 const char* NameConverter::NameOfCPURegister(int reg) const { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 | 1836 |
| 1837 | 1837 |
| 1838 /*static*/ void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) { | 1838 /*static*/ void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) { |
| 1839 NameConverter converter; | 1839 NameConverter converter; |
| 1840 Disassembler d(converter); | 1840 Disassembler d(converter); |
| 1841 for (byte* pc = begin; pc < end;) { | 1841 for (byte* pc = begin; pc < end;) { |
| 1842 v8::internal::EmbeddedVector<char, 128> buffer; | 1842 v8::internal::EmbeddedVector<char, 128> buffer; |
| 1843 buffer[0] = '\0'; | 1843 buffer[0] = '\0'; |
| 1844 byte* prev_pc = pc; | 1844 byte* prev_pc = pc; |
| 1845 pc += d.InstructionDecode(buffer, pc); | 1845 pc += d.InstructionDecode(buffer, pc); |
| 1846 fprintf(f, "%p", prev_pc); | 1846 fprintf(f, "%p", static_cast<void*>(prev_pc)); |
| 1847 fprintf(f, " "); | 1847 fprintf(f, " "); |
| 1848 | 1848 |
| 1849 for (byte* bp = prev_pc; bp < pc; bp++) { | 1849 for (byte* bp = prev_pc; bp < pc; bp++) { |
| 1850 fprintf(f, "%02x", *bp); | 1850 fprintf(f, "%02x", *bp); |
| 1851 } | 1851 } |
| 1852 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { | 1852 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { |
| 1853 fprintf(f, " "); | 1853 fprintf(f, " "); |
| 1854 } | 1854 } |
| 1855 fprintf(f, " %s\n", buffer.start()); | 1855 fprintf(f, " %s\n", buffer.start()); |
| 1856 } | 1856 } |
| 1857 } | 1857 } |
| 1858 | 1858 |
| 1859 | 1859 |
| 1860 } // namespace disasm | 1860 } // namespace disasm |
| 1861 | 1861 |
| 1862 #endif // V8_TARGET_ARCH_X87 | 1862 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |