diff options
author | David Brazdil <dbrazdil@google.com> | 2015-01-23 10:39:45 +0000 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2015-01-26 16:13:57 +0000 |
commit | ed59619b370ef23ffbb25d1d01f615e60a9262b6 (patch) | |
tree | 6c93bb6ceff95f7aaf232825e050eecc05c7282d /compiler/optimizing/ssa_builder.h | |
parent | f90eec005997f98c1a9f874fbbf68414e5f9c766 (diff) | |
download | art-ed59619b370ef23ffbb25d1d01f615e60a9262b6.tar.gz art-ed59619b370ef23ffbb25d1d01f615e60a9262b6.tar.bz2 art-ed59619b370ef23ffbb25d1d01f615e60a9262b6.zip |
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
Diffstat (limited to 'compiler/optimizing/ssa_builder.h')
-rw-r--r-- | compiler/optimizing/ssa_builder.h | 6 |
1 files changed, 3 insertions, 3 deletions
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<HInstruction*>* 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<HInstruction*>* 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. |