summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2016-06-08 17:41:39 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-06-08 17:41:40 +0000
commit4a85ad8b802ba74b26ed4a5d7c31aadd9046ae96 (patch)
tree206498b27c2fb77c4869c14389a4b192c9c23e00 /compiler/optimizing/instruction_builder.cc
parent5a9ecac3c931f93925c25aa086c39effe12b0759 (diff)
parent296fbb4c3a629ec99149e512ddb66d7b4d7854fe (diff)
Merge "Do not place null check on unresolved method calls."
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 135038b753..f2286e46e6 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -833,7 +833,8 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction,
register_index,
is_range,
descriptor,
- nullptr /* clinit_check */);
+ nullptr, /* clinit_check */
+ true /* is_unresolved */);
}
// Potential class initialization check, in the case of a static method call.
@@ -898,7 +899,8 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction,
register_index,
is_range,
descriptor,
- clinit_check);
+ clinit_check,
+ false /* is_unresolved */);
}
bool HInstructionBuilder::BuildNewInstance(uint16_t type_index, uint32_t dex_pc) {
@@ -1091,14 +1093,17 @@ bool HInstructionBuilder::HandleInvoke(HInvoke* invoke,
uint32_t register_index,
bool is_range,
const char* descriptor,
- HClinitCheck* clinit_check) {
+ HClinitCheck* clinit_check,
+ bool is_unresolved) {
DCHECK(!invoke->IsInvokeStaticOrDirect() || !invoke->AsInvokeStaticOrDirect()->IsStringInit());
size_t start_index = 0;
size_t argument_index = 0;
if (invoke->GetOriginalInvokeType() != InvokeType::kStatic) { // Instance call.
- HInstruction* arg = LoadNullCheckedLocal(is_range ? register_index : args[0],
- invoke->GetDexPc());
+ uint32_t obj_reg = is_range ? register_index : args[0];
+ HInstruction* arg = is_unresolved
+ ? LoadLocal(obj_reg, Primitive::kPrimNot)
+ : LoadNullCheckedLocal(obj_reg, invoke->GetDexPc());
invoke->SetArgumentAt(0, arg);
start_index = 1;
argument_index = 1;