Fix compilation statistics collection in inliner.
Stats from callee graph builder were not merged into main
stats and stats for callee graph optimizations were counted
even when the callee graph was eventually rejected.
Allocate the callee graph statistics on the arena.
Measured compilation of a big app using heaptrack:
bytes allocated in total (ignoring deallocations): 3.77GB -> 3.37GB
calls to allocation functions: 10650510 -> 8203129
Test: testrunner.py --host
Test: Stats change in the expected direction for an app.
Bug: 34053922
Change-Id: I605280d262b86af14b847acf3bb6dc077b749cc0
diff --git a/compiler/optimizing/inliner.h b/compiler/optimizing/inliner.h
index 11aacab..75d025a 100644
--- a/compiler/optimizing/inliner.h
+++ b/compiler/optimizing/inliner.h
@@ -51,7 +51,8 @@
total_number_of_dex_registers_(total_number_of_dex_registers),
depth_(depth),
number_of_inlined_instructions_(0),
- handles_(handles) {}
+ handles_(handles),
+ inline_stats_(nullptr) {}
void Run() OVERRIDE;
@@ -218,6 +219,10 @@
size_t number_of_inlined_instructions_;
VariableSizedHandleScope* const handles_;
+ // Used to record stats about optimizations on the inlined graph.
+ // If the inlining is successful, these stats are merged to the caller graph's stats.
+ OptimizingCompilerStats* inline_stats_;
+
DISALLOW_COPY_AND_ASSIGN(HInliner);
};