diff options
author | David Brazdil <dbrazdil@google.com> | 2016-03-02 16:48:20 +0000 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2016-04-04 11:21:30 +0100 |
commit | e3ff7b293be2a6791fe9d135d660c0cffe4bd73f (patch) | |
tree | d578d27cb78e6d2caef683cd8ac94c9a9752b192 /compiler/optimizing/code_generator_mips.cc | |
parent | 86ea7eeabe30c98bbe1651a51d03cb89776724e7 (diff) |
Refactor HGraphBuilder and SsaBuilder to remove HLocals
This patch merges the instruction-building phases from HGraphBuilder
and SsaBuilder into a single HInstructionBuilder class. As a result,
it is not necessary to generate HLocal, HLoadLocal and HStoreLocal
instructions any more, as the builder produces SSA form directly.
Saves 5-15% of arena-allocated memory (see bug for more data):
GMS 20.46MB => 19.26MB (-5.86%)
Maps 24.12MB => 21.47MB (-10.98%)
YouTube 28.60MB => 26.01MB (-9.05%)
Bug: 27894376
Change-Id: Iefe28d40600c169c5d306fd2c77034ae19476d90
Diffstat (limited to 'compiler/optimizing/code_generator_mips.cc')
-rw-r--r-- | compiler/optimizing/code_generator_mips.cc | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index 8b19f84e1c..2df37cd429 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -974,31 +974,6 @@ void CodeGeneratorMIPS::AddLocationAsTemp(Location location, LocationSummary* lo } } -Location CodeGeneratorMIPS::GetStackLocation(HLoadLocal* load) const { - Primitive::Type type = load->GetType(); - - switch (type) { - case Primitive::kPrimNot: - case Primitive::kPrimInt: - case Primitive::kPrimFloat: - return Location::StackSlot(GetStackSlot(load->GetLocal())); - - case Primitive::kPrimLong: - case Primitive::kPrimDouble: - return Location::DoubleStackSlot(GetStackSlot(load->GetLocal())); - - case Primitive::kPrimBoolean: - case Primitive::kPrimByte: - case Primitive::kPrimChar: - case Primitive::kPrimShort: - case Primitive::kPrimVoid: - LOG(FATAL) << "Unexpected type " << type; - } - - LOG(FATAL) << "Unreachable"; - return Location::NoLocation(); -} - void CodeGeneratorMIPS::MarkGCCard(Register object, Register value) { MipsLabel done; Register card = AT; @@ -4063,14 +4038,6 @@ void InstructionCodeGeneratorMIPS::VisitClearException(HClearException* clear AT __ StoreToOffset(kStoreWord, ZERO, TR, GetExceptionTlsOffset()); } -void LocationsBuilderMIPS::VisitLoadLocal(HLoadLocal* load) { - load->SetLocations(nullptr); -} - -void InstructionCodeGeneratorMIPS::VisitLoadLocal(HLoadLocal* load ATTRIBUTE_UNUSED) { - // Nothing to do, this is driven by the code generator. -} - void LocationsBuilderMIPS::VisitLoadString(HLoadString* load) { LocationSummary::CallKind call_kind = load->NeedsEnvironment() ? LocationSummary::kCallOnSlowPath @@ -4096,14 +4063,6 @@ void InstructionCodeGeneratorMIPS::VisitLoadString(HLoadString* load) { } } -void LocationsBuilderMIPS::VisitLocal(HLocal* local) { - local->SetLocations(nullptr); -} - -void InstructionCodeGeneratorMIPS::VisitLocal(HLocal* local) { - DCHECK_EQ(local->GetBlock(), GetGraph()->GetEntryBlock()); -} - void LocationsBuilderMIPS::VisitLongConstant(HLongConstant* constant) { LocationSummary* locations = new (GetGraph()->GetArena()) LocationSummary(constant); locations->SetOut(Location::ConstantLocation(constant)); @@ -4611,33 +4570,6 @@ void InstructionCodeGeneratorMIPS::VisitShr(HShr* shr) { HandleShift(shr); } -void LocationsBuilderMIPS::VisitStoreLocal(HStoreLocal* store) { - LocationSummary* locations = new (GetGraph()->GetArena()) LocationSummary(store); - Primitive::Type field_type = store->InputAt(1)->GetType(); - switch (field_type) { - case Primitive::kPrimNot: - case Primitive::kPrimBoolean: - case Primitive::kPrimByte: - case Primitive::kPrimChar: - case Primitive::kPrimShort: - case Primitive::kPrimInt: - case Primitive::kPrimFloat: - locations->SetInAt(1, Location::StackSlot(codegen_->GetStackSlot(store->GetLocal()))); - break; - - case Primitive::kPrimLong: - case Primitive::kPrimDouble: - locations->SetInAt(1, Location::DoubleStackSlot(codegen_->GetStackSlot(store->GetLocal()))); - break; - - default: - LOG(FATAL) << "Unimplemented local type " << field_type; - } -} - -void InstructionCodeGeneratorMIPS::VisitStoreLocal(HStoreLocal* store ATTRIBUTE_UNUSED) { -} - void LocationsBuilderMIPS::VisitSub(HSub* instruction) { HandleBinaryOp(instruction); } |