OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 data++; | 1551 data++; |
1552 if (is_byte) { | 1552 if (is_byte) { |
1553 AppendToBuffer("movb "); | 1553 AppendToBuffer("movb "); |
1554 data += PrintRightByteOperand(data); | 1554 data += PrintRightByteOperand(data); |
1555 int32_t imm = *data; | 1555 int32_t imm = *data; |
1556 AppendToBuffer(",0x%x", imm); | 1556 AppendToBuffer(",0x%x", imm); |
1557 data++; | 1557 data++; |
1558 } else { | 1558 } else { |
1559 AppendToBuffer("mov%c ", operand_size_code()); | 1559 AppendToBuffer("mov%c ", operand_size_code()); |
1560 data += PrintRightOperand(data); | 1560 data += PrintRightOperand(data); |
1561 int32_t imm = *reinterpret_cast<int32_t*>(data); | 1561 if (operand_size() == OPERAND_WORD_SIZE) { |
1562 AppendToBuffer(",0x%x", imm); | 1562 int16_t imm = *reinterpret_cast<int16_t*>(data); |
1563 data += 4; | 1563 AppendToBuffer(",0x%x", imm); |
| 1564 data += 2; |
| 1565 } else { |
| 1566 int32_t imm = *reinterpret_cast<int32_t*>(data); |
| 1567 AppendToBuffer(",0x%x", imm); |
| 1568 data += 4; |
| 1569 } |
1564 } | 1570 } |
1565 } | 1571 } |
1566 break; | 1572 break; |
1567 | 1573 |
1568 case 0x80: { | 1574 case 0x80: { |
1569 data++; | 1575 data++; |
1570 AppendToBuffer("cmpb "); | 1576 AppendToBuffer("cmpb "); |
1571 data += PrintRightByteOperand(data); | 1577 data += PrintRightByteOperand(data); |
1572 int32_t imm = *data; | 1578 int32_t imm = *data; |
1573 AppendToBuffer(",0x%x", imm); | 1579 AppendToBuffer(",0x%x", imm); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { | 1898 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { |
1893 fprintf(f, " "); | 1899 fprintf(f, " "); |
1894 } | 1900 } |
1895 fprintf(f, " %s\n", buffer.start()); | 1901 fprintf(f, " %s\n", buffer.start()); |
1896 } | 1902 } |
1897 } | 1903 } |
1898 | 1904 |
1899 } // namespace disasm | 1905 } // namespace disasm |
1900 | 1906 |
1901 #endif // V8_TARGET_ARCH_X64 | 1907 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |