Wait until inline cache is accessible in GetProfiledMethods.
Bug: 119844538
Test: test.py
Change-Id: I7ee0718bb866652b1913496eb3ecd3beee1d46c3
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 1701ca8..0bdb0c9 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -1806,8 +1806,10 @@
void JitCodeCache::GetProfiledMethods(const std::set<std::string>& dex_base_locations,
std::vector<ProfileMethodInfo>& methods) {
+ Thread* self = Thread::Current();
+ WaitUntilInlineCacheAccessible(self);
+ MutexLock mu(self, lock_);
ScopedTrace trace(__FUNCTION__);
- MutexLock mu(Thread::Current(), lock_);
uint16_t jit_compile_threshold = Runtime::Current()->GetJITOptions()->GetCompileThreshold();
for (const ProfilingInfo* info : profiling_infos_) {
ArtMethod* method = info->GetMethod();