Index: src/a64/decoder-a64.cc |
diff --git a/src/a64/decoder-a64.cc b/src/a64/decoder-a64.cc |
index e7383d446ae4e7eadd549e30d69ed68a82d6b8d8..6a0497b8a30003f48953213302f4a3ad888b78f1 100644 |
--- a/src/a64/decoder-a64.cc |
+++ b/src/a64/decoder-a64.cc |
@@ -37,6 +37,73 @@ |
namespace v8 { |
namespace internal { |
+ |
+void DispatchingDecoderVisitor::AppendVisitor(DecoderVisitor* new_visitor) { |
+ visitors_.remove(new_visitor); |
+ visitors_.push_front(new_visitor); |
+} |
+ |
+ |
+void DispatchingDecoderVisitor::PrependVisitor(DecoderVisitor* new_visitor) { |
+ visitors_.remove(new_visitor); |
+ visitors_.push_back(new_visitor); |
+} |
+ |
+ |
+void DispatchingDecoderVisitor::InsertVisitorBefore( |
+ DecoderVisitor* new_visitor, DecoderVisitor* registered_visitor) { |
+ visitors_.remove(new_visitor); |
+ std::list<DecoderVisitor*>::iterator it; |
+ for (it = visitors_.begin(); it != visitors_.end(); it++) { |
+ if (*it == registered_visitor) { |
+ visitors_.insert(it, new_visitor); |
+ return; |
+ } |
+ } |
+ // We reached the end of the list. The last element must be |
+ // registered_visitor. |
+ ASSERT(*it == registered_visitor); |
+ visitors_.insert(it, new_visitor); |
+} |
+ |
+ |
+void DispatchingDecoderVisitor::InsertVisitorAfter( |
+ DecoderVisitor* new_visitor, DecoderVisitor* registered_visitor) { |
+ visitors_.remove(new_visitor); |
+ std::list<DecoderVisitor*>::iterator it; |
+ for (it = visitors_.begin(); it != visitors_.end(); it++) { |
+ if (*it == registered_visitor) { |
+ it++; |
+ visitors_.insert(it, new_visitor); |
+ return; |
+ } |
+ } |
+ // We reached the end of the list. The last element must be |
+ // registered_visitor. |
+ ASSERT(*it == registered_visitor); |
+ visitors_.push_back(new_visitor); |
+} |
+ |
+ |
+void DispatchingDecoderVisitor::RemoveVisitor(DecoderVisitor* visitor) { |
+ visitors_.remove(visitor); |
+} |
+ |
+ |
+#define DEFINE_VISITOR_CALLERS(A) \ |
+ void DispatchingDecoderVisitor::Visit##A(Instruction* instr) { \ |
+ if (!(instr->Mask(A##FMask) == A##Fixed)) { \ |
+ ASSERT(instr->Mask(A##FMask) == A##Fixed); \ |
+ } \ |
+ std::list<DecoderVisitor*>::iterator it; \ |
+ for (it = visitors_.begin(); it != visitors_.end(); it++) { \ |
+ (*it)->Visit##A(instr); \ |
+ } \ |
+ } |
+VISITOR_LIST(DEFINE_VISITOR_CALLERS) |
+#undef DEFINE_VISITOR_CALLERS |
+ |
+ |
// Top-level instruction decode function. |
void Decoder::Decode(Instruction *instr) { |
if (instr->Bits(28, 27) == 0) { |
@@ -116,58 +183,6 @@ void Decoder::Decode(Instruction *instr) { |
} |
-void Decoder::AppendVisitor(DecoderVisitor* new_visitor) { |
- visitors_.remove(new_visitor); |
- visitors_.push_front(new_visitor); |
-} |
- |
- |
-void Decoder::PrependVisitor(DecoderVisitor* new_visitor) { |
- visitors_.remove(new_visitor); |
- visitors_.push_back(new_visitor); |
-} |
- |
- |
-void Decoder::InsertVisitorBefore(DecoderVisitor* new_visitor, |
- DecoderVisitor* registered_visitor) { |
- visitors_.remove(new_visitor); |
- std::list<DecoderVisitor*>::iterator it; |
- for (it = visitors_.begin(); it != visitors_.end(); it++) { |
- if (*it == registered_visitor) { |
- visitors_.insert(it, new_visitor); |
- return; |
- } |
- } |
- // We reached the end of the list. The last element must be |
- // registered_visitor. |
- ASSERT(*it == registered_visitor); |
- visitors_.insert(it, new_visitor); |
-} |
- |
- |
-void Decoder::InsertVisitorAfter(DecoderVisitor* new_visitor, |
- DecoderVisitor* registered_visitor) { |
- visitors_.remove(new_visitor); |
- std::list<DecoderVisitor*>::iterator it; |
- for (it = visitors_.begin(); it != visitors_.end(); it++) { |
- if (*it == registered_visitor) { |
- it++; |
- visitors_.insert(it, new_visitor); |
- return; |
- } |
- } |
- // We reached the end of the list. The last element must be |
- // registered_visitor. |
- ASSERT(*it == registered_visitor); |
- visitors_.push_back(new_visitor); |
-} |
- |
- |
-void Decoder::RemoveVisitor(DecoderVisitor* visitor) { |
- visitors_.remove(visitor); |
-} |
- |
- |
void Decoder::DecodePCRelAddressing(Instruction* instr) { |
ASSERT(instr->Bits(27, 24) == 0x0); |
// We know bit 28 is set, as <b28:b27> = 0 is filtered out at the top level |
@@ -707,20 +722,6 @@ void Decoder::DecodeAdvSIMDDataProcessing(Instruction* instr) { |
} |
-#define DEFINE_VISITOR_CALLERS(A) \ |
- void Decoder::Visit##A(Instruction *instr) { \ |
- if (!(instr->Mask(A##FMask) == A##Fixed)) { \ |
- ASSERT(instr->Mask(A##FMask) == A##Fixed); \ |
- } \ |
- std::list<DecoderVisitor*>::iterator it; \ |
- for (it = visitors_.begin(); it != visitors_.end(); it++) { \ |
- (*it)->Visit##A(instr); \ |
- } \ |
- } |
-VISITOR_LIST(DEFINE_VISITOR_CALLERS) |
-#undef DEFINE_VISITOR_CALLERS |
- |
- |
} } // namespace v8::internal |
#endif // V8_TARGET_ARCH_A64 |