From ec32f6402382303608544fdac5a88067781bdec5 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 2 Jun 2017 10:51:55 +0100 Subject: 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 --- compiler/optimizing/code_generator.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/optimizing/code_generator.cc') 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(); -- cgit v1.2.3-59-g8ed1b