| 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_ARM. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 8 #if defined(TARGET_ARCH_ARM) | 8 #if defined(TARGET_ARCH_ARM) |
| 9 | |
| 10 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 11 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| 11 #include "vm/instructions.h" |
| 12 | 12 |
| 13 namespace dart { | 13 namespace dart { |
| 14 | 14 |
| 15 #ifndef PRODUCT | 15 #ifndef PRODUCT |
| 16 | 16 |
| 17 class ARMDecoder : public ValueObject { | 17 class ARMDecoder : public ValueObject { |
| 18 public: | 18 public: |
| 19 ARMDecoder(char* buffer, size_t buffer_size) | 19 ARMDecoder(char* buffer, size_t buffer_size) |
| 20 : buffer_(buffer), | 20 : buffer_(buffer), |
| 21 buffer_size_(buffer_size), | 21 buffer_size_(buffer_size), |
| (...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 UNREACHABLE(); | 1527 UNREACHABLE(); |
| 1528 break; | 1528 break; |
| 1529 } | 1529 } |
| 1530 } | 1530 } |
| 1531 } | 1531 } |
| 1532 } | 1532 } |
| 1533 | 1533 |
| 1534 | 1534 |
| 1535 void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size, | 1535 void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size, |
| 1536 char* human_buffer, intptr_t human_size, | 1536 char* human_buffer, intptr_t human_size, |
| 1537 int* out_instr_size, uword pc) { | 1537 int* out_instr_size, const Code& code, |
| 1538 Object** object, uword pc) { |
| 1538 ARMDecoder decoder(human_buffer, human_size); | 1539 ARMDecoder decoder(human_buffer, human_size); |
| 1539 decoder.InstructionDecode(pc); | 1540 decoder.InstructionDecode(pc); |
| 1540 int32_t instruction_bits = Instr::At(pc)->InstructionBits(); | 1541 int32_t instruction_bits = Instr::At(pc)->InstructionBits(); |
| 1541 OS::SNPrint(hex_buffer, hex_size, "%08x", instruction_bits); | 1542 OS::SNPrint(hex_buffer, hex_size, "%08x", instruction_bits); |
| 1542 if (out_instr_size) { | 1543 if (out_instr_size) { |
| 1543 *out_instr_size = Instr::kInstrSize; | 1544 *out_instr_size = Instr::kInstrSize; |
| 1544 } | 1545 } |
| 1546 |
| 1547 *object = NULL; |
| 1548 if (!code.IsNull()) { |
| 1549 *object = &Object::Handle(); |
| 1550 if (!DecodeLoadObjectFromPoolOrThread(pc, code, *object)) { |
| 1551 *object = NULL; |
| 1552 } |
| 1553 } |
| 1545 } | 1554 } |
| 1546 | 1555 |
| 1547 #endif // !PRODUCT | 1556 #endif // !PRODUCT |
| 1548 | 1557 |
| 1549 } // namespace dart | 1558 } // namespace dart |
| 1550 | 1559 |
| 1551 #endif // defined TARGET_ARCH_ARM | 1560 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |