Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "inliner.h" |
| 18 | |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 19 | #include "art_method-inl.h" |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 20 | #include "builder.h" |
| 21 | #include "class_linker.h" |
| 22 | #include "constant_folding.h" |
| 23 | #include "dead_code_elimination.h" |
| 24 | #include "driver/compiler_driver-inl.h" |
Calin Juravle | ec74835 | 2015-07-29 13:52:12 +0100 | [diff] [blame] | 25 | #include "driver/compiler_options.h" |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 26 | #include "driver/dex_compilation_unit.h" |
| 27 | #include "instruction_simplifier.h" |
Scott Wakeling | d60a1af | 2015-07-22 14:32:44 +0100 | [diff] [blame] | 28 | #include "intrinsics.h" |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 29 | #include "mirror/class_loader.h" |
| 30 | #include "mirror/dex_cache.h" |
| 31 | #include "nodes.h" |
Nicolas Geoffray | 335005e | 2015-06-25 10:01:47 +0100 | [diff] [blame] | 32 | #include "optimizing_compiler.h" |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 33 | #include "reference_type_propagation.h" |
Nicolas Geoffray | 259136f | 2014-12-17 23:21:58 +0000 | [diff] [blame] | 34 | #include "register_allocator.h" |
Vladimir Marko | dc151b2 | 2015-10-15 18:02:30 +0100 | [diff] [blame^] | 35 | #include "sharpening.h" |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 36 | #include "ssa_phi_elimination.h" |
| 37 | #include "scoped_thread_state_change.h" |
| 38 | #include "thread.h" |
Calin Juravle | f1c6d9e | 2015-04-13 18:42:21 +0100 | [diff] [blame] | 39 | #include "dex/verified_method.h" |
| 40 | #include "dex/verification_results.h" |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 41 | |
| 42 | namespace art { |
| 43 | |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 44 | static constexpr size_t kMaximumNumberOfHInstructions = 12; |
| 45 | |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 46 | void HInliner::Run() { |
Calin Juravle | 8f96df8 | 2015-07-29 15:58:48 +0100 | [diff] [blame] | 47 | const CompilerOptions& compiler_options = compiler_driver_->GetCompilerOptions(); |
| 48 | if ((compiler_options.GetInlineDepthLimit() == 0) |
| 49 | || (compiler_options.GetInlineMaxCodeUnits() == 0)) { |
| 50 | return; |
| 51 | } |
Nicolas Geoffray | e50b8d2 | 2015-03-13 08:57:42 +0000 | [diff] [blame] | 52 | if (graph_->IsDebuggable()) { |
| 53 | // For simplicity, we currently never inline when the graph is debuggable. This avoids |
| 54 | // doing some logic in the runtime to discover if a method could have been inlined. |
| 55 | return; |
| 56 | } |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 57 | const ArenaVector<HBasicBlock*>& blocks = graph_->GetReversePostOrder(); |
| 58 | DCHECK(!blocks.empty()); |
| 59 | HBasicBlock* next_block = blocks[0]; |
| 60 | for (size_t i = 0; i < blocks.size(); ++i) { |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 61 | // Because we are changing the graph when inlining, we need to remember the next block. |
| 62 | // This avoids doing the inlining work again on the inlined blocks. |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 63 | if (blocks[i] != next_block) { |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 64 | continue; |
| 65 | } |
| 66 | HBasicBlock* block = next_block; |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 67 | next_block = (i == blocks.size() - 1) ? nullptr : blocks[i + 1]; |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 68 | for (HInstruction* instruction = block->GetFirstInstruction(); instruction != nullptr;) { |
| 69 | HInstruction* next = instruction->GetNext(); |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 70 | HInvoke* call = instruction->AsInvoke(); |
Razvan A Lupusoru | 3e90a96 | 2015-03-27 13:44:44 -0700 | [diff] [blame] | 71 | // As long as the call is not intrinsified, it is worth trying to inline. |
| 72 | if (call != nullptr && call->GetIntrinsic() == Intrinsics::kNone) { |
Nicolas Geoffray | 7904129 | 2015-03-26 10:05:54 +0000 | [diff] [blame] | 73 | // We use the original invoke type to ensure the resolution of the called method |
| 74 | // works properly. |
Vladimir Marko | 5815501 | 2015-08-19 12:49:41 +0000 | [diff] [blame] | 75 | if (!TryInline(call)) { |
Nicolas Geoffray | 335005e | 2015-06-25 10:01:47 +0100 | [diff] [blame] | 76 | if (kIsDebugBuild && IsCompilingWithCoreImage()) { |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 77 | std::string callee_name = |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 78 | PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile()); |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 79 | bool should_inline = callee_name.find("$inline$") != std::string::npos; |
| 80 | CHECK(!should_inline) << "Could not inline " << callee_name; |
| 81 | } |
Guillaume "Vermeille" Sanchez | e918d38 | 2015-06-03 15:32:41 +0100 | [diff] [blame] | 82 | } else { |
Nicolas Geoffray | 335005e | 2015-06-25 10:01:47 +0100 | [diff] [blame] | 83 | if (kIsDebugBuild && IsCompilingWithCoreImage()) { |
Guillaume "Vermeille" Sanchez | e918d38 | 2015-06-03 15:32:41 +0100 | [diff] [blame] | 84 | std::string callee_name = |
| 85 | PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile()); |
| 86 | bool must_not_inline = callee_name.find("$noinline$") != std::string::npos; |
| 87 | CHECK(!must_not_inline) << "Should not have inlined " << callee_name; |
| 88 | } |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 89 | } |
| 90 | } |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 91 | instruction = next; |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 96 | static bool IsMethodOrDeclaringClassFinal(ArtMethod* method) |
Mathieu Chartier | 9044347 | 2015-07-16 20:32:27 -0700 | [diff] [blame] | 97 | SHARED_REQUIRES(Locks::mutator_lock_) { |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 98 | return method->IsFinal() || method->GetDeclaringClass()->IsFinal(); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Given the `resolved_method` looked up in the dex cache, try to find |
| 103 | * the actual runtime target of an interface or virtual call. |
| 104 | * Return nullptr if the runtime target cannot be proven. |
| 105 | */ |
| 106 | static ArtMethod* FindVirtualOrInterfaceTarget(HInvoke* invoke, ArtMethod* resolved_method) |
Mathieu Chartier | 9044347 | 2015-07-16 20:32:27 -0700 | [diff] [blame] | 107 | SHARED_REQUIRES(Locks::mutator_lock_) { |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 108 | if (IsMethodOrDeclaringClassFinal(resolved_method)) { |
| 109 | // No need to lookup further, the resolved method will be the target. |
| 110 | return resolved_method; |
| 111 | } |
| 112 | |
| 113 | HInstruction* receiver = invoke->InputAt(0); |
| 114 | if (receiver->IsNullCheck()) { |
| 115 | // Due to multiple levels of inlining within the same pass, it might be that |
| 116 | // null check does not have the reference type of the actual receiver. |
| 117 | receiver = receiver->InputAt(0); |
| 118 | } |
| 119 | ReferenceTypeInfo info = receiver->GetReferenceTypeInfo(); |
Calin Juravle | 2e76830 | 2015-07-28 14:41:11 +0000 | [diff] [blame] | 120 | DCHECK(info.IsValid()) << "Invalid RTI for " << receiver->DebugName(); |
| 121 | if (!info.IsExact()) { |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 122 | // We currently only support inlining with known receivers. |
| 123 | // TODO: Remove this check, we should be able to inline final methods |
| 124 | // on unknown receivers. |
| 125 | return nullptr; |
| 126 | } else if (info.GetTypeHandle()->IsInterface()) { |
| 127 | // Statically knowing that the receiver has an interface type cannot |
| 128 | // help us find what is the target method. |
| 129 | return nullptr; |
| 130 | } else if (!resolved_method->GetDeclaringClass()->IsAssignableFrom(info.GetTypeHandle().Get())) { |
| 131 | // The method that we're trying to call is not in the receiver's class or super classes. |
| 132 | return nullptr; |
| 133 | } |
| 134 | |
| 135 | ClassLinker* cl = Runtime::Current()->GetClassLinker(); |
| 136 | size_t pointer_size = cl->GetImagePointerSize(); |
| 137 | if (invoke->IsInvokeInterface()) { |
| 138 | resolved_method = info.GetTypeHandle()->FindVirtualMethodForInterface( |
| 139 | resolved_method, pointer_size); |
| 140 | } else { |
| 141 | DCHECK(invoke->IsInvokeVirtual()); |
| 142 | resolved_method = info.GetTypeHandle()->FindVirtualMethodForVirtual( |
| 143 | resolved_method, pointer_size); |
| 144 | } |
| 145 | |
| 146 | if (resolved_method == nullptr) { |
| 147 | // The information we had on the receiver was not enough to find |
| 148 | // the target method. Since we check above the exact type of the receiver, |
| 149 | // the only reason this can happen is an IncompatibleClassChangeError. |
| 150 | return nullptr; |
| 151 | } else if (resolved_method->IsAbstract()) { |
| 152 | // The information we had on the receiver was not enough to find |
| 153 | // the target method. Since we check above the exact type of the receiver, |
| 154 | // the only reason this can happen is an IncompatibleClassChangeError. |
| 155 | return nullptr; |
| 156 | } else if (IsMethodOrDeclaringClassFinal(resolved_method)) { |
| 157 | // A final method has to be the target method. |
| 158 | return resolved_method; |
| 159 | } else if (info.IsExact()) { |
| 160 | // If we found a method and the receiver's concrete type is statically |
| 161 | // known, we know for sure the target. |
| 162 | return resolved_method; |
| 163 | } else { |
| 164 | // Even if we did find a method, the receiver type was not enough to |
| 165 | // statically find the runtime target. |
| 166 | return nullptr; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | static uint32_t FindMethodIndexIn(ArtMethod* method, |
| 171 | const DexFile& dex_file, |
| 172 | uint32_t referrer_index) |
Mathieu Chartier | 9044347 | 2015-07-16 20:32:27 -0700 | [diff] [blame] | 173 | SHARED_REQUIRES(Locks::mutator_lock_) { |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 174 | if (method->GetDexFile()->GetLocation().compare(dex_file.GetLocation()) == 0) { |
| 175 | return method->GetDexMethodIndex(); |
| 176 | } else { |
| 177 | return method->FindDexMethodIndexInOtherDexFile(dex_file, referrer_index); |
| 178 | } |
| 179 | } |
| 180 | |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 181 | bool HInliner::TryInline(HInvoke* invoke_instruction) { |
Calin Juravle | 175dc73 | 2015-08-25 15:42:32 +0100 | [diff] [blame] | 182 | if (invoke_instruction->IsInvokeUnresolved()) { |
| 183 | return false; // Don't bother to move further if we know the method is unresolved. |
| 184 | } |
| 185 | |
Vladimir Marko | 5815501 | 2015-08-19 12:49:41 +0000 | [diff] [blame] | 186 | uint32_t method_index = invoke_instruction->GetDexMethodIndex(); |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 187 | ScopedObjectAccess soa(Thread::Current()); |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 188 | const DexFile& caller_dex_file = *caller_compilation_unit_.GetDexFile(); |
| 189 | VLOG(compiler) << "Try inlining " << PrettyMethod(method_index, caller_dex_file); |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 190 | |
Nicolas Geoffray | 3507105 | 2015-06-09 15:43:38 +0100 | [diff] [blame] | 191 | ClassLinker* class_linker = caller_compilation_unit_.GetClassLinker(); |
| 192 | // We can query the dex cache directly. The verifier has populated it already. |
Vladimir Marko | 5815501 | 2015-08-19 12:49:41 +0000 | [diff] [blame] | 193 | ArtMethod* resolved_method; |
| 194 | if (invoke_instruction->IsInvokeStaticOrDirect()) { |
| 195 | MethodReference ref = invoke_instruction->AsInvokeStaticOrDirect()->GetTargetMethod(); |
Mathieu Chartier | 736b560 | 2015-09-02 14:54:11 -0700 | [diff] [blame] | 196 | mirror::DexCache* const dex_cache = (&caller_dex_file == ref.dex_file) |
| 197 | ? caller_compilation_unit_.GetDexCache().Get() |
| 198 | : class_linker->FindDexCache(soa.Self(), *ref.dex_file); |
| 199 | resolved_method = dex_cache->GetResolvedMethod( |
Vladimir Marko | 5815501 | 2015-08-19 12:49:41 +0000 | [diff] [blame] | 200 | ref.dex_method_index, class_linker->GetImagePointerSize()); |
| 201 | } else { |
Mathieu Chartier | 736b560 | 2015-09-02 14:54:11 -0700 | [diff] [blame] | 202 | resolved_method = caller_compilation_unit_.GetDexCache().Get()->GetResolvedMethod( |
Vladimir Marko | 5815501 | 2015-08-19 12:49:41 +0000 | [diff] [blame] | 203 | method_index, class_linker->GetImagePointerSize()); |
| 204 | } |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 205 | |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 206 | if (resolved_method == nullptr) { |
Calin Juravle | 175dc73 | 2015-08-25 15:42:32 +0100 | [diff] [blame] | 207 | // TODO: Can this still happen? |
Nicolas Geoffray | 3507105 | 2015-06-09 15:43:38 +0100 | [diff] [blame] | 208 | // Method cannot be resolved if it is in another dex file we do not have access to. |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 209 | VLOG(compiler) << "Method cannot be resolved " << PrettyMethod(method_index, caller_dex_file); |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 210 | return false; |
| 211 | } |
| 212 | |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 213 | if (!invoke_instruction->IsInvokeStaticOrDirect()) { |
| 214 | resolved_method = FindVirtualOrInterfaceTarget(invoke_instruction, resolved_method); |
| 215 | if (resolved_method == nullptr) { |
| 216 | VLOG(compiler) << "Interface or virtual call to " |
| 217 | << PrettyMethod(method_index, caller_dex_file) |
| 218 | << " could not be statically determined"; |
| 219 | return false; |
| 220 | } |
| 221 | // We have found a method, but we need to find where that method is for the caller's |
| 222 | // dex file. |
| 223 | method_index = FindMethodIndexIn(resolved_method, caller_dex_file, method_index); |
| 224 | if (method_index == DexFile::kDexNoIndex) { |
| 225 | VLOG(compiler) << "Interface or virtual call to " |
| 226 | << PrettyMethod(resolved_method) |
| 227 | << " cannot be inlined because unaccessible to caller"; |
| 228 | return false; |
| 229 | } |
| 230 | } |
| 231 | |
Vladimir Marko | 5815501 | 2015-08-19 12:49:41 +0000 | [diff] [blame] | 232 | bool same_dex_file = |
| 233 | IsSameDexFile(*outer_compilation_unit_.GetDexFile(), *resolved_method->GetDexFile()); |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 234 | |
| 235 | const DexFile::CodeItem* code_item = resolved_method->GetCodeItem(); |
| 236 | |
| 237 | if (code_item == nullptr) { |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 238 | VLOG(compiler) << "Method " << PrettyMethod(method_index, caller_dex_file) |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 239 | << " is not inlined because it is native"; |
| 240 | return false; |
| 241 | } |
| 242 | |
Calin Juravle | ec74835 | 2015-07-29 13:52:12 +0100 | [diff] [blame] | 243 | size_t inline_max_code_units = compiler_driver_->GetCompilerOptions().GetInlineMaxCodeUnits(); |
| 244 | if (code_item->insns_size_in_code_units_ > inline_max_code_units) { |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 245 | VLOG(compiler) << "Method " << PrettyMethod(method_index, caller_dex_file) |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 246 | << " is too big to inline"; |
| 247 | return false; |
| 248 | } |
| 249 | |
| 250 | if (code_item->tries_size_ != 0) { |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 251 | VLOG(compiler) << "Method " << PrettyMethod(method_index, caller_dex_file) |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 252 | << " is not inlined because of try block"; |
| 253 | return false; |
| 254 | } |
| 255 | |
Nicolas Geoffray | 481303b | 2015-10-02 12:38:40 +0100 | [diff] [blame] | 256 | if (!resolved_method->GetDeclaringClass()->IsVerified()) { |
Nicolas Geoffray | ccc6197 | 2015-10-01 14:34:20 +0100 | [diff] [blame] | 257 | uint16_t class_def_idx = resolved_method->GetDeclaringClass()->GetDexClassDefIndex(); |
| 258 | if (!compiler_driver_->IsMethodVerifiedWithoutFailures( |
| 259 | resolved_method->GetDexMethodIndex(), class_def_idx, *resolved_method->GetDexFile())) { |
| 260 | VLOG(compiler) << "Method " << PrettyMethod(method_index, caller_dex_file) |
| 261 | << " couldn't be verified, so it cannot be inlined"; |
| 262 | return false; |
| 263 | } |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 264 | } |
| 265 | |
Roland Levillain | 4c0eb42 | 2015-04-24 16:43:49 +0100 | [diff] [blame] | 266 | if (invoke_instruction->IsInvokeStaticOrDirect() && |
| 267 | invoke_instruction->AsInvokeStaticOrDirect()->IsStaticWithImplicitClinitCheck()) { |
| 268 | // Case of a static method that cannot be inlined because it implicitly |
| 269 | // requires an initialization check of its declaring class. |
| 270 | VLOG(compiler) << "Method " << PrettyMethod(method_index, caller_dex_file) |
| 271 | << " is not inlined because it is static and requires a clinit" |
| 272 | << " check that cannot be emitted due to Dex cache limitations"; |
| 273 | return false; |
| 274 | } |
| 275 | |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 276 | if (!TryBuildAndInline(resolved_method, invoke_instruction, same_dex_file)) { |
Nicolas Geoffray | c0365b1 | 2015-03-18 18:31:52 +0000 | [diff] [blame] | 277 | return false; |
| 278 | } |
| 279 | |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 280 | VLOG(compiler) << "Successfully inlined " << PrettyMethod(method_index, caller_dex_file); |
Nicolas Geoffray | c0365b1 | 2015-03-18 18:31:52 +0000 | [diff] [blame] | 281 | MaybeRecordStat(kInlinedInvoke); |
| 282 | return true; |
| 283 | } |
| 284 | |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 285 | bool HInliner::TryBuildAndInline(ArtMethod* resolved_method, |
Nicolas Geoffray | c0365b1 | 2015-03-18 18:31:52 +0000 | [diff] [blame] | 286 | HInvoke* invoke_instruction, |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 287 | bool same_dex_file) { |
Nicolas Geoffray | c0365b1 | 2015-03-18 18:31:52 +0000 | [diff] [blame] | 288 | ScopedObjectAccess soa(Thread::Current()); |
| 289 | const DexFile::CodeItem* code_item = resolved_method->GetCodeItem(); |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 290 | const DexFile& callee_dex_file = *resolved_method->GetDexFile(); |
| 291 | uint32_t method_index = resolved_method->GetDexMethodIndex(); |
Calin Juravle | 2e76830 | 2015-07-28 14:41:11 +0000 | [diff] [blame] | 292 | ClassLinker* class_linker = caller_compilation_unit_.GetClassLinker(); |
Mathieu Chartier | 736b560 | 2015-09-02 14:54:11 -0700 | [diff] [blame] | 293 | Handle<mirror::DexCache> dex_cache(handles_->NewHandle(resolved_method->GetDexCache())); |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 294 | DexCompilationUnit dex_compilation_unit( |
| 295 | nullptr, |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 296 | caller_compilation_unit_.GetClassLoader(), |
Calin Juravle | 2e76830 | 2015-07-28 14:41:11 +0000 | [diff] [blame] | 297 | class_linker, |
Nicolas Geoffray | 8dbf0cf | 2015-08-11 02:14:38 +0000 | [diff] [blame] | 298 | callee_dex_file, |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 299 | code_item, |
| 300 | resolved_method->GetDeclaringClass()->GetDexClassDefIndex(), |
Nicolas Geoffray | 8dbf0cf | 2015-08-11 02:14:38 +0000 | [diff] [blame] | 301 | method_index, |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 302 | resolved_method->GetAccessFlags(), |
Mathieu Chartier | 736b560 | 2015-09-02 14:54:11 -0700 | [diff] [blame] | 303 | compiler_driver_->GetVerifiedMethod(&callee_dex_file, method_index), |
| 304 | dex_cache); |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 305 | |
Calin Juravle | 3cd4fc8 | 2015-05-14 15:15:42 +0100 | [diff] [blame] | 306 | bool requires_ctor_barrier = false; |
| 307 | |
| 308 | if (dex_compilation_unit.IsConstructor()) { |
| 309 | // If it's a super invocation and we already generate a barrier there's no need |
| 310 | // to generate another one. |
| 311 | // We identify super calls by looking at the "this" pointer. If its value is the |
| 312 | // same as the local "this" pointer then we must have a super invocation. |
| 313 | bool is_super_invocation = invoke_instruction->InputAt(0)->IsParameterValue() |
| 314 | && invoke_instruction->InputAt(0)->AsParameterValue()->IsThis(); |
| 315 | if (is_super_invocation && graph_->ShouldGenerateConstructorBarrier()) { |
| 316 | requires_ctor_barrier = false; |
| 317 | } else { |
| 318 | Thread* self = Thread::Current(); |
| 319 | requires_ctor_barrier = compiler_driver_->RequiresConstructorBarrier(self, |
| 320 | dex_compilation_unit.GetDexFile(), |
| 321 | dex_compilation_unit.GetClassDefIndex()); |
| 322 | } |
| 323 | } |
| 324 | |
Nicolas Geoffray | 3507105 | 2015-06-09 15:43:38 +0100 | [diff] [blame] | 325 | InvokeType invoke_type = invoke_instruction->GetOriginalInvokeType(); |
| 326 | if (invoke_type == kInterface) { |
| 327 | // We have statically resolved the dispatch. To please the class linker |
| 328 | // at runtime, we change this call as if it was a virtual call. |
| 329 | invoke_type = kVirtual; |
| 330 | } |
Nicolas Geoffray | e0fe7ae | 2015-03-09 10:02:49 +0000 | [diff] [blame] | 331 | HGraph* callee_graph = new (graph_->GetArena()) HGraph( |
Nicolas Geoffray | 0a23d74 | 2015-05-07 11:57:35 +0100 | [diff] [blame] | 332 | graph_->GetArena(), |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 333 | callee_dex_file, |
Nicolas Geoffray | 0a23d74 | 2015-05-07 11:57:35 +0100 | [diff] [blame] | 334 | method_index, |
Calin Juravle | 3cd4fc8 | 2015-05-14 15:15:42 +0100 | [diff] [blame] | 335 | requires_ctor_barrier, |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 336 | compiler_driver_->GetInstructionSet(), |
Nicolas Geoffray | 3507105 | 2015-06-09 15:43:38 +0100 | [diff] [blame] | 337 | invoke_type, |
Nicolas Geoffray | 0a23d74 | 2015-05-07 11:57:35 +0100 | [diff] [blame] | 338 | graph_->IsDebuggable(), |
| 339 | graph_->GetCurrentInstructionId()); |
David Brazdil | 5e8b137 | 2015-01-23 14:39:08 +0000 | [diff] [blame] | 340 | |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 341 | OptimizingCompilerStats inline_stats; |
David Brazdil | 5e8b137 | 2015-01-23 14:39:08 +0000 | [diff] [blame] | 342 | HGraphBuilder builder(callee_graph, |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 343 | &dex_compilation_unit, |
| 344 | &outer_compilation_unit_, |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 345 | resolved_method->GetDexFile(), |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 346 | compiler_driver_, |
Nicolas Geoffray | 9523a3e | 2015-07-17 11:51:28 +0000 | [diff] [blame] | 347 | &inline_stats, |
Mathieu Chartier | 736b560 | 2015-09-02 14:54:11 -0700 | [diff] [blame] | 348 | resolved_method->GetQuickenedInfo(), |
| 349 | dex_cache); |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 350 | |
David Brazdil | 5e8b137 | 2015-01-23 14:39:08 +0000 | [diff] [blame] | 351 | if (!builder.BuildGraph(*code_item)) { |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 352 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 353 | << " could not be built, so cannot be inlined"; |
| 354 | return false; |
| 355 | } |
| 356 | |
Nicolas Geoffray | 259136f | 2014-12-17 23:21:58 +0000 | [diff] [blame] | 357 | if (!RegisterAllocator::CanAllocateRegistersFor(*callee_graph, |
| 358 | compiler_driver_->GetInstructionSet())) { |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 359 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | 259136f | 2014-12-17 23:21:58 +0000 | [diff] [blame] | 360 | << " cannot be inlined because of the register allocator"; |
| 361 | return false; |
| 362 | } |
| 363 | |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 364 | if (!callee_graph->TryBuildingSsa()) { |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 365 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 366 | << " could not be transformed to SSA"; |
| 367 | return false; |
| 368 | } |
| 369 | |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 370 | size_t parameter_index = 0; |
| 371 | for (HInstructionIterator instructions(callee_graph->GetEntryBlock()->GetInstructions()); |
| 372 | !instructions.Done(); |
| 373 | instructions.Advance()) { |
| 374 | HInstruction* current = instructions.Current(); |
| 375 | if (current->IsParameterValue()) { |
| 376 | HInstruction* argument = invoke_instruction->InputAt(parameter_index++); |
| 377 | if (argument->IsNullConstant()) { |
| 378 | current->ReplaceWith(callee_graph->GetNullConstant()); |
| 379 | } else if (argument->IsIntConstant()) { |
| 380 | current->ReplaceWith(callee_graph->GetIntConstant(argument->AsIntConstant()->GetValue())); |
| 381 | } else if (argument->IsLongConstant()) { |
| 382 | current->ReplaceWith(callee_graph->GetLongConstant(argument->AsLongConstant()->GetValue())); |
| 383 | } else if (argument->IsFloatConstant()) { |
| 384 | current->ReplaceWith( |
| 385 | callee_graph->GetFloatConstant(argument->AsFloatConstant()->GetValue())); |
| 386 | } else if (argument->IsDoubleConstant()) { |
| 387 | current->ReplaceWith( |
| 388 | callee_graph->GetDoubleConstant(argument->AsDoubleConstant()->GetValue())); |
| 389 | } else if (argument->GetType() == Primitive::kPrimNot) { |
| 390 | current->SetReferenceTypeInfo(argument->GetReferenceTypeInfo()); |
| 391 | current->AsParameterValue()->SetCanBeNull(argument->CanBeNull()); |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 396 | // Run simple optimizations on the graph. |
Calin Juravle | 7a9c885 | 2015-04-21 14:07:50 +0100 | [diff] [blame] | 397 | HDeadCodeElimination dce(callee_graph, stats_); |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 398 | HConstantFolding fold(callee_graph); |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 399 | ReferenceTypePropagation type_propagation(callee_graph, handles_); |
Vladimir Marko | dc151b2 | 2015-10-15 18:02:30 +0100 | [diff] [blame^] | 400 | HSharpening sharpening(callee_graph, codegen_, dex_compilation_unit, compiler_driver_); |
Calin Juravle | acf735c | 2015-02-12 15:25:22 +0000 | [diff] [blame] | 401 | InstructionSimplifier simplify(callee_graph, stats_); |
Scott Wakeling | d60a1af | 2015-07-22 14:32:44 +0100 | [diff] [blame] | 402 | IntrinsicsRecognizer intrinsics(callee_graph, compiler_driver_); |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 403 | |
| 404 | HOptimization* optimizations[] = { |
Scott Wakeling | d60a1af | 2015-07-22 14:32:44 +0100 | [diff] [blame] | 405 | &intrinsics, |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 406 | &type_propagation, |
Vladimir Marko | dc151b2 | 2015-10-15 18:02:30 +0100 | [diff] [blame^] | 407 | &sharpening, |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 408 | &simplify, |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 409 | &dce, |
| 410 | &fold, |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 411 | }; |
| 412 | |
| 413 | for (size_t i = 0; i < arraysize(optimizations); ++i) { |
| 414 | HOptimization* optimization = optimizations[i]; |
| 415 | optimization->Run(); |
| 416 | } |
| 417 | |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 418 | size_t number_of_instructions_budget = kMaximumNumberOfHInstructions; |
Calin Juravle | ec74835 | 2015-07-29 13:52:12 +0100 | [diff] [blame] | 419 | if (depth_ + 1 < compiler_driver_->GetCompilerOptions().GetInlineDepthLimit()) { |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 420 | HInliner inliner(callee_graph, |
Vladimir Marko | dc151b2 | 2015-10-15 18:02:30 +0100 | [diff] [blame^] | 421 | codegen_, |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 422 | outer_compilation_unit_, |
| 423 | dex_compilation_unit, |
| 424 | compiler_driver_, |
Nicolas Geoffray | 454a481 | 2015-06-09 10:37:32 +0100 | [diff] [blame] | 425 | handles_, |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 426 | stats_, |
| 427 | depth_ + 1); |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 428 | inliner.Run(); |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 429 | number_of_instructions_budget += inliner.number_of_inlined_instructions_; |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 430 | } |
| 431 | |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 432 | // TODO: We should abort only if all predecessors throw. However, |
| 433 | // HGraph::InlineInto currently does not handle an exit block with |
| 434 | // a throw predecessor. |
| 435 | HBasicBlock* exit_block = callee_graph->GetExitBlock(); |
| 436 | if (exit_block == nullptr) { |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 437 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 438 | << " could not be inlined because it has an infinite loop"; |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 439 | return false; |
| 440 | } |
| 441 | |
| 442 | bool has_throw_predecessor = false; |
Vladimir Marko | 6058455 | 2015-09-03 13:35:12 +0000 | [diff] [blame] | 443 | for (HBasicBlock* predecessor : exit_block->GetPredecessors()) { |
| 444 | if (predecessor->GetLastInstruction()->IsThrow()) { |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 445 | has_throw_predecessor = true; |
| 446 | break; |
| 447 | } |
| 448 | } |
| 449 | if (has_throw_predecessor) { |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 450 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 451 | << " could not be inlined because one branch always throws"; |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 452 | return false; |
| 453 | } |
| 454 | |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 455 | HReversePostOrderIterator it(*callee_graph); |
Nicolas Geoffray | ef87c5d | 2015-01-30 12:41:14 +0000 | [diff] [blame] | 456 | it.Advance(); // Past the entry block, it does not contain instructions that prevent inlining. |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 457 | size_t number_of_instructions = 0; |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 458 | for (; !it.Done(); it.Advance()) { |
| 459 | HBasicBlock* block = it.Current(); |
| 460 | if (block->IsLoopHeader()) { |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 461 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 462 | << " could not be inlined because it contains a loop"; |
| 463 | return false; |
| 464 | } |
| 465 | |
| 466 | for (HInstructionIterator instr_it(block->GetInstructions()); |
| 467 | !instr_it.Done(); |
| 468 | instr_it.Advance()) { |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 469 | if (number_of_instructions++ == number_of_instructions_budget) { |
| 470 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
| 471 | << " could not be inlined because it is too big."; |
| 472 | return false; |
| 473 | } |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 474 | HInstruction* current = instr_it.Current(); |
Nicolas Geoffray | 276d9da | 2015-02-02 18:24:11 +0000 | [diff] [blame] | 475 | |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 476 | if (current->IsInvokeInterface()) { |
| 477 | // Disable inlining of interface calls. The cost in case of entering the |
| 478 | // resolution conflict is currently too high. |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 479 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 480 | << " could not be inlined because it has an interface call."; |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 481 | return false; |
| 482 | } |
| 483 | |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 484 | if (!same_dex_file && current->NeedsEnvironment()) { |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 485 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 486 | << " could not be inlined because " << current->DebugName() |
Nicolas Geoffray | d23eeef | 2015-05-18 22:31:29 +0100 | [diff] [blame] | 487 | << " needs an environment and is in a different dex file"; |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 488 | return false; |
| 489 | } |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 490 | |
Vladimir Marko | dc151b2 | 2015-10-15 18:02:30 +0100 | [diff] [blame^] | 491 | if (!same_dex_file && current->NeedsDexCacheOfDeclaringClass()) { |
Guillaume "Vermeille" Sanchez | ae09d2d | 2015-05-29 10:52:55 +0100 | [diff] [blame] | 492 | VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) |
Nicolas Geoffray | 9437b78 | 2015-03-25 10:08:51 +0000 | [diff] [blame] | 493 | << " could not be inlined because " << current->DebugName() |
| 494 | << " it is in a different dex file and requires access to the dex cache"; |
| 495 | return false; |
| 496 | } |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 497 | } |
| 498 | } |
Nicolas Geoffray | e418dda | 2015-08-11 20:03:09 -0700 | [diff] [blame] | 499 | number_of_inlined_instructions_ += number_of_instructions; |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 500 | |
Calin Juravle | 2e76830 | 2015-07-28 14:41:11 +0000 | [diff] [blame] | 501 | HInstruction* return_replacement = callee_graph->InlineInto(graph_, invoke_instruction); |
Calin Juravle | 214bbcd | 2015-10-20 14:54:07 +0100 | [diff] [blame] | 502 | if (return_replacement != nullptr) { |
| 503 | DCHECK_EQ(graph_, return_replacement->GetBlock()->GetGraph()); |
| 504 | } |
Calin Juravle | 2e76830 | 2015-07-28 14:41:11 +0000 | [diff] [blame] | 505 | |
| 506 | // When merging the graph we might create a new NullConstant in the caller graph which does |
| 507 | // not have the chance to be typed. We assign the correct type here so that we can keep the |
| 508 | // assertion that every reference has a valid type. This also simplifies checks along the way. |
| 509 | HNullConstant* null_constant = graph_->GetNullConstant(); |
| 510 | if (!null_constant->GetReferenceTypeInfo().IsValid()) { |
| 511 | ReferenceTypeInfo::TypeHandle obj_handle = |
| 512 | handles_->NewHandle(class_linker->GetClassRoot(ClassLinker::kJavaLangObject)); |
| 513 | null_constant->SetReferenceTypeInfo( |
| 514 | ReferenceTypeInfo::Create(obj_handle, false /* is_exact */)); |
| 515 | } |
| 516 | |
| 517 | if ((return_replacement != nullptr) |
| 518 | && (return_replacement->GetType() == Primitive::kPrimNot)) { |
| 519 | if (!return_replacement->GetReferenceTypeInfo().IsValid()) { |
| 520 | // Make sure that we have a valid type for the return. We may get an invalid one when |
| 521 | // we inline invokes with multiple branches and create a Phi for the result. |
| 522 | // TODO: we could be more precise by merging the phi inputs but that requires |
| 523 | // some functionality from the reference type propagation. |
| 524 | DCHECK(return_replacement->IsPhi()); |
Vladimir Marko | 05792b9 | 2015-08-03 11:56:49 +0100 | [diff] [blame] | 525 | size_t pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize(); |
Calin Juravle | 2e76830 | 2015-07-28 14:41:11 +0000 | [diff] [blame] | 526 | ReferenceTypeInfo::TypeHandle return_handle = |
Vladimir Marko | 05792b9 | 2015-08-03 11:56:49 +0100 | [diff] [blame] | 527 | handles_->NewHandle(resolved_method->GetReturnType(true /* resolve */, pointer_size)); |
Calin Juravle | 2e76830 | 2015-07-28 14:41:11 +0000 | [diff] [blame] | 528 | return_replacement->SetReferenceTypeInfo(ReferenceTypeInfo::Create( |
David Brazdil | baf89b8 | 2015-09-15 11:36:54 +0100 | [diff] [blame] | 529 | return_handle, return_handle->CannotBeAssignedFromOtherTypes() /* is_exact */)); |
Calin Juravle | 2e76830 | 2015-07-28 14:41:11 +0000 | [diff] [blame] | 530 | } |
| 531 | } |
Nicolas Geoffray | 7c5367b | 2014-12-17 10:13:46 +0000 | [diff] [blame] | 532 | |
Nicolas Geoffray | e53798a | 2014-12-01 10:31:54 +0000 | [diff] [blame] | 533 | return true; |
| 534 | } |
| 535 | |
| 536 | } // namespace art |