OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
8 #if defined(TARGET_ARCH_ARM64) | 8 #if defined(TARGET_ARCH_ARM64) |
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 ARM64Decoder : public ValueObject { | 15 class ARM64Decoder : public ValueObject { |
14 public: | 16 public: |
15 ARM64Decoder(char* buffer, size_t buffer_size) | 17 ARM64Decoder(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 ~ARM64Decoder() {} | 24 ~ARM64Decoder() {} |
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 int* out_instr_size, uword pc) { | 1460 int* out_instr_size, uword pc) { |
1459 ARM64Decoder decoder(human_buffer, human_size); | 1461 ARM64Decoder decoder(human_buffer, human_size); |
1460 decoder.InstructionDecode(pc); | 1462 decoder.InstructionDecode(pc); |
1461 int32_t instruction_bits = Instr::At(pc)->InstructionBits(); | 1463 int32_t instruction_bits = Instr::At(pc)->InstructionBits(); |
1462 OS::SNPrint(hex_buffer, hex_size, "%08x", instruction_bits); | 1464 OS::SNPrint(hex_buffer, hex_size, "%08x", instruction_bits); |
1463 if (out_instr_size) { | 1465 if (out_instr_size) { |
1464 *out_instr_size = Instr::kInstrSize; | 1466 *out_instr_size = Instr::kInstrSize; |
1465 } | 1467 } |
1466 } | 1468 } |
1467 | 1469 |
| 1470 #endif // !PRODUCT |
| 1471 |
1468 } // namespace dart | 1472 } // namespace dart |
1469 | 1473 |
1470 #endif // defined TARGET_ARCH_ARM | 1474 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |