summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2017-06-02 10:51:55 +0100
committerVladimir Marko <vmarko@google.com>2017-06-02 11:00:59 +0100
commitec32f6402382303608544fdac5a88067781bdec5 (patch)
tree5a8cddd783a86d3ecb9c3565e65f8fad91e93ada /compiler/optimizing/code_generator.cc
parent8144b1ebea42feaa798419eaf53a6bbbf37822a9 (diff)
Delay allocating environment locations.
Many environments are killed before we get to the register allocation, so the early allocation of their locations was simply wasting memory. For the most expensive method of a certain app, this reduces EnvLocations with 64-bit dex2oat from 8657200 to 5339712 (-3.16MiB). Test: m test-art-host Test: testrunner.py --host Bug: 33650849 Change-Id: I70a02fc3c7ec87b54a87e989e1239dc4acfcf18b
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index 65f3c72e99..1605f8df17 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -557,6 +557,9 @@ void CodeGenerator::BlockIfInRegister(Location location, bool is_out) const {
}
void CodeGenerator::AllocateLocations(HInstruction* instruction) {
+ for (HEnvironment* env = instruction->GetEnvironment(); env != nullptr; env = env->GetParent()) {
+ env->AllocateLocations();
+ }
instruction->Accept(GetLocationBuilder());
DCHECK(CheckTypeConsistency(instruction));
LocationSummary* locations = instruction->GetLocations();