std::unique_ptr<std::ostream> visualizer_output_;
- // Delegate to Quick in case the optimizing compiler cannot compile a method.
- std::unique_ptr<Compiler> delegate_;
-
DISALLOW_COPY_AND_ASSIGN(OptimizingCompiler);
};
OptimizingCompiler::OptimizingCompiler(CompilerDriver* driver)
: Compiler(driver, kMaximumCompilationTimeBeforeWarning),
run_optimizations_(
- driver->GetCompilerOptions().GetCompilerFilter() != CompilerOptions::kTime),
- delegate_(Create(driver, Compiler::Kind::kQuick)) {}
+ driver->GetCompilerOptions().GetCompilerFilter() != CompilerOptions::kTime) {}
void OptimizingCompiler::Init() {
- delegate_->Init();
// Enable C1visualizer output. Must be done in Init() because the compiler
// driver is not fully initialized when passed to the compiler's constructor.
CompilerDriver* driver = GetCompilerDriver();
}
void OptimizingCompiler::UnInit() const {
- delegate_->UnInit();
}
OptimizingCompiler::~OptimizingCompiler() {
}
}
-void OptimizingCompiler::InitCompilationUnit(CompilationUnit& cu) const {
- delegate_->InitCompilationUnit(cu);
+void OptimizingCompiler::InitCompilationUnit(CompilationUnit& cu ATTRIBUTE_UNUSED) const {
}
bool OptimizingCompiler::CanCompileMethod(uint32_t method_idx ATTRIBUTE_UNUSED,
}
}
- if (method != nullptr) {
- return method;
- }
- method = delegate_->Compile(code_item, access_flags, invoke_type, class_def_idx, method_idx,
- jclass_loader, dex_file, dex_cache);
-
- if (method != nullptr) {
- MaybeRecordStat(MethodCompilationStat::kCompiledQuick);
- }
return method;
}
kAttemptCompilation = 0,
kCompiledBaseline,
kCompiledOptimized,
- kCompiledQuick,
kInlinedInvoke,
kInstructionSimplifications,
kInstructionSimplificationsArch,
compile_stats_[kCompiledBaseline] * 100 / compile_stats_[kAttemptCompilation];
size_t optimized_percent =
compile_stats_[kCompiledOptimized] * 100 / compile_stats_[kAttemptCompilation];
- size_t quick_percent =
- compile_stats_[kCompiledQuick] * 100 / compile_stats_[kAttemptCompilation];
std::ostringstream oss;
oss << "Attempted compilation of " << compile_stats_[kAttemptCompilation] << " methods: ";
oss << unoptimized_percent << "% (" << compile_stats_[kCompiledBaseline] << ") unoptimized, ";
oss << optimized_percent << "% (" << compile_stats_[kCompiledOptimized] << ") optimized, ";
- oss << quick_percent << "% (" << compile_stats_[kCompiledQuick] << ") quick.";
LOG(INFO) << oss.str();
case kAttemptCompilation : return "kAttemptCompilation";
case kCompiledBaseline : return "kCompiledBaseline";
case kCompiledOptimized : return "kCompiledOptimized";
- case kCompiledQuick : return "kCompiledQuick";
case kInlinedInvoke : return "kInlinedInvoke";
case kInstructionSimplifications: return "kInstructionSimplifications";
case kInstructionSimplificationsArch: return "kInstructionSimplificationsArch";