summaryrefslogtreecommitdiff
path: root/compiler/optimizing/inliner.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-03-26 10:05:54 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-03-26 10:05:54 +0000
commit790412959a6413a585f45fc5f77fe7106311a00c (patch)
tree94d7d6016c5a58d6c5f31d8350330c8025baa014 /compiler/optimizing/inliner.cc
parent9ed05c4cf76aaeee48a1eb5bbae659b0acbabe67 (diff)
Use the original invoke type when inlining.
When resolving a method through the compiler driver, the code makes sure the call in the DEX bytecode matches the kind of method found, to check for IncompatibleClassChangeError. Because when we sharpen an invoke virtual, we transform the invoke kind to direct, we must not use the new kind, but the one in DEX. Change-Id: Iaf77b27b529c659ea48ffb19f46427552c9e3654
Diffstat (limited to 'compiler/optimizing/inliner.cc')
-rw-r--r--compiler/optimizing/inliner.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 256e85b6ce..4b990f1ddd 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -50,7 +50,9 @@ void HInliner::Run() {
HInstruction* next = instruction->GetNext();
HInvokeStaticOrDirect* call = instruction->AsInvokeStaticOrDirect();
if (call != nullptr) {
- if (!TryInline(call, call->GetDexMethodIndex(), call->GetInvokeType())) {
+ // We use the original invoke type to ensure the resolution of the called method
+ // works properly.
+ if (!TryInline(call, call->GetDexMethodIndex(), call->GetOriginalInvokeType())) {
if (kIsDebugBuild) {
std::string callee_name =
PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile());