From ed59619b370ef23ffbb25d1d01f615e60a9262b6 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Fri, 23 Jan 2015 10:39:45 +0000 Subject: Optimizing: Speed up HEnvironment use removal Removal of use records from HEnvironment vregs involved iterating over potentially large linked lists which made compilation of huge methods very slow. This patch turns use lists into doubly-linked lists, stores pointers to the relevant nodes inside HEnvironment and subsequently turns the removals into constant-time operations. Change-Id: I0e1d4d782fd624e7b8075af75d4adf0a0634a1ee --- compiler/optimizing/ssa_builder.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/ssa_builder.h') diff --git a/compiler/optimizing/ssa_builder.h b/compiler/optimizing/ssa_builder.h index 2cbd51aa10..2eec87b618 100644 --- a/compiler/optimizing/ssa_builder.h +++ b/compiler/optimizing/ssa_builder.h @@ -36,14 +36,14 @@ class SsaBuilder : public HGraphVisitor { void BuildSsa(); - GrowableArray* GetLocalsFor(HBasicBlock* block) { + HEnvironment* GetLocalsFor(HBasicBlock* block) { HEnvironment* env = locals_for_.Get(block->GetBlockId()); if (env == nullptr) { env = new (GetGraph()->GetArena()) HEnvironment( GetGraph()->GetArena(), GetGraph()->GetNumberOfVRegs()); locals_for_.Put(block->GetBlockId(), env); } - return env->GetVRegs(); + return env; } HInstruction* ValueOfLocal(HBasicBlock* block, size_t local); @@ -60,7 +60,7 @@ class SsaBuilder : public HGraphVisitor { private: // Locals for the current block being visited. - GrowableArray* current_locals_; + HEnvironment* current_locals_; // Keep track of loop headers found. The last phase of the analysis iterates // over these blocks to set the inputs of their phis. -- cgit v1.2.3-59-g8ed1b