OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 // A Disassembler object is used to disassemble a block of code instruction by | 5 // A Disassembler object is used to disassemble a block of code instruction by |
6 // instruction. The default implementation of the NameConverter object can be | 6 // instruction. The default implementation of the NameConverter object can be |
7 // overriden to modify register names or to do symbol lookup on addresses. | 7 // overriden to modify register names or to do symbol lookup on addresses. |
8 // | 8 // |
9 // The example below will disassemble a block of code and print it to stdout. | 9 // The example below will disassemble a block of code and print it to stdout. |
10 // | 10 // |
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1705 } | 1705 } |
1706 | 1706 |
1707 | 1707 |
1708 // Disassemble the instruction at *instr_ptr into the output buffer. | 1708 // Disassemble the instruction at *instr_ptr into the output buffer. |
1709 int Decoder::InstructionDecode(byte* instr_ptr) { | 1709 int Decoder::InstructionDecode(byte* instr_ptr) { |
1710 Instruction* instr = Instruction::At(instr_ptr); | 1710 Instruction* instr = Instruction::At(instr_ptr); |
1711 // Print raw instruction bytes. | 1711 // Print raw instruction bytes. |
1712 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1712 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1713 "%08x ", | 1713 "%08x ", |
1714 instr->InstructionBits()); | 1714 instr->InstructionBits()); |
1715 switch (instr->InstructionType(Instruction::EXTRA)) { | 1715 switch (instr->InstructionType()) { |
1716 case Instruction::kRegisterType: { | 1716 case Instruction::kRegisterType: { |
1717 DecodeTypeRegister(instr); | 1717 DecodeTypeRegister(instr); |
1718 break; | 1718 break; |
1719 } | 1719 } |
1720 case Instruction::kImmediateType: { | 1720 case Instruction::kImmediateType: { |
1721 DecodeTypeImmediate(instr); | 1721 DecodeTypeImmediate(instr); |
1722 break; | 1722 break; |
1723 } | 1723 } |
1724 case Instruction::kJumpType: { | 1724 case Instruction::kJumpType: { |
1725 DecodeTypeJump(instr); | 1725 DecodeTypeJump(instr); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1810 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1811 } | 1811 } |
1812 } | 1812 } |
1813 | 1813 |
1814 | 1814 |
1815 #undef UNSUPPORTED | 1815 #undef UNSUPPORTED |
1816 | 1816 |
1817 } // namespace disasm | 1817 } // namespace disasm |
1818 | 1818 |
1819 #endif // V8_TARGET_ARCH_MIPS | 1819 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |