| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 8 #if defined(TARGET_ARCH_IA32) | 8 #if defined(TARGET_ARCH_IA32) |
| 9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 case 0xBE: return "movsx_b"; | 229 case 0xBE: return "movsx_b"; |
| 230 case 0xBF: return "movsx_w"; | 230 case 0xBF: return "movsx_w"; |
| 231 case 0xB6: return "movzx_b"; | 231 case 0xB6: return "movzx_b"; |
| 232 case 0xB7: return "movzx_w"; | 232 case 0xB7: return "movzx_w"; |
| 233 case 0xAF: return "imul"; | 233 case 0xAF: return "imul"; |
| 234 case 0xA5: return "shld"; | 234 case 0xA5: return "shld"; |
| 235 case 0xAD: return "shrd"; | 235 case 0xAD: return "shrd"; |
| 236 case 0xAB: return "bts"; | 236 case 0xAB: return "bts"; |
| 237 case 0xB1: return "cmpxchg"; | 237 case 0xB1: return "cmpxchg"; |
| 238 case 0x57: return "xorps"; | 238 case 0x57: return "xorps"; |
| 239 case 0x28: return "movaps"; |
| 239 default: return NULL; | 240 default: return NULL; |
| 240 } | 241 } |
| 241 } | 242 } |
| 242 | 243 |
| 243 | 244 |
| 244 // The implementation of x86 decoding based on the above tables. | 245 // The implementation of x86 decoding based on the above tables. |
| 245 class X86Decoder : public ValueObject { | 246 class X86Decoder : public ValueObject { |
| 246 public: | 247 public: |
| 247 X86Decoder(char* buffer, intptr_t buffer_size) | 248 X86Decoder(char* buffer, intptr_t buffer_size) |
| 248 : buffer_(buffer), | 249 : buffer_(buffer), |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 GetModRm(*data, &mod, ®op, &rm); | 1198 GetModRm(*data, &mod, ®op, &rm); |
| 1198 data += PrintRightOperand(data); | 1199 data += PrintRightOperand(data); |
| 1199 if (f0byte == 0xAB) { | 1200 if (f0byte == 0xAB) { |
| 1200 Print(","); | 1201 Print(","); |
| 1201 PrintCPURegister(regop); | 1202 PrintCPURegister(regop); |
| 1202 } else { | 1203 } else { |
| 1203 Print(","); | 1204 Print(","); |
| 1204 PrintCPURegister(regop); | 1205 PrintCPURegister(regop); |
| 1205 Print(",cl"); | 1206 Print(",cl"); |
| 1206 } | 1207 } |
| 1208 } else if (f0byte == 0x28) { |
| 1209 // movaps |
| 1210 Print(f0mnem); |
| 1211 int mod, regop, rm; |
| 1212 GetModRm(*data, &mod, ®op, &rm); |
| 1213 Print(" "); |
| 1214 PrintXmmRegister(regop); |
| 1215 Print(","); |
| 1216 data += PrintRightXmmOperand(data); |
| 1207 } else { | 1217 } else { |
| 1208 UNIMPLEMENTED(); | 1218 UNIMPLEMENTED(); |
| 1209 } | 1219 } |
| 1210 } | 1220 } |
| 1211 } | 1221 } |
| 1212 break; | 1222 break; |
| 1213 | 1223 |
| 1214 case 0x8F: | 1224 case 0x8F: |
| 1215 { data++; | 1225 { data++; |
| 1216 int mod, regop, rm; | 1226 int mod, regop, rm; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 human_buffer, | 1639 human_buffer, |
| 1630 sizeof(human_buffer), | 1640 sizeof(human_buffer), |
| 1631 pc); | 1641 pc); |
| 1632 pc += instruction_length; | 1642 pc += instruction_length; |
| 1633 } | 1643 } |
| 1634 } | 1644 } |
| 1635 | 1645 |
| 1636 } // namespace dart | 1646 } // namespace dart |
| 1637 | 1647 |
| 1638 #endif // defined TARGET_ARCH_IA32 | 1648 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |