diff options
author | 2015-04-08 10:01:01 +0100 | |
---|---|---|
committer | 2015-04-08 16:36:19 +0100 | |
commit | 87b7c52ac660119b8dea46967974b76c86d0750b (patch) | |
tree | 9f80325934dd7568b8288224a155284fea97bd9a /compiler/dex/mir_optimization.cc | |
parent | 8635e1886f3624154c076cf40cbf182c74e2e0e3 (diff) |
Quick: Clean up temp use counting.
For the boot image on arm64 and x86-64 we're using true
PC-relative addressing, so pc_rel_temp_ is nullptr and
CanUsePcRelDexCacheArrayLoad() returns true, but we're not
actually using the ArtMethod* so fix the AnalyzeMIR() to
take it into account.
Also don't count intrinsic invokes towards ArtMethod* uses.
To avoid repeated method inliner inquiries about whether a
method is intrinsic or special (requiring lock acquisition),
cache that information in MirMethodLoweringInfo. As part of
that cleanup, take quickened invokes into account for
suspend check elimination.
Change-Id: I5b4ec124221c0db1314c8e72675976c110ebe7ca
Diffstat (limited to 'compiler/dex/mir_optimization.cc')
-rw-r--r-- | compiler/dex/mir_optimization.cc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc index 5dcc903cf7..9d7b4b4dfd 100644 --- a/compiler/dex/mir_optimization.cc +++ b/compiler/dex/mir_optimization.cc @@ -1517,7 +1517,7 @@ void MIRGraph::InlineSpecialMethods(BasicBlock* bb) { continue; } const MirMethodLoweringInfo& method_info = GetMethodLoweringInfo(mir); - if (!method_info.FastPath()) { + if (!method_info.FastPath() || !method_info.IsSpecial()) { continue; } @@ -1659,10 +1659,6 @@ bool MIRGraph::EliminateSuspendChecksGate() { !HasInvokes()) { // No invokes to actually eliminate any suspend checks. return false; } - if (cu_->compiler_driver != nullptr && cu_->compiler_driver->GetMethodInlinerMap() != nullptr) { - temp_.sce.inliner = - cu_->compiler_driver->GetMethodInlinerMap()->GetMethodInliner(cu_->dex_file); - } suspend_checks_in_loops_ = arena_->AllocArray<uint32_t>(GetNumBlocks(), kArenaAllocMisc); return true; } @@ -1680,9 +1676,9 @@ bool MIRGraph::EliminateSuspendChecks(BasicBlock* bb) { uint32_t suspend_checks_in_loops = (1u << bb->nesting_depth) - 1u; // Start with all loop heads. bool found_invoke = false; for (MIR* mir = bb->first_mir_insn; mir != nullptr; mir = mir->next) { - if (IsInstructionInvoke(mir->dalvikInsn.opcode) && - (temp_.sce.inliner == nullptr || - !temp_.sce.inliner->IsIntrinsic(mir->dalvikInsn.vB, nullptr))) { + if ((IsInstructionInvoke(mir->dalvikInsn.opcode) || + IsInstructionQuickInvoke(mir->dalvikInsn.opcode)) && + !GetMethodLoweringInfo(mir).IsIntrinsic()) { // Non-intrinsic invoke, rely on a suspend point in the invoked method. found_invoke = true; break; @@ -1745,10 +1741,6 @@ bool MIRGraph::EliminateSuspendChecks(BasicBlock* bb) { return true; } -void MIRGraph::EliminateSuspendChecksEnd() { - temp_.sce.inliner = nullptr; -} - bool MIRGraph::CanThrow(MIR* mir) const { if ((mir->dalvikInsn.FlagsOf() & Instruction::kThrow) == 0) { return false; |