void ProfilingInfoBuilder::Run() {
DCHECK(GetGraph()->IsUsefulOptimizing());
DCHECK_EQ(GetGraph()->GetProfilingInfo(), nullptr); // Order does not matter. for (HBasicBlock* block : GetGraph()->GetReversePostOrder()) { // No need to visit the phis.
VisitNonPhiInstructions(block);
}
void ProfilingInfoBuilder::HandleInvoke(HInvoke* invoke) { if (IsInlineCacheUseful(invoke, codegen_)) {
uint32_t dex_pc = EncodeDexPc(invoke, compiler_options_); if (dex_pc != kNoDexPc) {
inline_caches_.push_back(dex_pc);
} else {
ScopedObjectAccess soa(Thread::Current());
LOG(WARNING) << "Could not encode dex pc for "
<< invoke->GetResolvedMethod()->PrettyMethod();
}
}
}
bool ProfilingInfoBuilder::IsInlineCacheUseful(HInvoke* invoke, CodeGenerator* codegen) {
DCHECK(invoke->IsInvokeVirtual() || invoke->IsInvokeInterface()); if (codegen->IsImplementedIntrinsic(invoke)) { returnfalse;
} if (!invoke->GetBlock()->GetGraph()->IsCompilingBaseline()) { returnfalse;
} if (Runtime::Current()->IsAotCompiler()) { returnfalse;
} if (invoke->InputAt(0)->GetReferenceTypeInfo().IsExact()) { returnfalse;
} if (invoke->GetResolvedMethod() != nullptr) {
ScopedObjectAccess soa(Thread::Current()); if (invoke->GetResolvedMethod()->IsFinal() ||
invoke->GetResolvedMethod()->GetDeclaringClass()->IsFinal()) { returnfalse;
}
}
if (!codegen->GetGraph()->IsUsefulOptimizing()) { // Earlier pass knew what the calling target was. No need for an inline // cache. returnfalse;
} returntrue;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.