OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A Disassembler object is used to disassemble a block of code instruction by | 5 // A Disassembler object is used to disassemble a block of code instruction by |
6 // instruction. The default implementation of the NameConverter object can be | 6 // instruction. The default implementation of the NameConverter object can be |
7 // overriden to modify register names or to do symbol lookup on addresses. | 7 // overriden to modify register names or to do symbol lookup on addresses. |
8 // | 8 // |
9 // The example below will disassemble a block of code and print it to stdout. | 9 // The example below will disassemble a block of code and print it to stdout. |
10 // | 10 // |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 out_buffer_[out_buffer_pos_] = '\0'; | 52 out_buffer_[out_buffer_pos_] = '\0'; |
53 } | 53 } |
54 | 54 |
55 ~Decoder() {} | 55 ~Decoder() {} |
56 | 56 |
57 // Writes one disassembled instruction into 'buffer' (0-terminated). | 57 // Writes one disassembled instruction into 'buffer' (0-terminated). |
58 // Returns the length of the disassembled machine instruction in bytes. | 58 // Returns the length of the disassembled machine instruction in bytes. |
59 int InstructionDecode(byte* instruction); | 59 int InstructionDecode(byte* instruction); |
60 | 60 |
61 private: | 61 private: |
62 const uint32_t kMsaI8Mask = ((3U << 24) | ((1 << 6) - 1)); | |
63 const uint32_t kMsaI5Mask = ((7U << 23) | ((1 << 6) - 1)); | |
64 const uint32_t kMsaMI10Mask = (15U << 2); | |
65 const uint32_t kMsaBITMask = ((7U << 23) | ((1 << 6) - 1)); | |
66 const uint32_t kMsaELMMask = (15U << 22); | |
67 const uint32_t kMsa3RMask = ((7U << 23) | ((1 << 6) - 1)); | |
68 const uint32_t kMsa3RFMask = ((15U << 22) | ((1 << 6) - 1)); | |
69 const uint32_t kMsaVECMask = (23U << 21); | |
70 const uint32_t kMsa2RMask = (7U << 18); | |
71 const uint32_t kMsa2RFMask = (15U << 17); | |
72 | |
73 // Bottleneck functions to print into the out_buffer. | 62 // Bottleneck functions to print into the out_buffer. |
74 void PrintChar(const char ch); | 63 void PrintChar(const char ch); |
75 void Print(const char* str); | 64 void Print(const char* str); |
76 | 65 |
77 // Printing of common values. | 66 // Printing of common values. |
78 void PrintRegister(int reg); | 67 void PrintRegister(int reg); |
79 void PrintFPURegister(int freg); | 68 void PrintFPURegister(int freg); |
80 void PrintMSARegister(int wreg); | 69 void PrintMSARegister(int wreg); |
81 void PrintFPUStatusRegister(int freg); | 70 void PrintFPUStatusRegister(int freg); |
82 void PrintMSAControlRegister(int creg); | 71 void PrintMSAControlRegister(int creg); |
(...skipping 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2728 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2717 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
2729 } | 2718 } |
2730 } | 2719 } |
2731 | 2720 |
2732 | 2721 |
2733 #undef UNSUPPORTED | 2722 #undef UNSUPPORTED |
2734 | 2723 |
2735 } // namespace disasm | 2724 } // namespace disasm |
2736 | 2725 |
2737 #endif // V8_TARGET_ARCH_MIPS | 2726 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |