OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 V(FPDataProcessing3Source) \ | 82 V(FPDataProcessing3Source) \ |
83 V(FPIntegerConvert) \ | 83 V(FPIntegerConvert) \ |
84 V(FPFixedPointConvert) \ | 84 V(FPFixedPointConvert) \ |
85 V(Unallocated) \ | 85 V(Unallocated) \ |
86 V(Unimplemented) | 86 V(Unimplemented) |
87 | 87 |
88 // The Visitor interface. Disassembler and simulator (and other tools) | 88 // The Visitor interface. Disassembler and simulator (and other tools) |
89 // must provide implementations for all of these functions. | 89 // must provide implementations for all of these functions. |
90 class DecoderVisitor { | 90 class DecoderVisitor { |
91 public: | 91 public: |
| 92 virtual ~DecoderVisitor() {} |
| 93 |
92 #define DECLARE(A) virtual void Visit##A(Instruction* instr) = 0; | 94 #define DECLARE(A) virtual void Visit##A(Instruction* instr) = 0; |
93 VISITOR_LIST(DECLARE) | 95 VISITOR_LIST(DECLARE) |
94 #undef DECLARE | 96 #undef DECLARE |
95 | |
96 virtual ~DecoderVisitor() {} | |
97 | |
98 private: | |
99 // Visitors are registered in a list. | |
100 std::list<DecoderVisitor*> visitors_; | |
101 | |
102 friend class Decoder; | |
103 }; | 97 }; |
104 | 98 |
105 | 99 |
106 class Decoder: public DecoderVisitor { | 100 class Decoder { |
107 public: | 101 public: |
108 explicit Decoder() {} | 102 Decoder() {} |
109 | 103 |
110 // Top-level instruction decoder function. Decodes an instruction and calls | 104 // Top-level instruction decoder function. Decodes an instruction and calls |
111 // the visitor functions registered with the Decoder class. | 105 // the visitor functions registered with the Decoder class. |
112 void Decode(Instruction *instr); | 106 void Decode(Instruction *instr); |
113 | 107 |
114 // Register a new visitor class with the decoder. | 108 // Register a new visitor class with the decoder. |
115 // Decode() will call the corresponding visitor method from all registered | 109 // Decode() will call the corresponding visitor method from all registered |
116 // visitor classes when decoding reaches the leaf node of the instruction | 110 // visitor classes when decoding reaches the leaf node of the instruction |
117 // decode tree. | 111 // decode tree. |
118 // Visitors are called in the order. | 112 // Visitors are called in the order. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 181 |
188 // Decode the Advanced SIMD (NEON) load/store part of the instruction tree, | 182 // Decode the Advanced SIMD (NEON) load/store part of the instruction tree, |
189 // and call the corresponding visitors. | 183 // and call the corresponding visitors. |
190 // On entry, instruction bits 29:25 = 0x6. | 184 // On entry, instruction bits 29:25 = 0x6. |
191 void DecodeAdvSIMDLoadStore(Instruction* instr); | 185 void DecodeAdvSIMDLoadStore(Instruction* instr); |
192 | 186 |
193 // Decode the Advanced SIMD (NEON) data processing part of the instruction | 187 // Decode the Advanced SIMD (NEON) data processing part of the instruction |
194 // tree, and call the corresponding visitors. | 188 // tree, and call the corresponding visitors. |
195 // On entry, instruction bits 27:25 = 0x7. | 189 // On entry, instruction bits 27:25 = 0x7. |
196 void DecodeAdvSIMDDataProcessing(Instruction* instr); | 190 void DecodeAdvSIMDDataProcessing(Instruction* instr); |
| 191 |
| 192 // Visitors are registered in a list. |
| 193 std::list<DecoderVisitor*> visitors_; |
197 }; | 194 }; |
198 | 195 |
199 | 196 |
200 } } // namespace v8::internal | 197 } } // namespace v8::internal |
201 | 198 |
202 #endif // V8_A64_DECODER_A64_H_ | 199 #endif // V8_A64_DECODER_A64_H_ |
OLD | NEW |