diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-06-03 11:23:52 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-06-03 11:23:52 +0100 |
commit | fd88f16100cceafbfde1b4f095f17e89444d6fa8 (patch) | |
tree | fdb6d0520ca419acef9e953e74dcbd7d908bc4dd /compiler/optimizing/code_generator.cc | |
parent | 1aebdae18678403bdac078cbbe1f7dd4243c44f3 (diff) |
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
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 |