diff options
author | Calin Juravle <calin@google.com> | 2015-09-16 14:33:16 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-09-16 14:33:16 +0000 |
commit | fe157012b6d760c275d944ff83e8bea371c59b09 (patch) | |
tree | a2b013dded6e25cab1d3ff5abf09c426904e142c /compiler/optimizing/code_generator.cc | |
parent | aef880c4b872ccf1a63a3c563cb056ae117fc9c8 (diff) | |
parent | ecc4366670e12b4812ef1653f7c8d52234ca1b1f (diff) |
Merge "Add OptimizingCompilerStats to the CodeGenerator class."
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 aadf525f26..50108a7275 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -542,24 +542,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 @@ -572,22 +581,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: |