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 #if V8_TARGET_ARCH_ARM64 | 10 #if V8_TARGET_ARCH_ARM64 |
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 //------------------------------------------------------------------------------ | 1795 //------------------------------------------------------------------------------ |
1796 | 1796 |
1797 class BufferDisassembler : public v8::internal::DisassemblingDecoder { | 1797 class BufferDisassembler : public v8::internal::DisassemblingDecoder { |
1798 public: | 1798 public: |
1799 explicit BufferDisassembler(v8::internal::Vector<char> out_buffer) | 1799 explicit BufferDisassembler(v8::internal::Vector<char> out_buffer) |
1800 : out_buffer_(out_buffer) { } | 1800 : out_buffer_(out_buffer) { } |
1801 | 1801 |
1802 ~BufferDisassembler() { } | 1802 ~BufferDisassembler() { } |
1803 | 1803 |
1804 virtual void ProcessOutput(v8::internal::Instruction* instr) { | 1804 virtual void ProcessOutput(v8::internal::Instruction* instr) { |
1805 v8::internal::SNPrintF(out_buffer_, "%s", GetOutput()); | 1805 v8::internal::SNPrintF(out_buffer_, "%08" PRIx32 " %s", |
| 1806 instr->InstructionBits(), GetOutput()); |
1806 } | 1807 } |
1807 | 1808 |
1808 private: | 1809 private: |
1809 v8::internal::Vector<char> out_buffer_; | 1810 v8::internal::Vector<char> out_buffer_; |
1810 }; | 1811 }; |
1811 | 1812 |
1812 Disassembler::Disassembler(const NameConverter& converter) | 1813 Disassembler::Disassembler(const NameConverter& converter) |
1813 : converter_(converter) {} | 1814 : converter_(converter) {} |
1814 | 1815 |
1815 | 1816 |
(...skipping 23 matching lines...) Expand all Loading... |
1839 decoder.AppendVisitor(&disasm); | 1840 decoder.AppendVisitor(&disasm); |
1840 | 1841 |
1841 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { | 1842 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { |
1842 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); | 1843 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); |
1843 } | 1844 } |
1844 } | 1845 } |
1845 | 1846 |
1846 } // namespace disasm | 1847 } // namespace disasm |
1847 | 1848 |
1848 #endif // V8_TARGET_ARCH_ARM64 | 1849 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |