summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-04-14 20:10:16 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2019-04-14 20:48:56 +0000
commita3b31ba6ee409f11889af604d91d8786458ea48f (patch)
tree6efccf253658a433d87cacbf1fc686bf9ab9a319
parentb10f02828b869cf6505bbd6eef6d2ae332c4e91b (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.cc7
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;