From f290c01c61f8a2979efa74ffcd2f54c5e426a3d0 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 27 Jan 2017 23:09:22 +0000 Subject: Inline across dex files for JIT. bug:30933338 test: ART_TEST_JIT=true test-art-host test-art-target Change-Id: I4ac708d70d90c2db4139d99a75bf4665a810c206 --- compiler/optimizing/optimizing_compiler.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 297500b12f..b4c746f2c1 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1129,6 +1129,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, -- cgit v1.2.3-59-g8ed1b