| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 14 matching lines...) Expand all Loading... |
| 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 #include <assert.h> | 28 #include <assert.h> |
| 29 #include <stdio.h> | 29 #include <stdio.h> |
| 30 #include <stdarg.h> | 30 #include <stdarg.h> |
| 31 #include <string.h> | 31 #include <string.h> |
| 32 | 32 |
| 33 #include "v8.h" | 33 #include "v8.h" |
| 34 | 34 |
| 35 #if V8_TARGET_ARCH_A64 | 35 #if V8_TARGET_ARCH_ARM64 |
| 36 | 36 |
| 37 #include "disasm.h" | 37 #include "disasm.h" |
| 38 #include "a64/decoder-a64-inl.h" | 38 #include "arm64/decoder-arm64-inl.h" |
| 39 #include "a64/disasm-a64.h" | 39 #include "arm64/disasm-arm64.h" |
| 40 #include "macro-assembler.h" | 40 #include "macro-assembler.h" |
| 41 #include "platform.h" | 41 #include "platform.h" |
| 42 | 42 |
| 43 namespace v8 { | 43 namespace v8 { |
| 44 namespace internal { | 44 namespace internal { |
| 45 | 45 |
| 46 | 46 |
| 47 Disassembler::Disassembler() { | 47 Disassembler::Disassembler() { |
| 48 buffer_size_ = 256; | 48 buffer_size_ = 256; |
| 49 buffer_ = reinterpret_cast<char*>(malloc(buffer_size_)); | 49 buffer_ = reinterpret_cast<char*>(malloc(buffer_size_)); |
| (...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 } | 1775 } |
| 1776 if (ureg == v8::internal::kZeroRegCode) { | 1776 if (ureg == v8::internal::kZeroRegCode) { |
| 1777 return "xzr"; | 1777 return "xzr"; |
| 1778 } | 1778 } |
| 1779 v8::internal::OS::SNPrintF(tmp_buffer_, "x%u", ureg); | 1779 v8::internal::OS::SNPrintF(tmp_buffer_, "x%u", ureg); |
| 1780 return tmp_buffer_.start(); | 1780 return tmp_buffer_.start(); |
| 1781 } | 1781 } |
| 1782 | 1782 |
| 1783 | 1783 |
| 1784 const char* NameConverter::NameOfByteCPURegister(int reg) const { | 1784 const char* NameConverter::NameOfByteCPURegister(int reg) const { |
| 1785 UNREACHABLE(); // A64 does not have the concept of a byte register | 1785 UNREACHABLE(); // ARM64 does not have the concept of a byte register |
| 1786 return "nobytereg"; | 1786 return "nobytereg"; |
| 1787 } | 1787 } |
| 1788 | 1788 |
| 1789 | 1789 |
| 1790 const char* NameConverter::NameOfXMMRegister(int reg) const { | 1790 const char* NameConverter::NameOfXMMRegister(int reg) const { |
| 1791 UNREACHABLE(); // A64 does not have any XMM registers | 1791 UNREACHABLE(); // ARM64 does not have any XMM registers |
| 1792 return "noxmmreg"; | 1792 return "noxmmreg"; |
| 1793 } | 1793 } |
| 1794 | 1794 |
| 1795 | 1795 |
| 1796 const char* NameConverter::NameInCode(byte* addr) const { | 1796 const char* NameConverter::NameInCode(byte* addr) const { |
| 1797 // The default name converter is called for unknown code, so we will not try | 1797 // The default name converter is called for unknown code, so we will not try |
| 1798 // to access any memory. | 1798 // to access any memory. |
| 1799 return ""; | 1799 return ""; |
| 1800 } | 1800 } |
| 1801 | 1801 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1846 v8::internal::PrintDisassembler disasm(file); | 1846 v8::internal::PrintDisassembler disasm(file); |
| 1847 decoder.AppendVisitor(&disasm); | 1847 decoder.AppendVisitor(&disasm); |
| 1848 | 1848 |
| 1849 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { | 1849 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { |
| 1850 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); | 1850 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); |
| 1851 } | 1851 } |
| 1852 } | 1852 } |
| 1853 | 1853 |
| 1854 } // namespace disasm | 1854 } // namespace disasm |
| 1855 | 1855 |
| 1856 #endif // V8_TARGET_ARCH_A64 | 1856 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |