Add OptimizingCompilerStats to the CodeGenerator class.
Just refactoring, not yet used, but will be used by the incoming patch
series and future CodeGen specific stats.
Change-Id: I7d20489907b82678120518a77bdab9c4cc58f937
Signed-off-by: Serban Constantinescu <serban.constantinescu@linaro.org>
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 938369b..f945564 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -26,6 +26,7 @@
#include "locations.h"
#include "memory_region.h"
#include "nodes.h"
+#include "optimizing_compiler_stats.h"
#include "stack_map_stream.h"
namespace art {
@@ -143,7 +144,8 @@
static CodeGenerator* Create(HGraph* graph,
InstructionSet instruction_set,
const InstructionSetFeatures& isa_features,
- const CompilerOptions& compiler_options);
+ const CompilerOptions& compiler_options,
+ OptimizingCompilerStats* stats = nullptr);
virtual ~CodeGenerator() {}
HGraph* GetGraph() const { return graph_; }
@@ -208,6 +210,8 @@
const CompilerOptions& GetCompilerOptions() const { return compiler_options_; }
+ void MaybeRecordStat(MethodCompilationStat compilation_stat, size_t count = 1) const;
+
// Saves the register in the stack. Returns the size taken on stack.
virtual size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) = 0;
// Restores the register from the stack. Returns the size taken on stack.
@@ -375,7 +379,8 @@
size_t number_of_register_pairs,
uint32_t core_callee_save_mask,
uint32_t fpu_callee_save_mask,
- const CompilerOptions& compiler_options)
+ const CompilerOptions& compiler_options,
+ OptimizingCompilerStats* stats)
: frame_size_(0),
core_spill_mask_(0),
fpu_spill_mask_(0),
@@ -392,6 +397,7 @@
block_order_(nullptr),
is_baseline_(false),
disasm_info_(nullptr),
+ stats_(stats),
graph_(graph),
compiler_options_(compiler_options),
slow_paths_(graph->GetArena(), 8),
@@ -485,6 +491,8 @@
void BlockIfInRegister(Location location, bool is_out = false) const;
void EmitEnvironment(HEnvironment* environment, SlowPathCode* slow_path);
+ OptimizingCompilerStats* stats_;
+
HGraph* const graph_;
const CompilerOptions& compiler_options_;