summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.h
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2015-09-16 14:33:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-09-16 14:33:16 +0000
commitfe157012b6d760c275d944ff83e8bea371c59b09 (patch)
treea2b013dded6e25cab1d3ff5abf09c426904e142c /compiler/optimizing/code_generator.h
parentaef880c4b872ccf1a63a3c563cb056ae117fc9c8 (diff)
parentecc4366670e12b4812ef1653f7c8d52234ca1b1f (diff)
Merge "Add OptimizingCompilerStats to the CodeGenerator class."
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r--compiler/optimizing/code_generator.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 11daf3f111..d2af56a33a 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -28,6 +28,7 @@
#include "locations.h"
#include "memory_region.h"
#include "nodes.h"
+#include "optimizing_compiler_stats.h"
#include "stack_map_stream.h"
namespace art {
@@ -144,7 +145,8 @@ class CodeGenerator {
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_; }
@@ -209,6 +211,8 @@ class CodeGenerator {
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.
@@ -392,7 +396,8 @@ class CodeGenerator {
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),
@@ -409,6 +414,7 @@ class CodeGenerator {
block_order_(nullptr),
is_baseline_(false),
disasm_info_(nullptr),
+ stats_(stats),
graph_(graph),
compiler_options_(compiler_options),
src_map_(nullptr),
@@ -503,6 +509,8 @@ class CodeGenerator {
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_;