diff options
author | Calin Juravle <calin@google.com> | 2014-11-13 11:16:27 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-11-13 11:16:28 +0000 |
commit | d77ae8a11e6493ac738864eae073ca4909e4d847 (patch) | |
tree | f6835a2f659cedfc47975bf82f52f05927f8b4b2 /compiler/optimizing/code_generator.cc | |
parent | 39edb50e16334c8a4ebbfcf0efac38b25074a2dd (diff) | |
parent | f97f9fbfdf7f2e23c662f21081fadee6af37809d (diff) | |
download | android_art-d77ae8a11e6493ac738864eae073ca4909e4d847.tar.gz android_art-d77ae8a11e6493ac738864eae073ca4909e4d847.tar.bz2 android_art-d77ae8a11e6493ac738864eae073ca4909e4d847.zip |
Merge "[optimizing compiler] add HTemporary support for long and doubles"
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 6b5ec1d6ca..4d71cb780a 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -51,7 +51,7 @@ void CodeGenerator::CompileBaseline(CodeAllocator* allocator, bool is_leaf) { MarkNotLeaf(); } ComputeFrameSize(GetGraph()->GetNumberOfLocalVRegs() - + GetGraph()->GetNumberOfTemporaries() + + GetGraph()->GetTemporariesVRegSlots() + 1 /* filler */, 0, /* the baseline compiler does not have live registers at slow path */ GetGraph()->GetMaximumNumberOfOutVRegs() @@ -150,12 +150,15 @@ void CodeGenerator::ComputeFrameSize(size_t number_of_spill_slots, Location CodeGenerator::GetTemporaryLocation(HTemporary* temp) const { uint16_t number_of_locals = GetGraph()->GetNumberOfLocalVRegs(); + // The type of the previous instruction tells us if we need a single or double stack slot. + Primitive::Type type = temp->GetType(); + int32_t temp_size = (type == Primitive::kPrimLong) || (type == Primitive::kPrimDouble) ? 2 : 1; // Use the temporary region (right below the dex registers). int32_t slot = GetFrameSize() - FrameEntrySpillSize() - kVRegSize // filler - (number_of_locals * kVRegSize) - - ((1 + temp->GetIndex()) * kVRegSize); - return Location::StackSlot(slot); + - ((temp_size + temp->GetIndex()) * kVRegSize); + return temp_size == 2 ? Location::DoubleStackSlot(slot) : Location::StackSlot(slot); } int32_t CodeGenerator::GetStackSlot(HLocal* local) const { |