From fbdfa6d7485534eedbd3fb32cf572529ebddb63c Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 3 Feb 2017 10:43:13 +0000 Subject: Revert "Revert "Inline across dex files for JIT."" bug:30933338 This reverts commit d16da8bd8106452eea82408748dc6b3fd64bcb80. Change-Id: I6a30354d6d00442cb1a542af063c7769865e369d --- compiler/optimizing/optimizing_compiler.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 1ab671022b..419aa5d498 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1133,6 +1133,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, -- cgit v1.2.3-59-g8ed1b