summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2017-03-24 08:59:45 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-03-24 08:59:46 +0000
commitda9f7eb3e7734b58576f71bad6d90aeea112f408 (patch)
treecd837794175dee75b2c5dd253b20daac9efba25d /compiler
parentca32c317eeb989d9cbe330bab6ea35a8fd2ca18f (diff)
parent27ef25f084017421ca05508208f436b5fc11df73 (diff)
Merge "Revert "Revert^4 "CHA for interface method."""
Diffstat (limited to 'compiler')
-rw-r--r--compiler/optimizing/inliner.cc25
1 files changed, 1 insertions, 24 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 9550a53333..62f5114e59 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -292,18 +292,7 @@ ArtMethod* HInliner::TryCHADevirtualization(ArtMethod* resolved_method) {
return nullptr;
}
PointerSize pointer_size = caller_compilation_unit_.GetClassLinker()->GetImagePointerSize();
- ArtMethod* single_impl = resolved_method->GetSingleImplementation(pointer_size);
- if (single_impl == nullptr) {
- return nullptr;
- }
- if (single_impl->IsProxyMethod()) {
- // Proxy method is a generic invoker that's not worth
- // devirtualizing/inlining. It also causes issues when the proxy
- // method is in another dex file if we try to rewrite invoke-interface to
- // invoke-virtual because a proxy method doesn't have a real dex file.
- return nullptr;
- }
- return single_impl;
+ return resolved_method->GetSingleImplementation(pointer_size);
}
bool HInliner::TryInline(HInvoke* invoke_instruction) {
@@ -1032,23 +1021,11 @@ bool HInliner::TryInlineAndReplace(HInvoke* invoke_instruction,
HBasicBlock* bb_cursor = invoke_instruction->GetBlock();
if (!TryBuildAndInline(invoke_instruction, method, receiver_type, &return_replacement)) {
if (invoke_instruction->IsInvokeInterface()) {
- DCHECK(!method->IsProxyMethod());
// Turn an invoke-interface into an invoke-virtual. An invoke-virtual is always
// better than an invoke-interface because:
// 1) In the best case, the interface call has one more indirection (to fetch the IMT).
// 2) We will not go to the conflict trampoline with an invoke-virtual.
// TODO: Consider sharpening once it is not dependent on the compiler driver.
-
- if (method->IsDefault() && !method->IsCopied()) {
- // Changing to invoke-virtual cannot be done on an original default method
- // since it's not in any vtable. Devirtualization by exact type/inline-cache
- // always uses a method in the iftable which is never an original default
- // method.
- // On the other hand, inlining an original default method by CHA is fine.
- DCHECK(cha_devirtualize);
- return false;
- }
-
const DexFile& caller_dex_file = *caller_compilation_unit_.GetDexFile();
uint32_t dex_method_index = FindMethodIndexIn(
method, caller_dex_file, invoke_instruction->GetDexMethodIndex());