diff options
| -rw-r--r-- | compiler/optimizing/builder.cc | 41 | ||||
| -rw-r--r-- | compiler/optimizing/builder.h | 14 |
2 files changed, 27 insertions, 28 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index d2149763ba..1483403ae2 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -885,20 +885,13 @@ bool HGraphBuilder::BuildInvoke(const Instruction& instruction, table_index); } - if (!SetupArgumentsForInvoke(invoke, - number_of_vreg_arguments, - args, - register_index, - is_range, - descriptor, - clinit_check)) { - return false; - } - - current_block_->AddInstruction(invoke); - latest_result_ = invoke; - - return true; + return SetupArgumentsAndAddInvoke(invoke, + number_of_vreg_arguments, + args, + register_index, + is_range, + descriptor, + clinit_check)); } HClinitCheck* HGraphBuilder::ProcessClinitCheckForInvoke( @@ -1047,13 +1040,13 @@ HInvokeStaticOrDirect::DispatchInfo HGraphBuilder::ComputeDispatchInfo( method_load_kind, code_ptr_location, method_load_data, direct_code_ptr }; } -bool HGraphBuilder::SetupArgumentsForInvoke(HInvoke* invoke, - uint32_t number_of_vreg_arguments, - uint32_t* args, - uint32_t register_index, - bool is_range, - const char* descriptor, - HClinitCheck* clinit_check) { +bool HGraphBuilder::SetupArgumentsAndAddInvoke(HInvoke* invoke, + uint32_t number_of_vreg_arguments, + uint32_t* args, + uint32_t register_index, + bool is_range, + const char* descriptor, + HClinitCheck* clinit_check) { size_t start_index = 0; size_t argument_index = 0; uint32_t descriptor_index = 1; // Skip the return type. @@ -1131,8 +1124,14 @@ bool HGraphBuilder::SetupArgumentsForInvoke(HInvoke* invoke, uint32_t orig_this_reg = is_range ? register_index : args[0]; HInstruction* fake_string = LoadLocal(orig_this_reg, Primitive::kPrimNot); invoke->SetArgumentAt(argument_index, fake_string); + current_block_->AddInstruction(invoke); PotentiallySimplifyFakeString(orig_this_reg, invoke->GetDexPc(), invoke); + } else { + current_block_->AddInstruction(invoke); } + + latest_result_ = invoke; + return true; } diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h index c179ea2ce1..19dd94475a 100644 --- a/compiler/optimizing/builder.h +++ b/compiler/optimizing/builder.h @@ -272,13 +272,13 @@ class HGraphBuilder : public ValueObject { uintptr_t direct_method, uintptr_t direct_code); - bool SetupArgumentsForInvoke(HInvoke* invoke, - uint32_t number_of_vreg_arguments, - uint32_t* args, - uint32_t register_index, - bool is_range, - const char* descriptor, - HClinitCheck* clinit_check); + bool SetupArgumentsAndAddInvoke(HInvoke* invoke, + uint32_t number_of_vreg_arguments, + uint32_t* args, + uint32_t register_index, + bool is_range, + const char* descriptor, + HClinitCheck* clinit_check); HClinitCheck* ProcessClinitCheckForInvoke( uint32_t dex_pc, |