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 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 case ADDI: | 1493 case ADDI: |
1494 if (!IsMipsArchVariant(kMips32r6)) { | 1494 if (!IsMipsArchVariant(kMips32r6)) { |
1495 Format(instr, "addi 'rt, 'rs, 'imm16s"); | 1495 Format(instr, "addi 'rt, 'rs, 'imm16s"); |
1496 } else { | 1496 } else { |
1497 int rs_reg = instr->RsValue(); | 1497 int rs_reg = instr->RsValue(); |
1498 int rt_reg = instr->RtValue(); | 1498 int rt_reg = instr->RtValue(); |
1499 // Check if BOVC, BEQZALC or BEQC instruction. | 1499 // Check if BOVC, BEQZALC or BEQC instruction. |
1500 if (rs_reg >= rt_reg) { | 1500 if (rs_reg >= rt_reg) { |
1501 Format(instr, "bovc 'rs, 'rt, 'imm16s -> 'imm16p4s2"); | 1501 Format(instr, "bovc 'rs, 'rt, 'imm16s -> 'imm16p4s2"); |
1502 } else { | 1502 } else { |
| 1503 DCHECK(rt_reg > 0); |
1503 if (rs_reg == 0) { | 1504 if (rs_reg == 0) { |
1504 Format(instr, "beqzalc 'rt, 'imm16s -> 'imm16p4s2"); | 1505 Format(instr, "beqzalc 'rt, 'imm16s -> 'imm16p4s2"); |
1505 } else { | 1506 } else { |
1506 Format(instr, "beqc 'rs, 'rt, 'imm16s -> 'imm16p4s2"); | 1507 Format(instr, "beqc 'rs, 'rt, 'imm16s -> 'imm16p4s2"); |
1507 } | 1508 } |
1508 } | 1509 } |
1509 } | 1510 } |
1510 break; | 1511 break; |
1511 case DADDI: | 1512 case DADDI: |
1512 if (IsMipsArchVariant(kMips32r6)) { | 1513 if (IsMipsArchVariant(kMips32r6)) { |
1513 int rs_reg = instr->RsValue(); | 1514 int rs_reg = instr->RsValue(); |
1514 int rt_reg = instr->RtValue(); | 1515 int rt_reg = instr->RtValue(); |
1515 // Check if BNVC, BNEZALC or BNEC instruction. | 1516 // Check if BNVC, BNEZALC or BNEC instruction. |
1516 if (rs_reg >= rt_reg) { | 1517 if (rs_reg >= rt_reg) { |
1517 Format(instr, "bnvc 'rs, 'rt, 'imm16s -> 'imm16p4s2"); | 1518 Format(instr, "bnvc 'rs, 'rt, 'imm16s -> 'imm16p4s2"); |
1518 } else { | 1519 } else { |
| 1520 DCHECK(rt_reg > 0); |
1519 if (rs_reg == 0) { | 1521 if (rs_reg == 0) { |
1520 Format(instr, "bnezalc 'rt, 'imm16s -> 'imm16p4s2"); | 1522 Format(instr, "bnezalc 'rt, 'imm16s -> 'imm16p4s2"); |
1521 } else { | 1523 } else { |
1522 Format(instr, "bnec 'rs, 'rt, 'imm16s -> 'imm16p4s2"); | 1524 Format(instr, "bnec 'rs, 'rt, 'imm16s -> 'imm16p4s2"); |
1523 } | 1525 } |
1524 } | 1526 } |
1525 } | 1527 } |
1526 break; | 1528 break; |
1527 case ADDIU: | 1529 case ADDIU: |
1528 Format(instr, "addiu 'rt, 'rs, 'imm16s"); | 1530 Format(instr, "addiu 'rt, 'rs, 'imm16s"); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1763 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1762 } | 1764 } |
1763 } | 1765 } |
1764 | 1766 |
1765 | 1767 |
1766 #undef UNSUPPORTED | 1768 #undef UNSUPPORTED |
1767 | 1769 |
1768 } // namespace disasm | 1770 } // namespace disasm |
1769 | 1771 |
1770 #endif // V8_TARGET_ARCH_MIPS | 1772 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |