From 8c0c91a845568624815df026cfdac8c42ecccdf6 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 7 May 2015 11:46:05 +0100 Subject: Use a growable array instead of an environment during SSA. Using an environment was convenient because it contains a growable array. But there's no need for the environment abstraction when being used as a temporary holder for values of locals. Change-Id: Idf2883fe4b8f97a31ee70b3627c1bdd23ebfff0e --- compiler/optimizing/nodes.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index ab56aff32f..85c0361f46 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -500,6 +500,16 @@ void HBasicBlock::RemoveInstructionOrPhi(HInstruction* instruction, bool ensure_ } } +void HEnvironment::CopyFrom(const GrowableArray& locals) { + for (size_t i = 0; i < locals.Size(); i++) { + HInstruction* instruction = locals.Get(i); + SetRawEnvAt(i, instruction); + if (instruction != nullptr) { + instruction->AddEnvUseAt(this, i); + } + } +} + void HEnvironment::CopyFrom(HEnvironment* env) { for (size_t i = 0; i < env->Size(); i++) { HInstruction* instruction = env->GetInstructionAt(i); -- cgit v1.2.3-59-g8ed1b