From fd88f16100cceafbfde1b4f095f17e89444d6fa8 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 3 Jun 2015 11:23:52 +0100 Subject: Factorize code for common LocationSummary of HInvoke. This is one step forward, we could factorize more, but I wanted to get this out of the way first. Change-Id: I6ae411a737eebaecb64974f47af507ce0cfbae85 --- compiler/optimizing/code_generator.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'compiler/optimizing/code_generator.cc') 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 -- cgit v1.2.3-59-g8ed1b