diff options
author | 2019-04-14 20:10:16 +0100 | |
---|---|---|
committer | 2019-04-14 20:48:56 +0000 | |
commit | a3b31ba6ee409f11889af604d91d8786458ea48f (patch) | |
tree | 6efccf253658a433d87cacbf1fc686bf9ab9a319 | |
parent | b10f02828b869cf6505bbd6eef6d2ae332c4e91b (diff) |
Fix ProfilingInfo race.
The field can be cleared concurrently, so fetch it only once.
Test: test.py
Bug: 119800099
Change-Id: I097a9c6f2175da7a027255c6b81954554bdbcff6
-rw-r--r-- | runtime/jit/jit_code_cache.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc index ff08a4587f..377092131e 100644 --- a/runtime/jit/jit_code_cache.cc +++ b/runtime/jit/jit_code_cache.cc @@ -555,8 +555,11 @@ const void* JitCodeCache::GetZygoteSavedEntryPoint(ArtMethod* method) { if (code_ptr != nullptr) { entry_point = OatQuickMethodHeader::FromCodePointer(code_ptr)->GetEntryPoint(); } - } else if (method->GetProfilingInfo(kRuntimePointerSize) != nullptr) { - entry_point = method->GetProfilingInfo(kRuntimePointerSize)->GetSavedEntryPoint(); + } else { + ProfilingInfo* profiling_info = method->GetProfilingInfo(kRuntimePointerSize); + if (profiling_info != nullptr) { + entry_point = profiling_info->GetSavedEntryPoint(); + } } if (Runtime::Current()->IsZygote() || IsInZygoteExecSpace(entry_point)) { return entry_point; |