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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } else if (instr->SaField() != 0) { | 134 } else if (instr->SaField() != 0) { |
135 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), | 135 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
136 remaining_size_in_buffer(), | 136 remaining_size_in_buffer(), |
137 ".unknown"); | 137 ".unknown"); |
138 } | 138 } |
139 return 4; | 139 return 4; |
140 } | 140 } |
141 case 'd': { | 141 case 'd': { |
142 ASSERT(STRING_STARTS_WITH(format, "dest")); | 142 ASSERT(STRING_STARTS_WITH(format, "dest")); |
143 int off = instr->SImmField() << 2; | 143 int off = instr->SImmField() << 2; |
144 uword destination = reinterpret_cast<uword>(instr) + off; | 144 uword destination = |
| 145 reinterpret_cast<uword>(instr) + off + Instr::kInstrSize; |
145 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), | 146 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
146 remaining_size_in_buffer(), | 147 remaining_size_in_buffer(), |
147 "%#"Px"", | 148 "%#"Px"", |
148 destination); | 149 destination); |
149 return 4; | 150 return 4; |
150 } | 151 } |
151 case 'i': { | 152 case 'i': { |
152 ASSERT(STRING_STARTS_WITH(format, "imm")); | 153 ASSERT(STRING_STARTS_WITH(format, "imm")); |
153 if (format[3] == 'u') { | 154 if (format[3] == 'u') { |
154 int32_t imm = instr->UImmField(); | 155 int32_t imm = instr->UImmField(); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 371 } |
371 | 372 |
372 | 373 |
373 void MIPSDecoder::DecodeRegImm(Instr* instr) { | 374 void MIPSDecoder::DecodeRegImm(Instr* instr) { |
374 ASSERT(instr->OpcodeField() == REGIMM); | 375 ASSERT(instr->OpcodeField() == REGIMM); |
375 switch (instr->RegImmFnField()) { | 376 switch (instr->RegImmFnField()) { |
376 case BGEZ: { | 377 case BGEZ: { |
377 Format(instr, "bgez 'rs, 'dest"); | 378 Format(instr, "bgez 'rs, 'dest"); |
378 break; | 379 break; |
379 } | 380 } |
| 381 case BGEZAL: { |
| 382 Format(instr, "bgezal 'rs, 'dest"); |
| 383 break; |
| 384 } |
380 case BGEZL: { | 385 case BGEZL: { |
381 Format(instr, "bgezl 'rs, 'dest"); | 386 Format(instr, "bgezl 'rs, 'dest"); |
382 break; | 387 break; |
383 } | 388 } |
384 case BLTZ: { | 389 case BLTZ: { |
385 Format(instr, "bltz 'rs, 'dest"); | 390 Format(instr, "bltz 'rs, 'dest"); |
386 break; | 391 break; |
387 } | 392 } |
388 case BLTZL: { | 393 case BLTZL: { |
389 Format(instr, "bltzl 'rs, 'dest"); | 394 Format(instr, "bltzl 'rs, 'dest"); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 pc); | 543 pc); |
539 pc += instruction_length; | 544 pc += instruction_length; |
540 } | 545 } |
541 | 546 |
542 return; | 547 return; |
543 } | 548 } |
544 | 549 |
545 } // namespace dart | 550 } // namespace dart |
546 | 551 |
547 #endif // defined TARGET_ARCH_MIPS | 552 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |