diff options
author | 2015-06-03 10:56:35 +0000 | |
---|---|---|
committer | 2015-06-03 10:56:36 +0000 | |
commit | 99c2abcb085d254b17a870442ca188fa09ab58de (patch) | |
tree | 88347471e73c0d5374eafafa35181d6bb7b729f0 /compiler/optimizing/code_generator.cc | |
parent | 2d48b49436c12b649efebe8d40b625777d98a9de (diff) | |
parent | fd88f16100cceafbfde1b4f095f17e89444d6fa8 (diff) |
Merge "Factorize code for common LocationSummary of HInvoke."
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 0cd63a679c..65aea680fe 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -288,6 +288,20 @@ int32_t CodeGenerator::GetStackSlot(HLocal* local) const { } } +void CodeGenerator::CreateCommonInvokeLocationSummary( + HInvoke* invoke, InvokeDexCallingConventionVisitor* visitor){ + ArenaAllocator* allocator = invoke->GetBlock()->GetGraph()->GetArena(); + LocationSummary* locations = new (allocator) LocationSummary(invoke, LocationSummary::kCall); + locations->AddTemp(visitor->GetMethodLocation()); + + for (size_t i = 0; i < invoke->GetNumberOfArguments(); i++) { + HInstruction* input = invoke->InputAt(i); + locations->SetInAt(i, visitor->GetNextLocation(input->GetType())); + } + + locations->SetOut(visitor->GetReturnLocation(invoke->GetType())); +} + void CodeGenerator::BlockIfInRegister(Location location, bool is_out) const { // The DCHECKS below check that a register is not specified twice in // the summary. The out location can overlap with an input, so we need |