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/decoder-arm64.h" | 8 #include "src/arm64/decoder-arm64.h" |
9 #include "src/arm64/instructions-arm64.h" | 9 #include "src/arm64/instructions-arm64.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
11 #include "src/utils.h" | 11 #include "src/utils.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 | 16 |
17 class Disassembler: public DecoderVisitor { | 17 class DisassemblingDecoder : public DecoderVisitor { |
18 public: | 18 public: |
19 Disassembler(); | 19 DisassemblingDecoder(); |
20 Disassembler(char* text_buffer, int buffer_size); | 20 DisassemblingDecoder(char* text_buffer, int buffer_size); |
21 virtual ~Disassembler(); | 21 virtual ~DisassemblingDecoder(); |
22 char* GetOutput(); | 22 char* GetOutput(); |
23 | 23 |
24 // Declare all Visitor functions. | 24 // Declare all Visitor functions. |
25 #define DECLARE(A) void Visit##A(Instruction* instr); | 25 #define DECLARE(A) void Visit##A(Instruction* instr); |
26 VISITOR_LIST(DECLARE) | 26 VISITOR_LIST(DECLARE) |
27 #undef DECLARE | 27 #undef DECLARE |
28 | 28 |
29 protected: | 29 protected: |
30 virtual void ProcessOutput(Instruction* instr); | 30 virtual void ProcessOutput(Instruction* instr); |
31 | 31 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void ResetOutput(); | 66 void ResetOutput(); |
67 void AppendToOutput(const char* string, ...); | 67 void AppendToOutput(const char* string, ...); |
68 | 68 |
69 char* buffer_; | 69 char* buffer_; |
70 uint32_t buffer_pos_; | 70 uint32_t buffer_pos_; |
71 uint32_t buffer_size_; | 71 uint32_t buffer_size_; |
72 bool own_buffer_; | 72 bool own_buffer_; |
73 }; | 73 }; |
74 | 74 |
75 | 75 |
76 class PrintDisassembler: public Disassembler { | 76 class PrintDisassembler : public DisassemblingDecoder { |
77 public: | 77 public: |
78 explicit PrintDisassembler(FILE* stream) : stream_(stream) { } | 78 explicit PrintDisassembler(FILE* stream) : stream_(stream) { } |
79 ~PrintDisassembler() { } | 79 ~PrintDisassembler() { } |
80 | 80 |
81 virtual void ProcessOutput(Instruction* instr); | 81 virtual void ProcessOutput(Instruction* instr); |
82 | 82 |
83 private: | 83 private: |
84 FILE *stream_; | 84 FILE *stream_; |
85 }; | 85 }; |
86 | 86 |
87 | 87 |
88 } // namespace internal | 88 } // namespace internal |
89 } // namespace v8 | 89 } // namespace v8 |
90 | 90 |
91 #endif // V8_ARM64_DISASM_ARM64_H | 91 #endif // V8_ARM64_DISASM_ARM64_H |
OLD | NEW |