diff options
author | 2017-02-06 11:53:53 +0000 | |
---|---|---|
committer | 2017-02-06 11:53:54 +0000 | |
commit | 85bd7a37139bf79ee664777db079b86a7105dac8 (patch) | |
tree | c000e4944ba096f9794b5a31a2fc75c56d7db775 /compiler/optimizing/optimizing_compiler.cc | |
parent | f85fc6bd9d65ef4689d6af797adb889da8cf15e3 (diff) | |
parent | fbdfa6d7485534eedbd3fb32cf572529ebddb63c (diff) |
Merge "Revert "Revert "Inline across dex files for JIT."""
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 4bc6ff1b65..727ca7d893 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1134,6 +1134,25 @@ 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) { + 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, |