summaryrefslogtreecommitdiff
path: root/compiler/optimizing/profiling_info_builder.cc
diff options
context:
space:
mode:
author Almaz Mingaleev <mingaleev@google.com> 2024-01-04 10:24:24 +0000
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-01-04 13:14:46 +0000
commitc8309515d099992b7cab8f2b8c6db3ed77671ff4 (patch)
tree589f1b7130f59596b6d67666153f5a02977cf74f /compiler/optimizing/profiling_info_builder.cc
parentcac6b42519e9dd2725cb7e86fecd9ceb6e60d52f (diff)
Revert "Run optimizations with baseline compilation."
This reverts commit 41c5dde40d1c75d36a7f984c8d72ec65fbff3111. Reason for revert: breaks test.java.util.Arrays.Sorting Change-Id: I03385c9f1efff4b8e8bd315827dde6ed774bbb52
Diffstat (limited to 'compiler/optimizing/profiling_info_builder.cc')
-rw-r--r--compiler/optimizing/profiling_info_builder.cc59
1 files changed, 5 insertions, 54 deletions
diff --git a/compiler/optimizing/profiling_info_builder.cc b/compiler/optimizing/profiling_info_builder.cc
index 19795f5466..7888753830 100644
--- a/compiler/optimizing/profiling_info_builder.cc
+++ b/compiler/optimizing/profiling_info_builder.cc
@@ -20,7 +20,6 @@
#include "code_generator.h"
#include "driver/compiler_options.h"
#include "dex/code_item_accessors-inl.h"
-#include "inliner.h"
#include "jit/profiling_info.h"
#include "optimizing_compiler_stats.h"
#include "scoped_thread_state_change-inl.h"
@@ -43,53 +42,10 @@ void ProfilingInfoBuilder::Run() {
ProfilingInfo::Create(soa.Self(), GetGraph()->GetArtMethod(), inline_caches_));
}
-
-uint32_t ProfilingInfoBuilder::EncodeInlinedDexPc(const HInliner* inliner,
- const CompilerOptions& compiler_options,
- HInvoke* invoke) {
- DCHECK(inliner->GetCallerEnvironment() != nullptr);
- DCHECK(inliner->GetParent() != nullptr);
- std::vector<uint32_t> temp_vector;
- temp_vector.push_back(invoke->GetDexPc());
- while (inliner->GetCallerEnvironment() != nullptr) {
- temp_vector.push_back(inliner->GetCallerEnvironment()->GetDexPc());
- inliner = inliner->GetParent();
- }
-
- DCHECK_EQ(inliner->GetOutermostGraph(), inliner->GetGraph());
- return InlineCache::EncodeDexPc(
- inliner->GetOutermostGraph()->GetArtMethod(),
- temp_vector,
- compiler_options.GetInlineMaxCodeUnits());
-}
-
-static uint32_t EncodeDexPc(HInvoke* invoke, const CompilerOptions& compiler_options) {
- std::vector<uint32_t> dex_pcs;
- ArtMethod* outer_method = nullptr;
- for (HEnvironment* environment = invoke->GetEnvironment();
- environment != nullptr;
- environment = environment->GetParent()) {
- outer_method = environment->GetMethod();
- dex_pcs.push_back(environment->GetDexPc());
- }
-
- ScopedObjectAccess soa(Thread::Current());
- return InlineCache::EncodeDexPc(
- outer_method,
- dex_pcs,
- compiler_options.GetInlineMaxCodeUnits());
-}
-
void ProfilingInfoBuilder::HandleInvoke(HInvoke* invoke) {
+ DCHECK(!invoke->GetEnvironment()->IsFromInlinedInvoke());
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();
- }
+ inline_caches_.push_back(invoke->GetDexPc());
}
}
@@ -125,15 +81,10 @@ bool ProfilingInfoBuilder::IsInlineCacheUseful(HInvoke* invoke, CodeGenerator* c
return true;
}
-InlineCache* ProfilingInfoBuilder::GetInlineCache(ProfilingInfo* info,
- const CompilerOptions& compiler_options,
- HInvoke* instruction) {
+InlineCache* ProfilingInfoBuilder::GetInlineCache(ProfilingInfo* info, HInvoke* instruction) {
+ DCHECK(!instruction->GetEnvironment()->IsFromInlinedInvoke());
ScopedObjectAccess soa(Thread::Current());
- uint32_t dex_pc = EncodeDexPc(instruction, compiler_options);
- if (dex_pc == kNoDexPc) {
- return nullptr;
- }
- return info->GetInlineCache(dex_pc);
+ return info->GetInlineCache(instruction->GetDexPc());
}
} // namespace art