OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_MIPS. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
8 #if defined(TARGET_ARCH_MIPS) | 8 #if defined(TARGET_ARCH_MIPS) |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 | 10 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // the current instructions. The format string points to the first | 183 // the current instructions. The format string points to the first |
184 // character of the option string (the option escape has already been | 184 // character of the option string (the option escape has already been |
185 // consumed by the caller.) FormatOption returns the number of | 185 // consumed by the caller.) FormatOption returns the number of |
186 // characters that were consumed from the formatting string. | 186 // characters that were consumed from the formatting string. |
187 int MIPSDecoder::FormatOption(Instr* instr, const char* format) { | 187 int MIPSDecoder::FormatOption(Instr* instr, const char* format) { |
188 switch (format[0]) { | 188 switch (format[0]) { |
189 case 'c': { | 189 case 'c': { |
190 ASSERT(STRING_STARTS_WITH(format, "code")); | 190 ASSERT(STRING_STARTS_WITH(format, "code")); |
191 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), | 191 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
192 remaining_size_in_buffer(), | 192 remaining_size_in_buffer(), |
193 "%d", instr->BreakCodeField()); | 193 "0x%x", |
| 194 instr->BreakCodeField()); |
194 return 4; | 195 return 4; |
195 } | 196 } |
196 case 'h': { | 197 case 'h': { |
197 ASSERT(STRING_STARTS_WITH(format, "hint")); | 198 ASSERT(STRING_STARTS_WITH(format, "hint")); |
198 if (instr->SaField() == 0x10) { | 199 if (instr->SaField() == 0x10) { |
199 // The high bit of the SA field is the only one that means something for | 200 // The high bit of the SA field is the only one that means something for |
200 // JALR and JR. TODO(zra): Fill in the other cases for PREF if needed. | 201 // JALR and JR. TODO(zra): Fill in the other cases for PREF if needed. |
201 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), | 202 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
202 remaining_size_in_buffer(), | 203 remaining_size_in_buffer(), |
203 ".hb"); | 204 ".hb"); |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 decoder.InstructionDecode(instr); | 758 decoder.InstructionDecode(instr); |
758 OS::SNPrint(hex_buffer, hex_size, "%08x", instr->InstructionBits()); | 759 OS::SNPrint(hex_buffer, hex_size, "%08x", instr->InstructionBits()); |
759 if (out_instr_len) { | 760 if (out_instr_len) { |
760 *out_instr_len = Instr::kInstrSize; | 761 *out_instr_len = Instr::kInstrSize; |
761 } | 762 } |
762 } | 763 } |
763 | 764 |
764 } // namespace dart | 765 } // namespace dart |
765 | 766 |
766 #endif // defined TARGET_ARCH_MIPS | 767 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |