| 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 17 matching lines...) Expand all Loading... |
| 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_A64 |
| 36 | 36 |
| 37 #include "disasm.h" | 37 #include "disasm.h" |
| 38 #include "a64/decoder-a64-inl.h" |
| 38 #include "a64/disasm-a64.h" | 39 #include "a64/disasm-a64.h" |
| 39 #include "macro-assembler.h" | 40 #include "macro-assembler.h" |
| 40 #include "platform.h" | 41 #include "platform.h" |
| 41 | 42 |
| 42 namespace v8 { | 43 namespace v8 { |
| 43 namespace internal { | 44 namespace internal { |
| 44 | 45 |
| 45 | 46 |
| 46 Disassembler::Disassembler() { | 47 Disassembler::Disassembler() { |
| 47 buffer_size_ = 256; | 48 buffer_size_ = 256; |
| (...skipping 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1817 | 1818 |
| 1818 Disassembler::Disassembler(const NameConverter& converter) | 1819 Disassembler::Disassembler(const NameConverter& converter) |
| 1819 : converter_(converter) {} | 1820 : converter_(converter) {} |
| 1820 | 1821 |
| 1821 | 1822 |
| 1822 Disassembler::~Disassembler() {} | 1823 Disassembler::~Disassembler() {} |
| 1823 | 1824 |
| 1824 | 1825 |
| 1825 int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer, | 1826 int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer, |
| 1826 byte* instr) { | 1827 byte* instr) { |
| 1827 v8::internal::Decoder decoder; | 1828 v8::internal::Decoder<v8::internal::DispatchingDecoderVisitor> decoder; |
| 1828 BufferDisassembler disasm(buffer); | 1829 BufferDisassembler disasm(buffer); |
| 1829 decoder.AppendVisitor(&disasm); | 1830 decoder.AppendVisitor(&disasm); |
| 1830 | 1831 |
| 1831 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(instr)); | 1832 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(instr)); |
| 1832 return v8::internal::kInstructionSize; | 1833 return v8::internal::kInstructionSize; |
| 1833 } | 1834 } |
| 1834 | 1835 |
| 1835 | 1836 |
| 1836 int Disassembler::ConstantPoolSizeAt(byte* instr) { | 1837 int Disassembler::ConstantPoolSizeAt(byte* instr) { |
| 1837 return v8::internal::Assembler::ConstantPoolSizeAt( | 1838 return v8::internal::Assembler::ConstantPoolSizeAt( |
| 1838 reinterpret_cast<v8::internal::Instruction*>(instr)); | 1839 reinterpret_cast<v8::internal::Instruction*>(instr)); |
| 1839 } | 1840 } |
| 1840 | 1841 |
| 1841 | 1842 |
| 1842 void Disassembler::Disassemble(FILE* file, byte* start, byte* end) { | 1843 void Disassembler::Disassemble(FILE* file, byte* start, byte* end) { |
| 1843 v8::internal::Decoder decoder; | 1844 v8::internal::Decoder<v8::internal::DispatchingDecoderVisitor> decoder; |
| 1844 v8::internal::PrintDisassembler disasm(file); | 1845 v8::internal::PrintDisassembler disasm(file); |
| 1845 decoder.AppendVisitor(&disasm); | 1846 decoder.AppendVisitor(&disasm); |
| 1846 | 1847 |
| 1847 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { | 1848 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { |
| 1848 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); | 1849 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); |
| 1849 } | 1850 } |
| 1850 } | 1851 } |
| 1851 | 1852 |
| 1852 } // namespace disasm | 1853 } // namespace disasm |
| 1853 | 1854 |
| 1854 #endif // V8_TARGET_ARCH_A64 | 1855 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |