summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2016-03-30 13:23:58 +0100
committerVladimir Marko <vmarko@google.com>2016-06-21 15:11:57 +0100
commitdbb7f5bef10138ade0fb202da1d61f562b2df649 (patch)
treef0aa4b390c534b215a6e000c865783cdd9852353 /compiler/optimizing/instruction_builder.cc
parentb94b5706f0b8e2e1c7e1db22274f9f4bae0c4b5a (diff)
Improve HLoadClass code generation.
For classes in the boot image, use either direct pointers or PC-relative addresses. For other classes, use PC-relative access to the dex cache arrays for AOT and direct address of the type's dex cache slot for JIT. For aosp_flounder-userdebug: - 32-bit boot.oat: -252KiB (-0.3%) - 64-bit boot.oat: -412KiB (-0.4%) - 32-bit dalvik cache total: -392KiB (-0.4%) - 64-bit dalvik-cache total: -2312KiB (-1.0%) (contains more files than the 32-bit dalvik cache) For aosp_flounder-userdebug forced to compile PIC: - 32-bit boot.oat: -124KiB (-0.2%) - 64-bit boot.oat: -420KiB (-0.5%) - 32-bit dalvik cache total: -136KiB (-0.1%) - 64-bit dalvik-cache total: -1136KiB (-0.5%) (contains more files than the 32-bit dalvik cache) Bug: 27950288 Change-Id: I4da991a4b7e53c63c92558b97923d18092acf139
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 1c67bcc878..afac5f9cf1 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -934,7 +934,7 @@ bool HInstructionBuilder::BuildNewInstance(uint16_t type_index, uint32_t dex_pc)
IsOutermostCompilingClass(type_index),
dex_pc,
needs_access_check,
- compiler_driver_->CanAssumeTypeIsPresentInDexCache(outer_dex_cache, type_index));
+ /* is_in_dex_cache */ false);
AppendInstruction(load_class);
HInstruction* cls = load_class;
@@ -1025,7 +1025,7 @@ HClinitCheck* HInstructionBuilder::ProcessClinitCheckForInvoke(
is_outer_class,
dex_pc,
/*needs_access_check*/ false,
- compiler_driver_->CanAssumeTypeIsPresentInDexCache(outer_dex_cache, storage_index));
+ /* is_in_dex_cache */ false);
AppendInstruction(load_class);
clinit_check = new (arena_) HClinitCheck(load_class, dex_pc);
AppendInstruction(clinit_check);
@@ -1377,15 +1377,13 @@ bool HInstructionBuilder::BuildStaticFieldAccess(const Instruction& instruction,
}
}
- bool is_in_cache =
- compiler_driver_->CanAssumeTypeIsPresentInDexCache(outer_dex_cache, storage_index);
HLoadClass* constant = new (arena_) HLoadClass(graph_->GetCurrentMethod(),
storage_index,
outer_dex_file,
is_outer_class,
dex_pc,
/*needs_access_check*/ false,
- is_in_cache);
+ /* is_in_dex_cache */ false);
AppendInstruction(constant);
HInstruction* cls = constant;
@@ -1654,7 +1652,7 @@ void HInstructionBuilder::BuildTypeCheck(const Instruction& instruction,
IsOutermostCompilingClass(type_index),
dex_pc,
!can_access,
- compiler_driver_->CanAssumeTypeIsPresentInDexCache(dex_cache, type_index));
+ /* is_in_dex_cache */ false);
AppendInstruction(cls);
TypeCheckKind check_kind = ComputeTypeCheckKind(resolved_class);
@@ -2622,8 +2620,6 @@ bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction,
Handle<mirror::DexCache> dex_cache = dex_compilation_unit_->GetDexCache();
bool can_access = compiler_driver_->CanAccessTypeWithoutChecks(
dex_compilation_unit_->GetDexMethodIndex(), dex_cache, type_index);
- bool is_in_dex_cache =
- compiler_driver_->CanAssumeTypeIsPresentInDexCache(dex_cache, type_index);
AppendInstruction(new (arena_) HLoadClass(
graph_->GetCurrentMethod(),
type_index,
@@ -2631,7 +2627,7 @@ bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction,
IsOutermostCompilingClass(type_index),
dex_pc,
!can_access,
- is_in_dex_cache));
+ /* is_in_dex_cache */ false));
UpdateLocal(instruction.VRegA_21c(), current_block_->GetLastInstruction());
break;
}