diff options
| author | Vladimir Marko <vmarko@google.com> | 2017-07-25 13:26:39 +0100 |
|---|---|---|
| committer | Vladimir Marko <vmarko@google.com> | 2017-09-07 17:52:35 +0100 |
| commit | 6cfbdbc359ec5414d3e49f70d28f8c0e65b98d63 (patch) | |
| tree | f92b309ddc43c2254b6067346a653170fbbf7316 /compiler/optimizing/code_generator_arm_vixl.h | |
| parent | 0f3c7003e08a42a4ed8c9f8dfffb1bee1118de59 (diff) | |
| download | art-6cfbdbc359ec5414d3e49f70d28f8c0e65b98d63.tar.gz art-6cfbdbc359ec5414d3e49f70d28f8c0e65b98d63.tar.bz2 art-6cfbdbc359ec5414d3e49f70d28f8c0e65b98d63.zip | |
Use mmapped boot image intern table for PIC app HLoadString.
Implement new HLoadString load kind for boot image strings
referenced by PIC-compiled apps (i.e. prebuilts) that uses
PC-relative load from a boot image InternTable mmapped into
the apps .bss. This reduces the size of the PIC prebuilts
that reference boot image strings compared to the kBssEntry
as we can completely avoid the slow path and stack map.
We separate the InternedStrings and ClassTable sections of
the boot image (.art) file from the rest, aligning the
start of the InternedStrings section to a page boundary.
This may actually increase the size of the boot image file
by a page but it also allows mprotecting() these tables as
read-only. The ClassTable section is included in
anticipation of a similar load kind for HLoadClass.
Prebuilt services.odex for aosp_angler-userdebug (arm64):
- before: 20862776
- after: 20308512 (-541KiB)
Note that 92KiB savings could have been achieved by simply
avoiding the read barrier, similar to the HLoadClass flag
IsInBootImage(). Such flag is now unnecessary.
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: testrunner.py --host --pictest
Test: testrunner.py --target on Nexus 6P.
Test: testrunner.py --target --pictest on Nexus 6P.
Test: Nexus 6P boots.
Bug: 31951624
Change-Id: I5f2bf1fc0bb36a8483244317cfdfa69e192ef6c5
Diffstat (limited to 'compiler/optimizing/code_generator_arm_vixl.h')
| -rw-r--r-- | compiler/optimizing/code_generator_arm_vixl.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator_arm_vixl.h b/compiler/optimizing/code_generator_arm_vixl.h index 5feb33b1e1..e78bc15614 100644 --- a/compiler/optimizing/code_generator_arm_vixl.h +++ b/compiler/optimizing/code_generator_arm_vixl.h @@ -579,6 +579,8 @@ class CodeGeneratorARMVIXL : public CodeGenerator { PcRelativePatchInfo* NewTypeBssEntryPatch(const DexFile& dex_file, dex::TypeIndex type_index); PcRelativePatchInfo* NewPcRelativeStringPatch(const DexFile& dex_file, dex::StringIndex string_index); + PcRelativePatchInfo* NewStringBssEntryPatch(const DexFile& dex_file, + dex::StringIndex string_index); // Add a new baker read barrier patch and return the label to be bound // before the BNE instruction. @@ -803,8 +805,10 @@ class CodeGeneratorARMVIXL : public CodeGenerator { ArenaDeque<PcRelativePatchInfo> pc_relative_type_patches_; // PC-relative type patch info for kBssEntry. ArenaDeque<PcRelativePatchInfo> type_bss_entry_patches_; - // PC-relative String patch info; type depends on configuration (app .bss or boot image PIC). + // PC-relative String patch info; type depends on configuration (intern table or boot image PIC). ArenaDeque<PcRelativePatchInfo> pc_relative_string_patches_; + // PC-relative String patch info for kBssEntry. + ArenaDeque<PcRelativePatchInfo> string_bss_entry_patches_; // Baker read barrier patch info. ArenaDeque<BakerReadBarrierPatchInfo> baker_read_barrier_patches_; |
