summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-09-06 17:21:03 +0100
committer Vladimir Marko <vmarko@google.com> 2017-09-11 15:12:51 +0100
commit94ec2db21332ee1dcdbbf254b99a9a999a304fe0 (patch)
tree6ced7e596731b61f95a3693f336527f55ea3cf3a /compiler/optimizing/nodes.h
parent6cfbdbc359ec5414d3e49f70d28f8c0e65b98d63 (diff)
Use mmapped boot image class table for PIC app HLoadClass.
Implement new HLoadClass load kind for boot image classes referenced by PIC-compiled apps (i.e. prebuilts) that uses PC-relative load from a boot image ClassTable mmapped into the apps .bss. This reduces the size of the PIC prebuilts that reference boot image classes compared to the kBssEntry as we can completely avoid the slow path and stack map unless we need to do the class initialization check. Prebuilt services.odex for aosp_angler-userdebug (arm64): - before: 20312800 - after: 19775352 (-525KiB) 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: I13adb19a1fa7d095a72a41f09daa6101876e77a8
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 5e8c77102a..b551f37135 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -5675,6 +5675,10 @@ class HLoadClass FINAL : public HInstruction {
// Used for boot image classes referenced by apps in AOT- and JIT-compiled code.
kBootImageAddress,
+ // Use a PC-relative load from a boot image ClassTable mmapped into the .bss
+ // of the oat file.
+ kBootImageClassTable,
+
// Load from an entry in the .bss section using a PC-relative load.
// Used for classes outside boot image when .bss is accessible with a PC-relative load.
kBssEntry,
@@ -5820,6 +5824,7 @@ class HLoadClass FINAL : public HInstruction {
static bool HasTypeReference(LoadKind load_kind) {
return load_kind == LoadKind::kReferrersClass ||
load_kind == LoadKind::kBootImageLinkTimePcRelative ||
+ load_kind == LoadKind::kBootImageClassTable ||
load_kind == LoadKind::kBssEntry ||
load_kind == LoadKind::kRuntimeCall;
}
@@ -5853,6 +5858,7 @@ inline void HLoadClass::AddSpecialInput(HInstruction* special_input) {
// including literal pool loads, which are PC-relative too.
DCHECK(GetLoadKind() == LoadKind::kBootImageLinkTimePcRelative ||
GetLoadKind() == LoadKind::kBootImageAddress ||
+ GetLoadKind() == LoadKind::kBootImageClassTable ||
GetLoadKind() == LoadKind::kBssEntry) << GetLoadKind();
DCHECK(special_input_.GetInstruction() == nullptr);
special_input_ = HUserRecord<HInstruction*>(special_input);