Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: src/a64/decoder-a64.h

Issue 181233002: A64: Move the dispatching logic of the decoder to a separate class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/a64/decoder-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/decoder-a64.h
diff --git a/src/a64/decoder-a64.h b/src/a64/decoder-a64.h
index 1a7f6c40903e2e0c9bb6f128a8fec0c2f065f343..56f9ba731bf21042fa756d8934ae04f6cb1f2a20 100644
--- a/src/a64/decoder-a64.h
+++ b/src/a64/decoder-a64.h
@@ -97,13 +97,11 @@ class DecoderVisitor {
};
-class Decoder {
+// A visitor that dispatches to a list of visitors.
+class DispatchingDecoderVisitor : public DecoderVisitor {
public:
- Decoder() {}
-
- // Top-level instruction decoder function. Decodes an instruction and calls
- // the visitor functions registered with the Decoder class.
- void Decode(Instruction *instr);
+ DispatchingDecoderVisitor() {}
+ virtual ~DispatchingDecoderVisitor() {}
// Register a new visitor class with the decoder.
// Decode() will call the corresponding visitor method from all registered
@@ -139,6 +137,20 @@ class Decoder {
#undef DECLARE
private:
+ // Visitors are registered in a list.
+ std::list<DecoderVisitor*> visitors_;
+};
+
+
+class Decoder : public DispatchingDecoderVisitor {
+ public:
+ Decoder() {}
+
+ // Top-level instruction decoder function. Decodes an instruction and calls
+ // the visitor functions registered with the Decoder class.
+ void Decode(Instruction *instr);
+
+ private:
// Decode the PC relative addressing instruction, and call the corresponding
// visitors.
// On entry, instruction bits 27:24 = 0x0.
@@ -188,9 +200,6 @@ class Decoder {
// tree, and call the corresponding visitors.
// On entry, instruction bits 27:25 = 0x7.
void DecodeAdvSIMDDataProcessing(Instruction* instr);
-
- // Visitors are registered in a list.
- std::list<DecoderVisitor*> visitors_;
};
« no previous file with comments | « no previous file | src/a64/decoder-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698