Revert "Revert "Revert "Revert "Basic obsolete methods support""""
A GetDeclaringClass()->GetDexCache() got inserted during the
merge/review process meaning that we would try to access incorrect
dex-cache in obsolete methods in some situations.
Also when using tracing we would loop forever (or at least until an
OOM error) in test 916 due to tracing forcing InterpretOnly mode
meaning methods would never be jitted.
Bug: 32369913
Bug: 33630159
Test: ART_TEST_TRACE=true \
ART_TEST_JIT=true \
ART_TEST_INTERPRETER=true mma -j40 test-art-host
This reverts commit f6abcda293b115a9d7d8a26376ea2dcf2d1dc510.
Change-Id: I0773bfcba52e3cd51a83be815c6a50c189558f48
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index d97742d..b5e3176 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -75,6 +75,10 @@
REQUIRES_SHARED(Locks::mutator_lock_)
REQUIRES(!lock_);
+ void NotifyMethodRedefined(ArtMethod* method)
+ REQUIRES(Locks::mutator_lock_)
+ REQUIRES(!lock_);
+
// Notify to the code cache that the compiler wants to use the
// profiling info of `method` to drive optimizations,
// and therefore ensure the returned profiling info object is not
@@ -219,6 +223,11 @@
void DisallowInlineCacheAccess() REQUIRES(!lock_);
void BroadcastForInlineCacheAccess() REQUIRES(!lock_);
+ // Notify the code cache that the method at the pointer 'old_method' is being moved to the pointer
+ // 'new_method' since it is being made obsolete.
+ void MoveObsoleteMethod(ArtMethod* old_method, ArtMethod* new_method)
+ REQUIRES(!lock_) REQUIRES(Locks::mutator_lock_);
+
private:
// Take ownership of maps.
JitCodeCache(MemMap* code_map,