Fix interaction between JIT and instrumentation.
- The JIT needs to go through the instrumentation to update
entry points.
- The instrumention needs to know if a method got JITted
to know if needs to deoptimize.
bug:25438583
Change-Id: I4b186a1da9f4a3fb329efd052a774d5502a902a1
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index afff657..131446c 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -83,6 +83,9 @@
// Return true if the code cache contains this pc.
bool ContainsPc(const void* pc) const;
+ // Return true if the code cache contains this method.
+ bool ContainsMethod(ArtMethod* method) REQUIRES(!lock_);
+
// Reserve a region of data of size at least "size". Returns null if there is no more room.
uint8_t* ReserveData(Thread* self, size_t size)
SHARED_REQUIRES(Locks::mutator_lock_)
@@ -163,6 +166,12 @@
// Free in the mspace allocations taken by 'method'.
void FreeCode(const void* code_ptr, ArtMethod* method) REQUIRES(lock_);
+ // Number of bytes allocated in the code cache.
+ size_t CodeCacheSizeLocked() REQUIRES(lock_);
+
+ // Number of bytes allocated in the data cache.
+ size_t DataCacheSizeLocked() REQUIRES(lock_);
+
// Lock for guarding allocations, collections, and the method_code_map_.
Mutex lock_;
// Condition to wait on during collection.