summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/jit/jit.cc3
-rw-r--r--runtime/jit/jit_code_cache.cc9
-rw-r--r--runtime/jit/jit_code_cache.h2
3 files changed, 12 insertions, 2 deletions
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index bdc7ee2428..cdf09bf51c 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -63,7 +63,8 @@ void Jit::DumpInfo(std::ostream& os) {
<< "JIT data cache size=" << PrettySize(code_cache_->DataCacheSize()) << "\n"
<< "JIT current capacity=" << PrettySize(code_cache_->GetCurrentCapacity()) << "\n"
<< "JIT number of compiled code=" << code_cache_->NumberOfCompiledCode() << "\n"
- << "JIT total number of compilations=" << code_cache_->NumberOfCompilations() << "\n";
+ << "JIT total number of compilations=" << code_cache_->NumberOfCompilations() << "\n"
+ << "JIT total number of osr compilations=" << code_cache_->NumberOfOsrCompilations() << "\n";
cumulative_timings_.Dump(os);
}
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 478b164597..8858b486f9 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -128,7 +128,8 @@ JitCodeCache::JitCodeCache(MemMap* code_map,
garbage_collect_code_(garbage_collect_code),
used_memory_for_data_(0),
used_memory_for_code_(0),
- number_of_compilations_(0) {
+ number_of_compilations_(0),
+ number_of_osr_compilations_(0) {
DCHECK_GE(max_capacity, initial_code_capacity + initial_data_capacity);
code_mspace_ = create_mspace_with_base(code_map_->Begin(), code_end_, false /*locked*/);
@@ -338,6 +339,7 @@ uint8_t* JitCodeCache::CommitCodeInternal(Thread* self,
MutexLock mu(self, lock_);
method_code_map_.Put(code_ptr, method);
if (osr) {
+ number_of_osr_compilations_++;
osr_code_map_.Put(method, code_ptr);
} else {
Runtime::Current()->GetInstrumentation()->UpdateMethodsCode(
@@ -366,6 +368,11 @@ size_t JitCodeCache::NumberOfCompilations() {
return number_of_compilations_;
}
+size_t JitCodeCache::NumberOfOsrCompilations() {
+ MutexLock mu(Thread::Current(), lock_);
+ return number_of_osr_compilations_;
+}
+
size_t JitCodeCache::CodeCacheSize() {
MutexLock mu(Thread::Current(), lock_);
return CodeCacheSizeLocked();
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index e5b8e6ca17..4574edfb46 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -73,6 +73,7 @@ class JitCodeCache {
// Number of compilations done throughout the lifetime of the JIT.
size_t NumberOfCompilations() REQUIRES(!lock_);
+ size_t NumberOfOsrCompilations() REQUIRES(!lock_);
bool NotifyCompilationOf(ArtMethod* method, Thread* self, bool osr)
SHARED_REQUIRES(Locks::mutator_lock_)
@@ -304,6 +305,7 @@ class JitCodeCache {
// Number of compilations done throughout the lifetime of the JIT.
size_t number_of_compilations_ GUARDED_BY(lock_);
+ size_t number_of_osr_compilations_ GUARDED_BY(lock_);
DISALLOW_IMPLICIT_CONSTRUCTORS(JitCodeCache);
};