Use HGraphDelegateVisitor instead of HGraphVisitor for lse.
This consolidates all VisitInvokeXXX to a single VisitInvoke.
Test: run-test on host.
Change-Id: I9b4a2ddbc054cdcf60a2e4ab7e28ea2d8e02b902
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index af5585e..7dff696 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -39,13 +39,14 @@
static HInstruction* const kDefaultHeapValue =
reinterpret_cast<HInstruction*>(static_cast<uintptr_t>(-2));
-class LSEVisitor : public HGraphVisitor {
+// Use HGraphDelegateVisitor for which all VisitInvokeXXX() delegate to VisitInvoke().
+class LSEVisitor : public HGraphDelegateVisitor {
public:
LSEVisitor(HGraph* graph,
const HeapLocationCollector& heap_locations_collector,
const SideEffectsAnalysis& side_effects,
OptimizingCompilerStats* stats)
- : HGraphVisitor(graph, stats),
+ : HGraphDelegateVisitor(graph, stats),
heap_location_collector_(heap_locations_collector),
side_effects_(side_effects),
allocator_(graph->GetArenaStack()),
@@ -540,23 +541,7 @@
}
}
- void VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) OVERRIDE {
- HandleInvoke(invoke);
- }
-
- void VisitInvokeVirtual(HInvokeVirtual* invoke) OVERRIDE {
- HandleInvoke(invoke);
- }
-
- void VisitInvokeInterface(HInvokeInterface* invoke) OVERRIDE {
- HandleInvoke(invoke);
- }
-
- void VisitInvokeUnresolved(HInvokeUnresolved* invoke) OVERRIDE {
- HandleInvoke(invoke);
- }
-
- void VisitInvokePolymorphic(HInvokePolymorphic* invoke) OVERRIDE {
+ void VisitInvoke(HInvoke* invoke) OVERRIDE {
HandleInvoke(invoke);
}