| 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 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 #ifndef PRODUCT |
| 14 |
| 13 class MIPSDecoder : public ValueObject { | 15 class MIPSDecoder : public ValueObject { |
| 14 public: | 16 public: |
| 15 MIPSDecoder(char* buffer, size_t buffer_size) | 17 MIPSDecoder(char* buffer, size_t buffer_size) |
| 16 : buffer_(buffer), | 18 : buffer_(buffer), |
| 17 buffer_size_(buffer_size), | 19 buffer_size_(buffer_size), |
| 18 buffer_pos_(0) { | 20 buffer_pos_(0) { |
| 19 buffer_[buffer_pos_] = '\0'; | 21 buffer_[buffer_pos_] = '\0'; |
| 20 } | 22 } |
| 21 | 23 |
| 22 ~MIPSDecoder() {} | 24 ~MIPSDecoder() {} |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 int* out_instr_len, uword pc) { | 769 int* out_instr_len, uword pc) { |
| 768 MIPSDecoder decoder(human_buffer, human_size); | 770 MIPSDecoder decoder(human_buffer, human_size); |
| 769 Instr* instr = Instr::At(pc); | 771 Instr* instr = Instr::At(pc); |
| 770 decoder.InstructionDecode(instr); | 772 decoder.InstructionDecode(instr); |
| 771 OS::SNPrint(hex_buffer, hex_size, "%08x", instr->InstructionBits()); | 773 OS::SNPrint(hex_buffer, hex_size, "%08x", instr->InstructionBits()); |
| 772 if (out_instr_len) { | 774 if (out_instr_len) { |
| 773 *out_instr_len = Instr::kInstrSize; | 775 *out_instr_len = Instr::kInstrSize; |
| 774 } | 776 } |
| 775 } | 777 } |
| 776 | 778 |
| 779 #endif // !PRODUCT |
| 780 |
| 777 } // namespace dart | 781 } // namespace dart |
| 778 | 782 |
| 779 #endif // defined TARGET_ARCH_MIPS | 783 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |