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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 out_buffer_[out_buffer_pos_] = '\0'; | 53 out_buffer_[out_buffer_pos_] = '\0'; |
54 } | 54 } |
55 | 55 |
56 ~Decoder() {} | 56 ~Decoder() {} |
57 | 57 |
58 // Writes one disassembled instruction into 'buffer' (0-terminated). | 58 // Writes one disassembled instruction into 'buffer' (0-terminated). |
59 // Returns the length of the disassembled machine instruction in bytes. | 59 // Returns the length of the disassembled machine instruction in bytes. |
60 int InstructionDecode(byte* instruction); | 60 int InstructionDecode(byte* instruction); |
61 | 61 |
62 private: | 62 private: |
63 const uint32_t kMsaI8Mask = ((3U << 24) | ((1 << 6) - 1)); | |
64 const uint32_t kMsaI5Mask = ((7U << 23) | ((1 << 6) - 1)); | |
65 const uint32_t kMsaMI10Mask = (15U << 2); | |
66 const uint32_t kMsaBITMask = ((7U << 23) | ((1 << 6) - 1)); | |
67 const uint32_t kMsaELMMask = (15U << 22); | |
68 const uint32_t kMsa3RMask = ((7U << 23) | ((1 << 6) - 1)); | |
69 const uint32_t kMsa3RFMask = ((15U << 22) | ((1 << 6) - 1)); | |
70 const uint32_t kMsaVECMask = (23U << 21); | |
71 const uint32_t kMsa2RMask = (7U << 18); | |
72 const uint32_t kMsa2RFMask = (15U << 17); | |
73 | |
74 // Bottleneck functions to print into the out_buffer. | 63 // Bottleneck functions to print into the out_buffer. |
75 void PrintChar(const char ch); | 64 void PrintChar(const char ch); |
76 void Print(const char* str); | 65 void Print(const char* str); |
77 | 66 |
78 // Printing of common values. | 67 // Printing of common values. |
79 void PrintRegister(int reg); | 68 void PrintRegister(int reg); |
80 void PrintFPURegister(int freg); | 69 void PrintFPURegister(int freg); |
81 void PrintMSARegister(int wreg); | 70 void PrintMSARegister(int wreg); |
82 void PrintFPUStatusRegister(int freg); | 71 void PrintFPUStatusRegister(int freg); |
83 void PrintMSAControlRegister(int creg); | 72 void PrintMSAControlRegister(int creg); |
(...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2975 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2964 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
2976 } | 2965 } |
2977 } | 2966 } |
2978 | 2967 |
2979 | 2968 |
2980 #undef UNSUPPORTED | 2969 #undef UNSUPPORTED |
2981 | 2970 |
2982 } // namespace disasm | 2971 } // namespace disasm |
2983 | 2972 |
2984 #endif // V8_TARGET_ARCH_MIPS64 | 2973 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |