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 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 // Disassemble the instruction at *instr_ptr into the output buffer. | 1821 // Disassemble the instruction at *instr_ptr into the output buffer. |
1822 // All instructions are one word long, except for the simulator | 1822 // All instructions are one word long, except for the simulator |
1823 // psuedo-instruction stop(msg). For that one special case, we return | 1823 // psuedo-instruction stop(msg). For that one special case, we return |
1824 // size larger than one kInstrSize. | 1824 // size larger than one kInstrSize. |
1825 int Decoder::InstructionDecode(byte* instr_ptr) { | 1825 int Decoder::InstructionDecode(byte* instr_ptr) { |
1826 Instruction* instr = Instruction::At(instr_ptr); | 1826 Instruction* instr = Instruction::At(instr_ptr); |
1827 // Print raw instruction bytes. | 1827 // Print raw instruction bytes. |
1828 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1828 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1829 "%08x ", | 1829 "%08x ", |
1830 instr->InstructionBits()); | 1830 instr->InstructionBits()); |
1831 switch (instr->InstructionType()) { | 1831 switch (instr->InstructionType(Instruction::TypeChecks::EXTRA)) { |
1832 case Instruction::kRegisterType: { | 1832 case Instruction::kRegisterType: { |
1833 return DecodeTypeRegister(instr); | 1833 return DecodeTypeRegister(instr); |
1834 } | 1834 } |
1835 case Instruction::kImmediateType: { | 1835 case Instruction::kImmediateType: { |
1836 DecodeTypeImmediate(instr); | 1836 DecodeTypeImmediate(instr); |
1837 break; | 1837 break; |
1838 } | 1838 } |
1839 case Instruction::kJumpType: { | 1839 case Instruction::kJumpType: { |
1840 DecodeTypeJump(instr); | 1840 DecodeTypeJump(instr); |
1841 break; | 1841 break; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1925 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1926 } | 1926 } |
1927 } | 1927 } |
1928 | 1928 |
1929 | 1929 |
1930 #undef UNSUPPORTED | 1930 #undef UNSUPPORTED |
1931 | 1931 |
1932 } // namespace disasm | 1932 } // namespace disasm |
1933 | 1933 |
1934 #endif // V8_TARGET_ARCH_MIPS64 | 1934 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |