OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef V8_ARM64_DISASM_ARM64_H | 5 #ifndef V8_ARM64_DISASM_ARM64_H |
6 #define V8_ARM64_DISASM_ARM64_H | 6 #define V8_ARM64_DISASM_ARM64_H |
7 | 7 |
| 8 #include "src/arm64/assembler-arm64.h" |
8 #include "src/arm64/decoder-arm64.h" | 9 #include "src/arm64/decoder-arm64.h" |
9 #include "src/arm64/instructions-arm64.h" | 10 #include "src/arm64/instructions-arm64.h" |
10 #include "src/globals.h" | 11 #include "src/globals.h" |
11 #include "src/utils.h" | 12 #include "src/utils.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 | 16 |
16 | 17 |
17 class DisassemblingDecoder : public DecoderVisitor { | 18 class DisassemblingDecoder : public DecoderVisitor { |
18 public: | 19 public: |
19 DisassemblingDecoder(); | 20 DisassemblingDecoder(); |
20 DisassemblingDecoder(char* text_buffer, int buffer_size); | 21 DisassemblingDecoder(char* text_buffer, int buffer_size); |
21 virtual ~DisassemblingDecoder(); | 22 virtual ~DisassemblingDecoder(); |
22 char* GetOutput(); | 23 char* GetOutput(); |
23 | 24 |
24 // Declare all Visitor functions. | 25 // Declare all Visitor functions. |
25 #define DECLARE(A) void Visit##A(Instruction* instr); | 26 #define DECLARE(A) void Visit##A(Instruction* instr); |
26 VISITOR_LIST(DECLARE) | 27 VISITOR_LIST(DECLARE) |
27 #undef DECLARE | 28 #undef DECLARE |
28 | 29 |
29 protected: | 30 protected: |
30 virtual void ProcessOutput(Instruction* instr); | 31 virtual void ProcessOutput(Instruction* instr); |
31 | 32 |
| 33 // Default output functions. The functions below implement a default way of |
| 34 // printing elements in the disassembly. A sub-class can override these to |
| 35 // customize the disassembly output. |
| 36 |
| 37 // Prints the name of a register. |
| 38 virtual void AppendRegisterNameToOutput(const CPURegister& reg); |
| 39 |
32 void Format(Instruction* instr, const char* mnemonic, const char* format); | 40 void Format(Instruction* instr, const char* mnemonic, const char* format); |
33 void Substitute(Instruction* instr, const char* string); | 41 void Substitute(Instruction* instr, const char* string); |
34 int SubstituteField(Instruction* instr, const char* format); | 42 int SubstituteField(Instruction* instr, const char* format); |
35 int SubstituteRegisterField(Instruction* instr, const char* format); | 43 int SubstituteRegisterField(Instruction* instr, const char* format); |
36 int SubstituteImmediateField(Instruction* instr, const char* format); | 44 int SubstituteImmediateField(Instruction* instr, const char* format); |
37 int SubstituteLiteralField(Instruction* instr, const char* format); | 45 int SubstituteLiteralField(Instruction* instr, const char* format); |
38 int SubstituteBitfieldImmediateField(Instruction* instr, const char* format); | 46 int SubstituteBitfieldImmediateField(Instruction* instr, const char* format); |
39 int SubstituteShiftField(Instruction* instr, const char* format); | 47 int SubstituteShiftField(Instruction* instr, const char* format); |
40 int SubstituteExtendField(Instruction* instr, const char* format); | 48 int SubstituteExtendField(Instruction* instr, const char* format); |
41 int SubstituteConditionField(Instruction* instr, const char* format); | 49 int SubstituteConditionField(Instruction* instr, const char* format); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 90 |
83 private: | 91 private: |
84 FILE *stream_; | 92 FILE *stream_; |
85 }; | 93 }; |
86 | 94 |
87 | 95 |
88 } // namespace internal | 96 } // namespace internal |
89 } // namespace v8 | 97 } // namespace v8 |
90 | 98 |
91 #endif // V8_ARM64_DISASM_ARM64_H | 99 #endif // V8_ARM64_DISASM_ARM64_H |
OLD | NEW |