Add a fence to ensure other threads see the correct data.

Other threads may see the ProfilingInfo pointer in the ArtMethod,
but the data they have for it is bogus due to a prior load in their
cache.

bug:26221227
Change-Id: I1fa8f088a3144df39d07a986ed57d6fc20edba18
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 08eac0e..c260ca4 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -668,6 +668,11 @@
     return nullptr;
   }
   info = new (data) ProfilingInfo(method, entries);
+
+  // Make sure other threads see the data in the profiling info object before the
+  // store in the ArtMethod's ProfilingInfo pointer.
+  QuasiAtomic::ThreadFenceRelease();
+
   method->SetProfilingInfo(info);
   profiling_infos_.push_back(info);
   return info;