diff options
author | Serban Constantinescu <serban.constantinescu@linaro.org> | 2015-08-13 13:33:12 +0100 |
---|---|---|
committer | Serban Constantinescu <serban.constantinescu@linaro.org> | 2015-08-27 15:28:25 +0100 |
commit | ecc4366670e12b4812ef1653f7c8d52234ca1b1f (patch) | |
tree | fe7be52b1025b8122547b34d8765248d5959cd3a /compiler/optimizing/code_generator.cc | |
parent | 772cc4a2d4f978888d1b1e5a78c1c16a108260ed (diff) |
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>
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 503187bd3d..e8304e5cca 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -531,24 +531,33 @@ void CodeGenerator::AllocateLocations(HInstruction* instruction) { } } +void CodeGenerator::MaybeRecordStat(MethodCompilationStat compilation_stat, size_t count) const { + if (stats_ != nullptr) { + stats_->RecordStat(compilation_stat, count); + } +} + CodeGenerator* CodeGenerator::Create(HGraph* graph, InstructionSet instruction_set, const InstructionSetFeatures& isa_features, - const CompilerOptions& compiler_options) { + const CompilerOptions& compiler_options, + OptimizingCompilerStats* stats) { switch (instruction_set) { #ifdef ART_ENABLE_CODEGEN_arm case kArm: case kThumb2: { return new arm::CodeGeneratorARM(graph, - *isa_features.AsArmInstructionSetFeatures(), - compiler_options); + *isa_features.AsArmInstructionSetFeatures(), + compiler_options, + stats); } #endif #ifdef ART_ENABLE_CODEGEN_arm64 case kArm64: { return new arm64::CodeGeneratorARM64(graph, - *isa_features.AsArm64InstructionSetFeatures(), - compiler_options); + *isa_features.AsArm64InstructionSetFeatures(), + compiler_options, + stats); } #endif #ifdef ART_ENABLE_CODEGEN_mips @@ -561,22 +570,25 @@ CodeGenerator* CodeGenerator::Create(HGraph* graph, #ifdef ART_ENABLE_CODEGEN_mips64 case kMips64: { return new mips64::CodeGeneratorMIPS64(graph, - *isa_features.AsMips64InstructionSetFeatures(), - compiler_options); + *isa_features.AsMips64InstructionSetFeatures(), + compiler_options, + stats); } #endif #ifdef ART_ENABLE_CODEGEN_x86 case kX86: { return new x86::CodeGeneratorX86(graph, - *isa_features.AsX86InstructionSetFeatures(), - compiler_options); + *isa_features.AsX86InstructionSetFeatures(), + compiler_options, + stats); } #endif #ifdef ART_ENABLE_CODEGEN_x86_64 case kX86_64: { return new x86_64::CodeGeneratorX86_64(graph, - *isa_features.AsX86_64InstructionSetFeatures(), - compiler_options); + *isa_features.AsX86_64InstructionSetFeatures(), + compiler_options, + stats); } #endif default: |