summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
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
commite3ff7b293be2a6791fe9d135d660c0cffe4bd73f (patch)
treed578d27cb78e6d2caef683cd8ac94c9a9752b192 /compiler/optimizing/code_generator.cc
parent86ea7eeabe30c98bbe1651a51d03cb89776724e7 (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.cc')
-rw-r--r--compiler/optimizing/code_generator.cc17
1 files changed, 0 insertions, 17 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index 1d2273da9c..65e5c3ad48 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -299,23 +299,6 @@ void CodeGenerator::InitializeCodeGeneration(size_t number_of_spill_slots,
}
}
-int32_t CodeGenerator::GetStackSlot(HLocal* local) const {
- uint16_t reg_number = local->GetRegNumber();
- uint16_t number_of_locals = GetGraph()->GetNumberOfLocalVRegs();
- if (reg_number >= number_of_locals) {
- // Local is a parameter of the method. It is stored in the caller's frame.
- // TODO: Share this logic with StackVisitor::GetVRegOffsetFromQuickCode.
- return GetFrameSize() + InstructionSetPointerSize(GetInstructionSet()) // ART method
- + (reg_number - number_of_locals) * kVRegSize;
- } else {
- // Local is a temporary in this method. It is stored in this method's frame.
- return GetFrameSize() - FrameEntrySpillSize()
- - kVRegSize // filler.
- - (number_of_locals * kVRegSize)
- + (reg_number * kVRegSize);
- }
-}
-
void CodeGenerator::CreateCommonInvokeLocationSummary(
HInvoke* invoke, InvokeDexCallingConventionVisitor* visitor) {
ArenaAllocator* allocator = invoke->GetBlock()->GetGraph()->GetArena();