From 20f85597828194c12be10d3a927999def066555e Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 19 Mar 2015 10:07:02 +0000 Subject: Fixed layout for dex caches in boot image. Define a fixed layout for dex cache arrays (type, method, string and field arrays) for dex caches in the boot image. This gives those arrays fixed offsets from the boot image code and allows PC-relative addressing of their elements. Use the PC-relative load on arm64 for relevant instructions, i.e. invoke-static, invoke-direct, const-string, const-class, check-cast and instance-of. This reduces the arm64 boot.oat on Nexus 9 by 1.1MiB. This CL provides the infrastructure and shows on the arm64 the gains that we can achieve by having fixed dex cache arrays' layout. To fully use this for the boot images, we need to implement the PC-relative addressing for other architectures. To achieve similar gains for apps, we need to move the dex cache arrays to a .bss section of the oat file. These changes will be implemented in subsequent CLs. (Also remove some compiler_driver.h dependencies to reduce incremental build times.) Change-Id: Ib1859fa4452d01d983fd92ae22b611f45a85d69b --- compiler/driver/compiler_driver.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index b825293c33..efcaae4cdd 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -26,11 +26,8 @@ #include "base/mutex.h" #include "base/timing_logger.h" #include "class_reference.h" -#include "compiled_method.h" #include "compiler.h" #include "dex_file.h" -#include "dex/verified_method.h" -#include "driver/compiler_options.h" #include "invoke_type.h" #include "method_reference.h" #include "mirror/class.h" // For mirror::Class::Status. @@ -39,7 +36,9 @@ #include "runtime.h" #include "safe_map.h" #include "thread_pool.h" +#include "utils/array_ref.h" #include "utils/dedupe_set.h" +#include "utils/dex_cache_arrays_layout.h" #include "utils/swap_space.h" #include "utils.h" @@ -54,6 +53,7 @@ class MethodVerifier; } // namespace verifier class CompiledClass; +class CompiledMethod; class CompilerOptions; class DexCompilationUnit; class DexFileToMethodInlinerMap; @@ -62,6 +62,9 @@ class InstructionSetFeatures; class OatWriter; class ParallelCompilationManager; class ScopedObjectAccess; +template class SrcMap; +class SrcMapElem; +using SwapSrcMap = SrcMap>; template class Handle; class TimingLogger; class VerificationResults; @@ -318,6 +321,10 @@ class CompilerDriver { bool IsMethodsClassInitialized(mirror::Class* referrer_class, mirror::ArtMethod* resolved_method) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + // Get the layout of dex cache arrays for a dex file. Returns invalid layout if the + // dex cache arrays don't have a fixed layout. + DexCacheArraysLayout GetDexCacheArraysLayout(const DexFile* dex_file); + void ProcessedInstanceField(bool resolved); void ProcessedStaticField(bool resolved, bool local); void ProcessedInvoke(InvokeType invoke_type, int flags); -- cgit v1.2.3-59-g8ed1b