diff options
author | 2019-09-18 06:14:50 +0000 | |
---|---|---|
committer | 2019-09-18 06:14:50 +0000 | |
commit | 4ac0e1571e015a01d75091c3daef065f9624ad77 (patch) | |
tree | 4d13edeab88bd6fd724388c48385b0c3cca4f3a8 /runtime/jit/jit_code_cache.cc | |
parent | 5a2301d897294ff4ee6de71f459dc2566dc3fa1a (diff) |
Revert "Revert "Basic structural redefinition support""
This reverts commit 5a2301d897294ff4ee6de71f459dc2566dc3fa1a.
Bug: 134162467
Reason for revert: Relanding as unclear if issue is due to topic.
Change-Id: Ib1d1cf2e9132e30c9649b760ae9ae2d8ceacf843
Diffstat (limited to 'runtime/jit/jit_code_cache.cc')
-rw-r--r-- | runtime/jit/jit_code_cache.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc index c0342baa23..ecfe9b66f0 100644 --- a/runtime/jit/jit_code_cache.cc +++ b/runtime/jit/jit_code_cache.cc @@ -1686,6 +1686,28 @@ void JitCodeCache::DoneCompiling(ArtMethod* method, Thread* self, bool osr) { } } +void JitCodeCache::InvalidateAllCompiledCode() { + art::MutexLock mu(Thread::Current(), *Locks::jit_lock_); + size_t cnt = profiling_infos_.size(); + size_t osr_size = osr_code_map_.size(); + for (ProfilingInfo* pi : profiling_infos_) { + // NB Due to OSR we might run this on some methods multiple times but this should be fine. + ArtMethod* meth = pi->GetMethod(); + pi->SetSavedEntryPoint(nullptr); + // We had a ProfilingInfo so we must be warm. + ClearMethodCounter(meth, /*was_warm=*/true); + ClassLinker* linker = Runtime::Current()->GetClassLinker(); + if (meth->IsObsolete()) { + linker->SetEntryPointsForObsoleteMethod(meth); + } else { + linker->SetEntryPointsToInterpreter(meth); + } + } + osr_code_map_.clear(); + VLOG(jit) << "Invalidated the compiled code of " << (cnt - osr_size) << " methods and " + << osr_size << " OSRs."; +} + void JitCodeCache::InvalidateCompiledCodeFor(ArtMethod* method, const OatQuickMethodHeader* header) { DCHECK(!method->IsNative()); |