diff options
author | 2015-12-17 14:57:09 +0000 | |
---|---|---|
committer | 2016-01-28 15:55:46 +0000 | |
commit | a42363f79832a6e14f348514664dc6dc3edf9da2 (patch) | |
tree | bcd43acdf9903a704b566af00b5c740786284b7b /runtime/jit/jit_code_cache.cc | |
parent | 9cea9139033a4d04437ebc5542e9466fd67137fe (diff) |
Implement first kind of polymorphic inlining.
Add HClassTableGet to fetch an ArtMethod from the vtable or imt,
and compare it to the only method the profiling saw.
Change-Id: I76afd3689178f10e3be048aa3ac9a97c6f63295d
Diffstat (limited to 'runtime/jit/jit_code_cache.cc')
-rw-r--r-- | runtime/jit/jit_code_cache.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc index 64b2c899aa..a6909d839f 100644 --- a/runtime/jit/jit_code_cache.cc +++ b/runtime/jit/jit_code_cache.cc @@ -737,8 +737,16 @@ bool JitCodeCache::NotifyCompilationOf(ArtMethod* method, Thread* self) { if (ContainsPc(method->GetEntryPointFromQuickCompiledCode())) { return false; } - MutexLock mu(self, lock_); + + // Compiling requires a profiling info object to notify compilation. Create + // one if it hasn't been done before. ProfilingInfo* info = method->GetProfilingInfo(sizeof(void*)); + if (info == nullptr) { + ProfilingInfo::Create(self, method, /* retry_allocation */ true); + } + + MutexLock mu(self, lock_); + info = method->GetProfilingInfo(sizeof(void*)); if (info == nullptr || info->IsMethodBeingCompiled()) { return false; } |