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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 } | 1599 } |
1600 | 1600 |
1601 | 1601 |
1602 // Disassemble the instruction at *instr_ptr into the output buffer. | 1602 // Disassemble the instruction at *instr_ptr into the output buffer. |
1603 int Decoder::InstructionDecode(byte* instr_ptr) { | 1603 int Decoder::InstructionDecode(byte* instr_ptr) { |
1604 Instruction* instr = Instruction::At(instr_ptr); | 1604 Instruction* instr = Instruction::At(instr_ptr); |
1605 // Print raw instruction bytes. | 1605 // Print raw instruction bytes. |
1606 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1606 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1607 "%08x ", | 1607 "%08x ", |
1608 instr->InstructionBits()); | 1608 instr->InstructionBits()); |
1609 switch (instr->InstructionType()) { | 1609 switch (instr->InstructionType(Instruction::EXTRA)) { |
1610 case Instruction::kRegisterType: { | 1610 case Instruction::kRegisterType: { |
1611 DecodeTypeRegister(instr); | 1611 DecodeTypeRegister(instr); |
1612 break; | 1612 break; |
1613 } | 1613 } |
1614 case Instruction::kImmediateType: { | 1614 case Instruction::kImmediateType: { |
1615 DecodeTypeImmediate(instr); | 1615 DecodeTypeImmediate(instr); |
1616 break; | 1616 break; |
1617 } | 1617 } |
1618 case Instruction::kJumpType: { | 1618 case Instruction::kJumpType: { |
1619 DecodeTypeJump(instr); | 1619 DecodeTypeJump(instr); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1704 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1705 } | 1705 } |
1706 } | 1706 } |
1707 | 1707 |
1708 | 1708 |
1709 #undef UNSUPPORTED | 1709 #undef UNSUPPORTED |
1710 | 1710 |
1711 } // namespace disasm | 1711 } // namespace disasm |
1712 | 1712 |
1713 #endif // V8_TARGET_ARCH_MIPS | 1713 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |