OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 } | 1790 } |
1791 | 1791 |
1792 private: | 1792 private: |
1793 v8::internal::Vector<char> out_buffer_; | 1793 v8::internal::Vector<char> out_buffer_; |
1794 }; | 1794 }; |
1795 | 1795 |
1796 Disassembler::Disassembler(const NameConverter& converter) | 1796 Disassembler::Disassembler(const NameConverter& converter) |
1797 : converter_(converter) {} | 1797 : converter_(converter) {} |
1798 | 1798 |
1799 | 1799 |
1800 Disassembler::~Disassembler() {} | 1800 Disassembler::~Disassembler() { USE(converter_); } |
1801 | 1801 |
1802 | 1802 |
1803 int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer, | 1803 int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer, |
1804 byte* instr) { | 1804 byte* instr) { |
1805 v8::internal::Decoder<v8::internal::DispatchingDecoderVisitor> decoder; | 1805 v8::internal::Decoder<v8::internal::DispatchingDecoderVisitor> decoder; |
1806 BufferDisassembler disasm(buffer); | 1806 BufferDisassembler disasm(buffer); |
1807 decoder.AppendVisitor(&disasm); | 1807 decoder.AppendVisitor(&disasm); |
1808 | 1808 |
1809 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(instr)); | 1809 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(instr)); |
1810 return v8::internal::kInstructionSize; | 1810 return v8::internal::kInstructionSize; |
(...skipping 12 matching lines...) Expand all Loading... |
1823 decoder.AppendVisitor(&disasm); | 1823 decoder.AppendVisitor(&disasm); |
1824 | 1824 |
1825 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { | 1825 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { |
1826 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); | 1826 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); |
1827 } | 1827 } |
1828 } | 1828 } |
1829 | 1829 |
1830 } // namespace disasm | 1830 } // namespace disasm |
1831 | 1831 |
1832 #endif // V8_TARGET_ARCH_ARM64 | 1832 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |