| 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_X64) | 8 #if defined(TARGET_ARCH_X64) |
| 9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 AppendToBuffer("j%s ", mnem); | 871 AppendToBuffer("j%s ", mnem); |
| 872 AppendAddressToBuffer(dest); | 872 AppendAddressToBuffer(dest); |
| 873 return 6; // includes 0x0F | 873 return 6; // includes 0x0F |
| 874 } | 874 } |
| 875 | 875 |
| 876 | 876 |
| 877 // Returns number of bytes used, including *data. | 877 // Returns number of bytes used, including *data. |
| 878 int DisassemblerX64::JumpConditionalShort(uint8_t* data) { | 878 int DisassemblerX64::JumpConditionalShort(uint8_t* data) { |
| 879 uint8_t cond = *data & 0x0F; | 879 uint8_t cond = *data & 0x0F; |
| 880 uint8_t b = *(data + 1); | 880 uint8_t b = *(data + 1); |
| 881 uint8_t* dest = data + static_cast<uint8_t>(b) + 2; | 881 uint8_t* dest = data + static_cast<int8_t>(b) + 2; |
| 882 const char* mnem = conditional_code_suffix[cond]; | 882 const char* mnem = conditional_code_suffix[cond]; |
| 883 AppendToBuffer("j%s ", mnem); | 883 AppendToBuffer("j%s ", mnem); |
| 884 AppendAddressToBuffer(dest); | 884 AppendAddressToBuffer(dest); |
| 885 return 2; | 885 return 2; |
| 886 } | 886 } |
| 887 | 887 |
| 888 | 888 |
| 889 // Returns number of bytes used, including *data. | 889 // Returns number of bytes used, including *data. |
| 890 int DisassemblerX64::SetCC(uint8_t* data) { | 890 int DisassemblerX64::SetCC(uint8_t* data) { |
| 891 ASSERT(0x0F == *data); | 891 ASSERT(0x0F == *data); |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1952 } | 1952 } |
| 1953 hex_buffer[hex_index] = '\0'; | 1953 hex_buffer[hex_index] = '\0'; |
| 1954 if (out_instr_len) { | 1954 if (out_instr_len) { |
| 1955 *out_instr_len = instruction_length; | 1955 *out_instr_len = instruction_length; |
| 1956 } | 1956 } |
| 1957 } | 1957 } |
| 1958 | 1958 |
| 1959 } // namespace dart | 1959 } // namespace dart |
| 1960 | 1960 |
| 1961 #endif // defined TARGET_ARCH_X64 | 1961 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |