summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2018-02-15 12:29:06 +0000
committerNicolas Geoffray <ngeoffray@google.com>2018-02-15 12:29:06 +0000
commitf665f847744aef65f8d4ad46cbf410f911dbfb25 (patch)
tree85dbb3ea7f3f4b1d0c2464e705710b3d081e4124 /compiler/optimizing/instruction_builder.cc
parent6177ead17f46ec15ef024e50887ab12feafd7d6e (diff)
Pass the right dex_file/method_index for String.<init>.
Passing the dex file of the caller in instruction_builder.cc was problematic as this information get lost at the point of RTP. test: test.py Change-Id: I3f620b931544a538386d23c2456b182b3ed41091
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 64a1eccf60..a38e2717cf 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -960,14 +960,18 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction,
HInvokeStaticOrDirect::CodePtrLocation::kCallArtMethod,
dchecked_integral_cast<uint64_t>(string_init_entry_point)
};
- MethodReference target_method(dex_file_, method_idx);
+ ScopedObjectAccess soa(Thread::Current());
+ MethodReference target_method(resolved_method->GetDexFile(),
+ resolved_method->GetDexMethodIndex());
+ // We pass null for the resolved_method to ensure optimizations
+ // don't rely on it.
HInvoke* invoke = new (allocator_) HInvokeStaticOrDirect(
allocator_,
number_of_arguments - 1,
DataType::Type::kReference /*return_type */,
dex_pc,
method_idx,
- nullptr,
+ nullptr /* resolved_method */,
dispatch_info,
invoke_type,
target_method,