diff options
author | 2017-02-03 09:04:49 +0000 | |
---|---|---|
committer | 2017-02-03 09:04:50 +0000 | |
commit | 3f50d3cda19792d3ac0137e59300b43c542e7dca (patch) | |
tree | 43bbe84313ac903182e5e521b854d05a0f5f4f0b /compiler/optimizing/optimizing_compiler.cc | |
parent | 05dfc65a594abe0aeac44bf8b82e381e25eb61d9 (diff) | |
parent | f290c01c61f8a2979efa74ffcd2f54c5e426a3d0 (diff) |
Merge "Inline across dex files for JIT."
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 1ab671022b..d970e0126f 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1133,6 +1133,26 @@ bool IsCompilingWithCoreImage() { return false; } +bool EncodeArtMethodInInlineInfo(ArtMethod* method ATTRIBUTE_UNUSED) { + // Note: the runtime is null only for unit testing. + return Runtime::Current() == nullptr || !Runtime::Current()->IsAotCompiler(); +} + +bool CanEncodeInlinedMethodInStackMap(const DexFile& caller_dex_file, ArtMethod* callee) { + ScopedObjectAccess soa(Thread::Current()); + if (!Runtime::Current()->IsAotCompiler()) { + // JIT can always encode methods in stack maps. + return true; + } + if (IsSameDexFile(caller_dex_file, *callee->GetDexFile())) { + return true; + } + // TODO(ngeoffray): Support more AOT cases for inlining: + // - methods in multidex + // - methods in boot image for on-device non-PIC compilation. + return false; +} + bool OptimizingCompiler::JitCompile(Thread* self, jit::JitCodeCache* code_cache, ArtMethod* method, |